/**
 * Vulpes Cookie Consent Styles
 * Styles pour la bannière et le panneau de consentement cookies
 */

/* ==================== Banner ==================== */

#cookie-consent-banner {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cookie-consent-banner.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.cookie-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#cookie-consent-banner.visible .cookie-banner {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cookie-banner-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1E293B;
}

.cookie-icon {
    width: 28px;
    height: 28px;
    color: #F59E0B;
    flex-shrink: 0;
}

.cookie-banner-content p {
    margin: 0 0 1.25rem 0;
    color: #64748B;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.cookie-banner-content a {
    color: #F59E0B;
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner-content a:hover {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==================== Buttons ==================== */

.cookie-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.cookie-btn-accept {
    background: #F59E0B;
    color: white;
}

.cookie-btn-accept:hover {
    background: #D97706;
}

.cookie-btn-reject {
    background: #E2E8F0;
    color: #475569;
}

.cookie-btn-reject:hover {
    background: #CBD5E1;
}

.cookie-btn-settings {
    background: transparent;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

.cookie-btn-settings:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.cookie-btn-secondary {
    background: transparent;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

.cookie-btn-secondary:hover {
    background: #F8FAFC;
}

/* ==================== Settings Panel ==================== */

#cookie-consent-settings {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#cookie-consent-settings.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cookie-settings-panel {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#cookie-consent-settings.visible .cookie-settings-panel {
    transform: scale(1);
}

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

.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1E293B;
}

.cookie-settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F1F5F9;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cookie-settings-close:hover {
    background: #E2E8F0;
}

.cookie-settings-close svg {
    width: 18px;
    height: 18px;
    color: #64748B;
}

.cookie-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

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

/* ==================== Cookie Categories ==================== */

.cookie-category {
    padding: 1rem 0;
    border-bottom: 1px solid #F1F5F9;
}

.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1E293B;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748B;
    line-height: 1.4;
}

.cookie-category-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.cookie-category-details small {
    font-size: 0.75rem;
    color: #94A3B8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==================== Toggle Switch ==================== */

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #CBD5E1;
    border-radius: 26px;
    transition: background 0.2s ease;
}

.cookie-toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #F59E0B;
}

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

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.cookie-toggle.disabled {
    opacity: 0.6;
}

.cookie-toggle.disabled .cookie-toggle-slider {
    cursor: not-allowed;
}

.cookie-toggle.disabled input:checked + .cookie-toggle-slider {
    background: #94A3B8;
}

/* ==================== Responsive ==================== */

@media (max-width: 640px) {
    .cookie-banner-content {
        padding: 1.25rem 1rem;
    }

    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-settings-panel {
        max-height: 85vh;
    }

    .cookie-settings-body {
        padding: 0.75rem 1rem;
    }

    .cookie-settings-header,
    .cookie-settings-footer {
        padding: 1rem;
    }

    .cookie-settings-footer {
        flex-direction: column-reverse;
    }

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

/* ==================== Dark Mode Support ==================== */

@media (prefers-color-scheme: dark) {
    .cookie-banner {
        background: #1E293B;
    }

    .cookie-banner-header h3 {
        color: #F1F5F9;
    }

    .cookie-banner-content p {
        color: #94A3B8;
    }

    .cookie-btn-reject {
        background: #334155;
        color: #E2E8F0;
    }

    .cookie-btn-reject:hover {
        background: #475569;
    }

    .cookie-btn-settings {
        color: #94A3B8;
        border-color: #475569;
    }

    .cookie-btn-settings:hover {
        background: #334155;
    }

    .cookie-settings-panel {
        background: #1E293B;
    }

    .cookie-settings-header {
        border-color: #334155;
    }

    .cookie-settings-header h3 {
        color: #F1F5F9;
    }

    .cookie-settings-close {
        background: #334155;
    }

    .cookie-settings-close:hover {
        background: #475569;
    }

    .cookie-settings-close svg {
        color: #94A3B8;
    }

    .cookie-settings-footer {
        border-color: #334155;
    }

    .cookie-category {
        border-color: #334155;
    }

    .cookie-category-info h4 {
        color: #F1F5F9;
    }

    .cookie-category-info p {
        color: #94A3B8;
    }

    .cookie-toggle-slider {
        background: #475569;
    }

    .cookie-btn-secondary {
        color: #94A3B8;
        border-color: #475569;
    }

    .cookie-btn-secondary:hover {
        background: #334155;
    }
}
