/**
 * Cookie Consent Banner - RGPD Compliant
 * Plateforme Orientation Métiers
 */

/* ===========================================
   BANNER PRINCIPAL (bas de page)
   =========================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
}

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

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

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

.cookie-banner-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.cookie-banner-text h3 i {
    color: #ffc107;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: #7ab8ff;
    text-decoration: underline;
}

.cookie-banner-text a:hover {
    color: #fff;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Boutons du banner */
.cookie-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-btn-accept-all {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.cookie-btn-accept-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.cookie-btn-reject-all {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-reject-all:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.cookie-btn-settings {
    background: transparent;
    color: #7ab8ff;
    padding: 12px 16px;
}

.cookie-btn-settings:hover {
    color: #fff;
    text-decoration: underline;
}

/* ===========================================
   MODAL DE PARAMETRES
   =========================================== */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal-overlay.visible .cookie-modal {
    transform: scale(1);
}

.cookie-modal-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.cookie-modal-header h2 i {
    color: #ffc107;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cookie-modal-close:hover {
    opacity: 1;
}

.cookie-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    margin-bottom: 25px;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Categories de cookies */
.cookie-category {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-category-header:hover {
    background: #f0f0f0;
}

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

.cookie-category-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-info h4 i {
    font-size: 0.9rem;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.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: 28px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

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

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

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

/* Badge obligatoire */
.cookie-badge-required {
    display: inline-block;
    background: #e9ecef;
    color: #666;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 500;
}

/* Details de la categorie */
.cookie-category-details {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #fff;
}

.cookie-category.expanded .cookie-category-details {
    max-height: 200px;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

.cookie-category-details p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.cookie-list {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #888;
}

.cookie-list strong {
    color: #1a1a2e;
}

/* Footer du modal */
.cookie-modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.cookie-btn-save {
    background: linear-gradient(135deg, #268eff 0%, #26b3ff 100%);
    color: #fff;
}

.cookie-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(38, 142, 255, 0.4);
}

.cookie-btn-cancel {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.cookie-btn-cancel:hover {
    background: #f0f0f0;
}

/* ===========================================
   LIEN GERER MES COOKIES
   =========================================== */
.cookie-manage-link {
    cursor: pointer;
    color: inherit;
    text-decoration: underline;
    transition: color 0.2s;
}

.cookie-manage-link:hover {
    color: #268eff;
}

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

    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }

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

    .cookie-banner-text h3 {
        justify-content: center;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }

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

    .cookie-modal {
        max-height: 90vh;
    }

    .cookie-modal-body {
        padding: 15px;
    }

    .cookie-category-header {
        padding: 12px 15px;
    }

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

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

@media (max-width: 480px) {
    .cookie-banner-actions {
        flex-direction: column;
    }

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