/* Styles généraux */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* En-tête et navigation */
.menu-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.menu-header h1 {
    font-size: 28px;
    margin: 0 0 8px 0;
    color: #2c3e50;
}

.menu-header h2 {
    font-size: 18px;
    font-weight: normal;
    color: #7f8c8d;
    margin: 0;
}

.week-navigation {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-btn {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: #45a049;
}

/* Styles pour les vues desktop */
.desktop-view {
    display: block;
}

.menu-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    table-layout: fixed;
}

.menu-table th, .menu-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.menu-table th {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

.menu-table th:first-child {
    width: 60px;
}

.period-cell {
    width: 30px;
    background-color: #f2f2f2;
    font-weight: bold;
    vertical-align: middle;
}

.period-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    margin: 0 auto;
    font-size: 16px;
    letter-spacing: 1px;
    color: #4CAF50;
}

.separator-row td {
    padding: 0;
    height: 6px;
    background-color: #4CAF50;
    opacity: 0.5;
    border: none;
}

.menu-item {
    transition: background-color 0.3s;
}

/* Style spécial pour le plat principal (combiné) */
tr:nth-child(1) .menu-item,
tr:nth-child(2) .menu-item,
tr:nth-child(3) .menu-item,
tr:nth-child(4) .menu-item,
tr:nth-child(6) .menu-item,
tr:nth-child(7) .menu-item,
tr:nth-child(8) .menu-item,
tr:nth-child(9) .menu-item {
    font-weight: bold;
    background-color: #f9f9f9;
    border-left: 3px solid #4CAF50;
    border-right: 3px solid #4CAF50;
}

.menu-item:hover {
    background-color: #f1f8e9;
}

/* Styles pour la vue mobile */
.mobile-view {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.day-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
    background-color: white;
}

.day-header {
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meal-section {
    margin-bottom: 10px;
}

.meal-header {
    background-color: #f5f5f5;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    color: #2e7d32;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
}

.meal-content {
    padding: 0;
    background-color: white;
}

.meal-item {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    border-bottom: 1px dashed #e0e0e0;
    text-align: center;
}

.meal-item:last-child {
    border-bottom: none;
}

/* Style spécifique pour les items alternés pour un contraste visuel */
.meal-item:nth-child(odd) {
    background-color: #f9f9f9;
}

.item-label {
    font-weight: bold;
    color: #4CAF50;
    width: 100%;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.item-value {
    width: 100%;
    text-align: center;
    
    white-space: pre-line;
    font-size: 16px;
    color: #333;
    margin-top: 0; /* S'assurer qu'il n'y a pas de marge en haut */
}
/* S'assurer que le saut de ligne fonctionne bien pour les plats */
.item-value br {
    display: block;
    content: "";
    margin-top: 2px;
}

/* Ajouter un peu d'espace pour le dernier élément */
.meal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 10px;
}

/* Media Query pour la responsivité */
@media screen and (max-width: 992px) {
    .container {
        padding: 15px;
    }
    
    .menu-table {
        font-size: 14px;
    }
    
    .menu-table th, .menu-table td {
        padding: 8px 5px;
    }
}

@media screen and (max-width: 768px) {
    .desktop-view {
        display: none;
    }
    
    .mobile-view {
        display: flex;
    }
    
    .week-navigation {
        justify-content: center;
    }
    
    .nav-btn {
        width: 95%;
        flex: 1;
        min-width: 100px;
        font-size: 14px;
        padding: 8px;
    }
    
    .menu-header h1 {
        font-size: 24px;
    }
    
    .menu-header h2 {
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    .week-navigation {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 95%;
    }
}

@media screen and (max-width: 320px) {
    .item-label {
        font-size: 13px;
    }
    
    .item-value {
        font-size: 15px;
    }
}

/* Styles d'impression */
@media print {
    .nav-buttons, .week-navigation {
        display: none;
    }
    
    .container {
        box-shadow: none;
        padding: 0;
    }
    
    body {
        padding: 0;
        background-color: white;
    }
    
    .menu-table th, .menu-table td {
        border: 1px solid #000;
    }
    
    .mobile-view {
        display: none !important;
    }
    
    .desktop-view {
        display: block !important;
    }
}