/**
 * 🍪 ZINEINSIGHT GLOBAL COOKIES CSS
 * Styles globaux pour le système de cookies RGPD
 * Version: 2.0 - Global Implementation
 */

/* ============================= */
/* 🍪 COOKIES BANNER GLOBAL */
/* ============================= */
.cookies-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 102, 255, 0.1);
    padding: 20px;
    z-index: 10000;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    display: none;
}

.cookies-banner.show {
    transform: translateY(0);
    display: block;
}

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

.cookies-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 300px;
}

.cookies-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.cookies-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cookies-text p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    max-width: 500px;
}

.cookies-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Styles des boutons cookies */
.cookies-actions .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.cookies-actions .btn-ghost {
    background: transparent;
    color: #666;
    border: 1px solid rgba(102, 102, 102, 0.3);
}

.cookies-actions .btn-ghost:hover {
    background: rgba(102, 102, 102, 0.1);
    color: #333;
}

.cookies-actions .btn-secondary {
    background: rgba(0, 102, 255, 0.1);
    color: #0066ff;
    border: 1px solid rgba(0, 102, 255, 0.2);
}

.cookies-actions .btn-secondary:hover {
    background: rgba(0, 102, 255, 0.15);
    border-color: rgba(0, 102, 255, 0.3);
}

.cookies-actions .btn-primary {
    background: linear-gradient(135deg, #0066ff, #0052cc);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.cookies-actions .btn-primary:hover {
    background: linear-gradient(135deg, #0052cc, #003399);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

.cookies-actions .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================= */
/* 🛠️ COOKIES MODAL GLOBAL */
/* ============================= */
.cookies-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.cookies-modal-overlay.active {
    opacity: 1;
}

.cookies-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookies-modal-overlay.active .cookies-modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #666;
    background: rgba(0, 0, 0, 0.05);
}

.modal-content {
    padding: 16px 24px;
}

.cookie-category {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.category-info {
    flex: 1;
}

.category-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.category-info p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

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

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

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

.toggle-switch input:checked + label {
    background-color: #0066ff;
}

.toggle-switch input:checked + label:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-footer .btn-ghost {
    background: transparent;
    color: #666;
    border: 1px solid rgba(102, 102, 102, 0.3);
}

.modal-footer .btn-ghost:hover {
    background: rgba(102, 102, 102, 0.1);
    color: #333;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #0066ff, #0052cc);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #0052cc, #003399);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
}

/* ============================= */
/* 🍞 TOAST NOTIFICATIONS */
/* ============================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
    border-left: 4px solid #0066ff;
}

.toast.show {
    transform: translateX(0);
}

.toast.toast-success {
    border-left-color: #10b981;
}

.toast.toast-info {
    border-left-color: #3b82f6;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
    font-weight: 500;
}

/* ============================= */
/* 📱 RESPONSIVE DESIGN */
/* ============================= */
@media (max-width: 768px) {
    .cookies-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .cookies-info {
        align-items: center;
        text-align: center;
        min-width: auto;
    }
    
    .cookies-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cookies-actions .btn {
        flex: 1;
        min-width: 80px;
    }
    
    .cookies-modal {
        width: 95%;
        margin: 20px;
        max-height: 85vh;
    }
    
    .modal-header,
    .modal-content,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .category-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .toggle-switch {
        align-self: flex-end;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .toast {
        left: 10px;
        right: 10px;
        top: 10px;
        transform: translateY(-100px);
        max-width: none;
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .cookies-banner {
        padding: 16px;
    }
    
    .cookies-text h3 {
        font-size: 16px;
    }
    
    .cookies-text p {
        font-size: 13px;
    }
    
    .cookies-icon {
        font-size: 28px;
    }
    
    .cookies-actions .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ============================= */
/* 🎨 ANIMATIONS & TRANSITIONS */
/* ============================= */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cookies-banner.show {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookies-modal-overlay.active .cookies-modal {
    animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================= */
/* 🌙 DARK MODE SUPPORT */
/* ============================= */
@media (prefers-color-scheme: dark) {
    .cookies-banner {
        background: rgba(26, 26, 26, 0.98);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .cookies-text h3 {
        color: #ffffff;
    }
    
    .cookies-text p {
        color: #cccccc;
    }
    
    .cookies-modal {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .modal-header {
        border-bottom-color: #333;
    }
    
    .modal-header h2 {
        color: #ffffff;
    }
    
    .modal-close {
        color: #ccc;
    }
    
    .modal-close:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .cookie-category {
        border-bottom-color: #333;
    }
    
    .category-info h3 {
        color: #ffffff;
    }
    
    .category-info p {
        color: #cccccc;
    }
    
    .modal-footer {
        border-top-color: #333;
    }
    
    .toast {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .toast-message {
        color: #ffffff;
    }
}

/* ============================= */
/* 🚀 PERFORMANCE OPTIMIZATIONS */
/* ============================= */
.cookies-banner,
.cookies-modal-overlay,
.toast {
    will-change: transform, opacity;
}

.cookies-banner {
    contain: layout style paint;
}

.cookies-modal {
    contain: layout style paint;
    overscroll-behavior: contain;
}

/* Préchargement des transitions */
.cookies-banner *,
.cookies-modal *,
.toast * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
