/* ========================
   Page liturgie
======================== */
.liturgie-page {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    max-width: 1200px; 
    margin: 20px auto; 
    padding: 20px;      
    min-height: calc(100vh - 80px); /* occupe presque tout l'écran */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.liturgie-form-container {
    flex: 1;
    min-width: 400px;
}

.liturgie-sidebar {
    width: 280px;
    position: sticky;
    top: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Table des matières */
.liturgie-toc {
    position: sticky;
    top: 10px;
    margin-bottom: 20px;
    background: #f0f8ff;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 280px;
}
.liturgie-toc h3 {
    margin-top: 0;
    color: #0073e6;
    font-size: 1.1rem;
}
.liturgie-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 5px 0 0 0;
}
.liturgie-toc li {
    margin-bottom: 6px;
}
.liturgie-toc a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}
.liturgie-toc a:hover {
    color: #0073e6;
}

/* Titres et formulaires */
.liturgie-form h1 {
    color: #0073e6;
    font-size: 2rem;
    margin-bottom: 20px;
}
.liturgie-form h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Lectures */
.lecture-block {
    border: 1px solid #1f2ce6;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

/* Chants */
select.chant-select {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}
select.chant-select:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 5px rgba(0,115,230,0.3);
}

/* Prévisualisation chant */
.preview-chant {
    border: 1px solid #ddd;
    padding: 8px;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* Boutons */
button, .btn-press, .btn-secondary {
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-press { 
    background: #0073e6; 
    color: #fff; 
    border: none; 
}
.btn-press:active { transform: scale(0.95); }
.btn-secondary { 
    background: #899197; 
    color: #fff; 
    border: none; 
}

.form-actions {
    display: flex;
    justify-content: center; 
    align-items: center;     
    gap: 10px;               
}


/* Sidebar communautés */
.comm-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.comm-card button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #999;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s,color 0.2s;
}
.comm-card button.selected {
    background: #0073e6;
    color: #fff;
}

/* Calendrier */
#calendar .flatpickr-calendar {
    font-size: 0.5rem;
    width: 150px;
}

/* Couleur liturgique */
.color-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid #312a2a;
}
.color-vert { background-color: #4CAF50; }
.color-rose { background-color: #FFB6C1; }
.color-violet { background-color: #8A2BE2; }
.color-blanc { background-color: #FFFFFF; }
.color-rouge { background-color: #FF0000; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 240px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    text-align: center;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.btn-primary {
    background: #96beee;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
}

/* ========================
   Responsive
======================== */
@media (max-width: 1024px) {

    .liturgie-page {
        flex-direction: column;
        max-width: 95%;
        min-height: auto;
        padding: 15px;
    }

    .liturgie-sidebar {
        width: 100%;
        order: 1;
        position: relative;
        top: auto;
    }

    .liturgie-form-container {
        order: 2;
    }

    .liturgie-toc { display: none; }
}
