/**
 * Styles pour le popup CGU de la contrathèque
 */

/* Sections afficheur/éditeur - Basculement entre les vues */
#afficheur {
    display: block; /* Visible par défaut */
}

#editeur {
    display: none; /* Masqué par défaut - sera affiché après acceptation des CGU */
}

/* Overlay (fond noir semi-transparent) */
.mlt-cgu-overlay {
    display: none; /* Caché par défaut */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.mlt-cgu-overlay.active {
    display: flex;
}

/* Popup modal */
.mlt-cgu-popup {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    animation: mlt-popup-slide-in 0.3s ease-out;
}

@keyframes mlt-popup-slide-in {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Titre du popup */
.mlt-cgu-popup h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 23px;
    font-weight: 700;
    color: #117857;
}

/* Contenu des CGU */
.mlt-cgu-content {
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.mlt-cgu-content h3 {
    font-size: 18px;
    margin-top: 15px;
    margin-bottom: 10px;
    color: #2271b1;
}

.mlt-cgu-content p {
    margin-bottom: 10px;
}

.mlt-cgu-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.mlt-cgu-content li {
    margin-bottom: 8px;
}

/* Section acceptation */
.mlt-cgu-acceptance {
    margin-bottom: 20px;
    padding: 15px;
    background: #66fda124;
    border-radius: 5px;
    color: #003146;
    font-size: 16px;
}

.mlt-cgu-acceptance label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.mlt-cgu-acceptance a {
    color: #117857;
    text-decoration: underline;
    font-weight: 600;
}

.mlt-cgu-acceptance a:hover {
    color: #66fda1;
}

.mlt-cgu-acceptance input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Boutons */
.mlt-cgu-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.mlt-cgu-button {
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 200px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background-color: #117857 !important;
    color: #66fda1 !important;
}

.mlt-cgu-button:hover:not(:disabled) {
    background-color: #66fda1 !important;
    color: #127857 !important;
}

.mlt-cgu-button-accept:disabled {
    background-color: #ccc !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Loading spinner (optionnel) */
.mlt-cgu-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.mlt-cgu-loading.active {
    display: block;
}

.mlt-cgu-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: mlt-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes mlt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .mlt-cgu-popup {
        padding: 20px;
        max-width: 95%;
    }

    .mlt-cgu-popup h2 {
        font-size: 20px;
    }

    .mlt-cgu-buttons {
        flex-direction: column;
    }

    .mlt-cgu-button {
        width: 100%;
    }
}
