/**
 * STYLES BANDEAU COOKIES JBD MEUBLES
 * Conforme RGPD et design moderne
 * 
 * @author Atelier JBD
 * @version 1.0
 */

/* BANDEAU COOKIES PRINCIPAL */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    color: white;
    padding: 25px;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
    border-top: 3px solid #ffffff;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
}

.cookie-banner.show {
    transform: translateY(0);
}

/* CONTENU DU BANDEAU */
.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: center;
}

.cookie-text {
    font-size: 1rem;
    line-height: 1.6;
}

.cookie-text h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

.cookie-text p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.cookie-text a {
    color: #ffffff;
    text-decoration: underline;
    transition: opacity 0.3s;
}

.cookie-text a:hover {
    opacity: 0.7;
}

/* BOUTONS DU BANDEAU */
.cookie-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', sans-serif;
}

.cookie-btn.accept {
    background: #ffffff;
    color: #000000;
    min-width: 140px;
}

.cookie-btn.accept:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.cookie-btn.refuse {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    min-width: 120px;
}

.cookie-btn.refuse:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
}

.cookie-btn.settings {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.5);
    font-size: 0.9rem;
    padding: 10px 20px;
}

.cookie-btn.settings:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.8);
}

/* MODAL PARAMÈTRES COOKIES */
.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;
}

.cookie-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cookie-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #000;
    text-align: center;
    font-weight: 300;
    letter-spacing: 2px;
}

/* CATÉGORIES DE COOKIES */
.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #ccc;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cookie-category.required {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #6c757d;
}

.cookie-category h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.cookie-category p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* TOGGLES (INTERRUPTEURS) */
.cookie-toggle {
    position: relative;
    width: 50px;
    height: 25px;
    background: #ccc;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.cookie-toggle.active {
    background: #000;
}

.cookie-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cookie-toggle.active::after {
    transform: translateX(25px);
}

.cookie-category.required .cookie-toggle {
    background: #000;
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-category.required .cookie-toggle::after {
    transform: translateX(25px);
}

/* BOUTONS DE LA MODAL */
.cookie-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.modal-btn.save {
    background: #000;
    color: white;
    min-width: 180px;
}

.modal-btn.save:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-btn.close {
    background: #f0f0f0;
    color: #333;
    min-width: 100px;
}

.modal-btn.close:hover {
    background: #e0e0e0;
}

/* BOUTON FERMER (X) */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #000;
}

/* INDICATEUR DE STATUT COOKIES */
.cookie-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-status.show {
    opacity: 1;
    transform: translateY(0);
}

.cookie-status:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* NOTIFICATIONS */
.cookie-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease-out;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.cookie-notification.success {
    background: #059669;
    color: white;
}

.cookie-notification.error {
    background: #dc2626;
    color: white;
}

.cookie-notification.info {
    background: #2563eb;
    color: white;
}

.cookie-notification button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.cookie-notification button:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .cookie-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .cookie-buttons {
        justify-content: center;
    }

    .cookie-modal-content {
        padding: 30px 20px;
        margin: 20px;
        max-height: 90vh;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }

    .cookie-modal-buttons {
        flex-direction: column;
        align-items: center;
    }

    .modal-btn {
        width: 100%;
        max-width: 250px;
    }

    .cookie-status {
        bottom: 10px;
        right: 10px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }

    .cookie-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 20px 15px;
    }

    .cookie-text h3 {
        font-size: 1.1rem;
    }

    .cookie-text p {
        font-size: 0.9rem;
    }

    .cookie-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .cookie-modal-content {
        padding: 25px 15px;
    }

    .cookie-category {
        padding: 15px;
    }
}

/* ANIMATIONS SUPPLÉMENTAIRES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-category {
    animation: fadeIn 0.3s ease-out;
}

.cookie-category:nth-child(1) { animation-delay: 0.1s; }
.cookie-category:nth-child(2) { animation-delay: 0.2s; }
.cookie-category:nth-child(3) { animation-delay: 0.3s; }
.cookie-category:nth-child(4) { animation-delay: 0.4s; }

/* SCROLLBAR PERSONNALISÉE POUR LA MODAL */
.cookie-modal-content::-webkit-scrollbar {
    width: 6px;
}

.cookie-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.cookie-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.cookie-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ACCESSIBILITÉ */
.cookie-btn:focus,
.modal-btn:focus,
.cookie-toggle:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.cookie-toggle:focus::after {
    box-shadow: 0 0 0 2px #2563eb;
}

/* ÉTATS DE CHARGEMENT */
.cookie-btn.loading {
    position: relative;
    color: transparent;
}

.cookie-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}