/* Cookie Consent Banner Styles */

 :root {
     --consent-bg: rgba(255, 255, 255, 0.98);
     --consent-text: #111827;
     --consent-border: rgba(0, 0, 0, 0.12);
     --consent-muted: #4b5563;
     --consent-card-bg: rgba(0, 0, 0, 0.03);
     --consent-card-bg-2: rgba(0, 0, 0, 0.02);
     --consent-btn-text: #374151;
     --consent-btn-border: rgba(0, 0, 0, 0.18);
     --consent-btn-hover-bg: rgba(0, 0, 0, 0.06);
 }
 
 @media (prefers-color-scheme: dark) {
     :root {
         --consent-bg: rgba(18, 18, 26, 0.98);
         --consent-text: #e0e0e0;
         --consent-border: rgba(255, 255, 255, 0.1);
         --consent-muted: #a1a1aa;
         --consent-card-bg: rgba(255, 255, 255, 0.03);
         --consent-card-bg-2: rgba(255, 255, 255, 0.02);
         --consent-btn-text: #a1a1a1;
         --consent-btn-border: #444;
         --consent-btn-hover-bg: rgba(255, 255, 255, 0.08);
     }
 }

/* Main banner container */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--consent-bg);
    color: var(--consent-text);
    padding: 16px 20px;
    z-index: 1000;
    border-top: 1px solid var(--consent-border);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

#cookie-consent-banner.show {
    opacity: 1;
    transform: translateY(0);
}

#cookie-consent-banner .consent-content {
    max-width: 1200px;
    margin: 0 auto;
}

#cookie-consent-banner .initial-view {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

#cookie-consent-banner .message {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    flex: 1;
    min-width: 250px;
    color: var(--consent-text);
}

#cookie-consent-banner .message a {
    color: #3a86ff;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
}

#cookie-consent-banner .message a:hover {
    text-decoration: underline;
}

#cookie-consent-banner .button-group {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#cookie-consent-banner button {
    background: transparent;
    color: var(--consent-btn-text);
    border: 1px solid var(--consent-btn-border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 44px;
    font-family: inherit;
    white-space: nowrap;
}

#cookie-consent-banner button.accept-btn, 
#cookie-consent-banner button.save-btn {
    background: #3a86ff;
    color: white;
    border: none;
    font-weight: 500;
}

#cookie-consent-banner button:hover {
    background: var(--consent-btn-hover-bg) !important;
    color: var(--consent-text) !important;
    border-color: var(--consent-btn-border) !important;
    transform: translateY(-1px);
}

#cookie-consent-banner button.accept-btn:hover, 
#cookie-consent-banner button.save-btn:hover {
    background: #2a75e6 !important;
    transform: translateY(-1px);
    border-color: transparent !important;
}

/* Expanded details view */
#cookie-details {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--consent-border);
}

.cookie-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--consent-card-bg);
    border-radius: 6px;
}

.cookie-category-info {
    flex: 1;
    margin-right: 15px;
}

.cookie-category-info .title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 1rem;
    color: var(--consent-text);
}

.cookie-category-info .description {
    font-size: 0.85rem;
    color: var(--consent-muted);
    line-height: 1.6;
}

.legal-text {
    font-size: 0.85rem;
    color: var(--consent-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--consent-card-bg-2);
    border-radius: 6px;
    border-left: 3px solid #3a86ff;
}

.legal-text a {
    color: #3a86ff;
    text-decoration: none;
}

.details-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
}

/* Toggle switch styling */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-top: 3px;
    flex-shrink: 0;
}

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

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--consent-muted);
    transition: .4s;
    border-radius: 24px;
}

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

input:checked + .cookie-slider {
    background-color: #3a86ff;
}

input:disabled + .cookie-slider {
    background-color: var(--consent-muted);
    cursor: not-allowed;
}

input:checked:disabled + .cookie-slider {
    background-color: #004a9e;
}

input:focus + .cookie-slider {
    box-shadow: 0 0 1px #3a86ff;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #cookie-consent-banner {
        padding: 16px;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #cookie-consent-banner .consent-content {
        max-height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    #cookie-consent-banner .initial-view {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    #cookie-consent-banner .button-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    #cookie-consent-banner button {
        width: 100%;
        flex-grow: 1;
        text-align: center;
    }
    
    .cookie-category {
        flex-direction: column;
        gap: 12px;
    }
    
    .cookie-category-info {
        margin-right: 0;
    }
}
