/* Prevent horizontal overflow when banner is present */
body {
    overflow-x: hidden;
}

/* Add bottom padding to main content when banner is visible */
main {
    padding-bottom: 120px; /* Space for banner */
}

@media (max-width: 768px) {
    main {
        padding-bottom: 100px; /* Less space on mobile */
    }
}

/* Ensure banner doesn't cause horizontal scroll */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw; /* Ensure full viewport width */
    background: #ffffff;
    border-top: 2px solid #e9ecef;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    padding: 1rem 0;
    animation: slideUp 0.3s ease-out;
    box-sizing: border-box; /* Include padding in width calculation */
    overflow-x: hidden; /* Prevent horizontal overflow */
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    box-sizing: border-box;
}

.cookie-consent-text {
    flex: 1;
    min-width: 0;
}

.cookie-consent-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
}

.cookie-consent-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 0;
}

.cookie-consent-link {
    color: #0d6efd;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-consent-link:hover {
    color: #0b5ed7;
}

.cookie-consent-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-consent-actions .btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cookie-consent-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Cookie Customization Modal */
.cookie-customize-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    box-sizing: border-box;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.cookie-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.cookie-modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cookie-modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-option {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f8f9fa;
}

.cookie-option:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cookie-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cookie-option-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.cookie-option-description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
    margin: 0;
}

/* Cookie Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #0d6efd;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #28a745;
    cursor: not-allowed;
}

.cookie-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e9ecef;
}

.cookie-modal-footer .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cookie-modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 0.75rem 0;
    }
    
    .cookie-consent-content {
        padding: 0 0.75rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-consent-text {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .cookie-consent-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .cookie-consent-actions .btn {
        flex: 1;
        min-width: 140px;
        max-width: 160px;
    }

    .cookie-modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 0.5rem 0;
    }
    
    .cookie-consent-content {
        padding: 0 0.5rem;
        gap: 0.75rem;
    }

    .cookie-consent-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .cookie-consent-description {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .cookie-consent-actions {
        gap: 0.4rem;
    }
    
    .cookie-consent-actions .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
        min-width: 120px;
        max-width: 140px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .cookie-consent-content {
        padding: 0 0.25rem;
        gap: 0.5rem;
    }
    
    .cookie-consent-title {
        font-size: 0.95rem;
    }
    
    .cookie-consent-description {
        font-size: 0.8rem;
    }
    
    .cookie-consent-actions .btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.4rem;
        min-width: 100px;
        max-width: 120px;
    }
}

/* Accessibility */
.cookie-consent-banner:focus-within {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

.cookie-toggle-slider:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .cookie-consent-banner {
        background: #05294c;
        border-top-color: #333;
    }

    .cookie-consent-title {
        color: #ffffff;
    }

    .cookie-consent-description {
        color: #cccccc;
    }

    .cookie-modal-content {
        background: #1a1a1a;
    }

    .cookie-modal-header h4 {
        color: #ffffff;
    }

    .cookie-option-header h5 {
        color: #ffffff;
    }

    .cookie-option-description {
        color: #cccccc;
    }
}