/* Overlay - fond noir transparent */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal container */
.modal {
    background: white;
    border-radius: 12px;
    max-width: 1140px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

/* Header du modal */
.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.modal-header-content {
    flex: 1;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-separator {
    width: 4px;
    height: 4px;
    background: #ccc;
    border-radius: 50%;
}

.book-info {
    color: #2c7a8f;
    font-weight: 600;
}

.chapter-info {
    color: #555;
}

/* Menu difficulté */
.difficulty-selector {
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
    margin-top: 12px;
    justify-content: space-between;
}

.difficulty-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    color: #666;
}

.difficulty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.difficulty-btn.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.difficulty-btn.facile.active {
    color: #28a745;
}

.difficulty-btn.intermediaire.active {
    color: #ff9800;
}

.difficulty-btn.difficile.active {
    color: #dc3545;
}

.resources-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-weight: normal;
}

/* Dates */
.dates-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
    font-size: 13px;
    color: #888;
}

.date-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-label {
    font-weight: 600;
}

/* Bouton fermer */
.modal-close {
    position: absolute;
    right:32px;
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* Corps du modal */
.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    font-size: 24px;
    margin: 32px 0 16px;
    color: #1a1a1a;
}

.article-content h3 {
    font-size: 20px;
    margin: 24px 0 12px;
    color: #2a2a2a;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.article-content ul, .article-content ol {
    margin: 16px 0;
    padding-left: 32px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content code {
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.article-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-content blockquote {
    /*border-left: 4px solid #2c7a8f;*/

    /*padding-left: 20px;
    margin: 20px 0;
    color: #555;
    font-style: italic;*/
}

blockquote footer{
    margin:0;
    padding: 0;
}

/* Scrollbar personnalisée */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Bouton pour ouvrir le modal (exemple) */
.open-modal-btn {
    padding: 12px 24px;
    background: #2c7a8f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.open-modal-btn:hover {
    background: #245f6f;
}

/* Responsive */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 22px;
    }

    .difficulty-selector {
        flex-wrap: wrap;
    }
}