/* =================================
   COOKIE BANNER STYLES
   Design moderne et conforme RGPD
   ================================= */

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 100%);
    color: white;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: none; /* Caché par défaut */
}

.cookie-banner.show {
    display: block;
    transform: translateY(0);
}

.cookie-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="100" cy="100" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="900" cy="200" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="300" cy="800" r="2.5" fill="rgba(255,255,255,0.1)"/><circle cx="700" cy="600" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.cookie-main {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.cookie-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 8px;
}

.cookie-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.cookie-text {
    flex: 1;
}

.cookie-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ff9500;
}

.cookie-description {
    opacity: 0.9;
    line-height: 1.6;
    font-size: 1rem;
}

.cookie-description a {
    color: #ff9500;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cookie-description a:hover {
    color: white;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cookie-btn:hover::before {
    left: 100%;
}

.btn-accept-all {
    background: linear-gradient(135deg, #ff9500, #e6850e);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.4);
}

.btn-accept-all:hover {
    background: linear-gradient(135deg, #e6850e, #d97706);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.5);
}

.btn-customize {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-customize:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-reject {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: auto;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

/* Modal de personnalisation */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.cookie-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, #1e5799, #2989d8);
    color: white;
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="0.8" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.modal-body {
    padding: 2rem;
}

.cookie-category {
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #ff9500;
    box-shadow: 0 5px 15px rgba(255, 149, 0, 0.1);
}

.category-header {
    background: #f8f9fa;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-info h4 {
    color: #1e5799;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.category-info p {
    color: #666;
    font-size: 0.9rem;
}

.cookie-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cookie-switch.active {
    background: #ff9500;
}

.cookie-switch.disabled {
    background: #28a745;
    cursor: not-allowed;
}

.switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cookie-switch.active .switch-slider {
    transform: translateX(24px);
}

.switch-label {
    font-size: 0.8rem;
    color: #666;
    margin-left: 0.5rem;
}

.modal-actions {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-radius: 0 0 20px 20px;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save {
    background: linear-gradient(135deg, #ff9500, #e6850e);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-content {
        padding: 1.5rem;
    }

    .cookie-main {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-icon {
        font-size: 2rem;
    }

    .cookie-title {
        font-size: 1.3rem;
    }

    .cookie-actions {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
        max-width: 280px;
    }

    .modal-content {
        margin: 1rem;
        max-height: 90vh;
    }

    .modal-header,
    .modal-body,
    .modal-actions {
        padding: 1.5rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}

/* Accessibility */
.cookie-btn:focus,
.modal-btn:focus,
.cookie-switch:focus {
    outline: 3px solid rgba(255, 149, 0, 0.5);
    outline-offset: 2px;
}

/* Animation d'apparition */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner.animate-in {
    animation: slideUp 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Effet de pulsation pour attirer l'attention */
.cookie-banner.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 -15px 50px rgba(255, 149, 0, 0.3); }
    100% { box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3); }
}