/* Style pour le Planning - Affichage */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Karla', sans-serif;
    background: #ffffff;
    padding: 20px;
}

.planning-container {
    max-width: 1400px;
    margin: 0 auto;
}

.planning-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.planning-section h3 {
    color: #164a75;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
}

.planning-section h4 {
    color: #1a5c86;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 15px;
}

.planning-section table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border: 1px solid #999 !important;
    table-layout: fixed;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #999;
}

.planning-table th,
.planning-table td {
    border: 1px solid #999 !important;
}

/* Largeurs des colonnes du tableau PC */
.planning-table thead th:nth-child(1),
.planning-table tbody td:nth-child(1) {
    width: 12%;
}

.planning-table thead th:nth-child(2),
.planning-table thead th:nth-child(3),
.planning-table thead th:nth-child(4),
.planning-table thead th:nth-child(5),
.planning-table tbody td:nth-child(2),
.planning-table tbody td:nth-child(3),
.planning-table tbody td:nth-child(4),
.planning-table tbody td:nth-child(5) {
    width: 22%;
}

.planning-section thead {
    background: #eceff1;
    text-align: left;
}

.planning-section th {
    padding: 12px;
    border: 1px solid #eee;
    font-size: 18px;
    color: #555;
    font-weight: 700;
}

.planning-section td {
    padding: 8px;
    border: 1px solid #eee;
    vertical-align: top;
    font-size: 14px;
}

.planning-section tbody tr {
    transition: background 0.3s;
}

.planning-section tbody tr:hover {
    background: #f9f9f9;
}

/* Styles pour les lignes spéciales */
.planning-section tbody tr[style*="background:#c4e6ff"] {
    font-weight: 600;
}

.planning-section tbody tr[style*="background:#f5f5f5"] {
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .planning-section {
        padding: 10px;
    }
    
    .planning-table {
        display: block !important;
        border: none !important;
        font-size: 14px;
        width: 100%;
    }
    
    .planning-table thead {
        display: none !important;
    }
    
    .planning-table tbody {
        display: block !important;
        width: 100%;
    }
    
    .planning-table tbody tr {
        display: block !important;
        border: 1px solid #999 !important;
        border-radius: 8px !important;
        padding: 2px !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        margin-bottom: 12px !important;
        width: 100%;
        min-height: auto;
    }
    
    .planning-table tbody tr:first-child {
        margin-top: 0;
        padding: 2px !important;
    }
    
    .planning-table tbody tr[style*="background:#3c69b2"] {
        border-left: 4px solid #3c69b2 !important;
        background: #2d5a9e !important;
        color: white !important;
    }
    
    .planning-table tbody tr[style*="background:#3c69b2"] td {
        color: white !important;
    }
    
    .planning-table tbody tr[style*="background:#3c69b2"] td:before {
        color: #e8f4fd !important;
        font-weight: 700;
    }
    
    .planning-table tbody tr[style*="background:#f5f5f5"] {
        opacity: 0.7;
        background: #fafafa !important;
    }
    
    .planning-table tbody tr td {
        display: flex !important;
        flex-direction: row;
        gap: 2px;
        width: 100% !important;
        border: 1px solid #ddd !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: left !important;
        font-size: 13px;
        align-items: center;
        line-height: 1;
        vertical-align: middle !important;
        height: 20px;
        overflow: hidden;
        white-space: nowrap;
        border-radius: 4px;
    }
    
    .planning-table tbody tr td:not(:last-child) {
        margin-bottom: 1px !important;
    }
    
    .planning-table tbody tr td:last-child {
        margin-bottom: 0 !important;
        white-space: normal;
        height: 20px;
        border-radius: 4px;
    }
    
    .planning-table td:before {
        content: attr(data-label);
        font-weight: 700;
        color: #1a5c86;
        flex-shrink: 0;
        min-width: 80px;
    }
    
    .planning-table td:first-child:before {
        content: "Date :";
    }
    
    .planning-table td:nth-child(2):before {
        content: "Présidence :";
    }
    
    .planning-table td:nth-child(3):before {
        content: "Message :";
    }
    
    .planning-table td:nth-child(4):before {
        content: "Thème :";
    }
    
    .planning-table td:nth-child(5):before {
        content: "Verset :";
    }
    
    .planning-section table {
        font-size: 12px;
    }
    
    .planning-section h3 {
        font-size: 18px;
    }
    
    .planning-section h4 {
        font-size: 18px;
    }
    
    /* Infobulle mobile - centrée et visible */
    .planning-verse-tooltip {
        position: relative;
        cursor: help;
        text-decoration: underline dotted;
        color: inherit;
    }
    
    .planning-verse-tooltip::after {
        content: attr(data-verse);
        position: fixed !important;
        bottom: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        background: #333;
        color: white;
        padding: 16px 12px;
        border-radius: 8px;
        font-size: 12px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: 85vw;
        max-width: 320px;
        max-height: 50vh;
        overflow-y: auto;
        
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 10000;
        pointer-events: auto;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        font-weight: 400;
        text-decoration: none;
        line-height: 1.5;
    }
    
    .planning-verse-tooltip::before {
        content: '';
        position: fixed !important;
        display: none;
    }
    
    .planning-verse-tooltip:focus::after {
        opacity: 1;
        visibility: visible;
    }
}

/* Très petit écran */
@media (max-width: 480px) {
    .planning-section {
        padding: 8px;
    }
    
    .planning-table tbody tr {
        padding: 8px !important;
        margin-bottom: 10px !important;
    }
    
    .planning-table td {
        font-size: 12px !important;
    }
    
    .planning-table td:before {
        font-size: 11px;
    }
    
    .planning-section h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
}
