/**
 * Styles pour le système de gestion des cookies
 * Groupe Abbatiello
 * Inclut : bandeau de consentement, panneau de personnalisation et page de gestion
 */

/* =============== BANDEAU DE CONSENTEMENT =============== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-banner-show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 280px;
}

.cookie-banner-title {
    font-family: "ZenAntiqueSoft", "Times New Roman", Times, serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #111;
}

.cookie-banner-message {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin: 0;
}

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

.cookie-link:hover {
    text-decoration: none;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =============== BOUTONS =============== */
.cookie-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-family: "MontserratVar", system-ui, -apple-system, sans-serif;
}

.cookie-btn-primary {
    background: #111;
    color: #fff;
    border-color: #111;
}

.cookie-btn-primary:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cookie-btn-secondary {
    background: #fff;
    color: #111;
}

.cookie-btn-secondary:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
}

.cookie-btn:active {
    transform: translateY(0);
}

/* =============== PANEL DE PERSONNALISATION =============== */
.cookie-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.cookie-panel-show {
    opacity: 1;
    visibility: visible;
}

.cookie-panel-content {
    background: #fff;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cookie-panel-show .cookie-panel-content {
    transform: scale(1);
}

.cookie-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-panel-header h2 {
    font-family: "ZenAntiqueSoft", "Times New Roman", Times, serif;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: #111;
}

.cookie-panel-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-panel-close:hover {
    color: #111;
}

.cookie-panel-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.cookie-panel-intro {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 32px 0;
}

.cookie-types-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* =============== TYPES DE COOKIES =============== */
.cookie-type-item {
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fafafa;
}

.cookie-type-item.cookie-type-required {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.15);
}

.cookie-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cookie-type-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.cookie-type-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #111;
    font-family: "MontserratVar", system-ui, -apple-system, sans-serif;
}

.cookie-type-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #111;
    color: #fff;
    border-radius: 4px;
}

.cookie-type-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* =============== SWITCH TOGGLE =============== */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

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

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

.cookie-switch input:checked + .cookie-switch-slider {
    background-color: #111;
}

.cookie-switch input:focus + .cookie-switch-slider {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

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

.cookie-switch input:disabled + .cookie-switch-slider {
    background-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-panel-footer {
    display: flex;
    gap: 12px;
    padding: 24px 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: flex-end;
}

/* =============== PAGE DE GESTION DES COOKIES =============== */
.cookies-page {
    padding: 120px 0 80px;
    min-height: 100vh;
}

.hero_cookies {
    text-align: center;
    padding: 60px 0;
    background: #f8f8f8;
    margin-bottom: 60px;
}

.hero_cookies h1 {
    font-family: "ZenAntiqueSoft", "Times New Roman", Times, serif;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #111;
}

.hero_cookies p {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 24px;
}

.cookies-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.cookies-article {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cookies-article section {
    margin-bottom: 48px;
}

.cookies-article section:last-child {
    margin-bottom: 0;
}

.cookies-article h2 {
    font-family: "ZenAntiqueSoft", "Times New Roman", Times, serif;
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: #111;
}

.cookies-article h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #111;
}

.cookies-article p {
    font-size: 16px;
    line-height: 1.7;
    color: #666;
    margin: 0 0 16px 0;
}

.cookie-type-card {
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 24px;
    background: #fafafa;
}

.cookie-type-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.cookie-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.cookie-badge.required {
    background: #111;
    color: #fff;
}

.cookie-badge.optional {
    background: #e0e0e0;
    color: #666;
}

.cookies-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.cookies-loading {
    padding: 40px;
    text-align: center;
    color: #666;
}

.cookies-preferences {
    margin: 32px 0;
}

.cookie-pref-item {
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 16px;
    background: #fafafa;
}

.cookie-pref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cookie-pref-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #111;
}

.cookie-pref-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 20px 16px;
    }

    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner-text {
        min-width: 100%;
    }

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

    .cookie-btn {
        width: 100%;
    }

    .cookie-panel {
        padding: 0;
    }

    .cookie-panel-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .cookie-panel-header {
        padding: 20px;
    }

    .cookie-panel-header h2 {
        font-size: 22px;
    }

    .cookie-panel-body {
        padding: 20px;
    }

    .cookie-panel-footer {
        flex-direction: column;
        padding: 20px;
    }

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

    .cookie-type-item {
        padding: 16px;
    }

    .cookie-type-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cookie-switch {
        align-self: flex-end;
    }

    /* Page de gestion - Responsive */
    .cookies-page {
        padding: 100px 0 60px;
    }

    .cookies-article {
        padding: 24px;
    }

    .cookies-article h2 {
        font-size: 24px;
    }

    .cookie-type-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookies-actions {
        flex-direction: column;
    }

    .cookies-actions .cookie-btn {
        width: 100%;
    }
}
