/**
 * Styles pour l'application "Come si Mangia Manu?"
 */

 :root {
    --color-background: #fdfdfd;
    --color-background-alt: #faf3eb;
    --color-beige: #fbf6f0;
    --color-brown: #a67c52;
    --color-cream: #f9f5ec;
    --color-gray: #767676;
    --color-red: #d1453b;
    --color-orange: #e96d28;
    --color-green: #5a9367;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-background);
    color: #333;
    font-family: 'Alegreya Sans', sans-serif;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    font-family: 'IM Fell English', serif;
    margin-bottom: 20px;
    color: var(--color-brown);
}

h1 {
    text-align: center;
    font-size: 2.2rem;
    margin-top: 10px;
}

a {
    color: var(--color-brown);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-red);
}

/* En-tête */
header {
    text-align: center;
    padding: 20px 0;
    position: relative;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 150px;
    border-radius: 50%;
    box-shadow: var(--shadow-soft);
}

.user-menu {
    margin-top: 10px;
    font-size: 14px;
}

.username {
    margin-right: 15px;
    font-weight: 500;
}

.logout-link {
    color: var(--color-red);
    font-weight: 500;
}

/* Pied de page */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 14px;
    color: var(--color-gray);
}

/* Formulaires */
.card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--color-brown);
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.radio-button {
    position: relative;
}

.radio-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-button label {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 20px;
    background-color: var(--color-background-alt);
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Styles pour les évaluations de repas */
.quality-1:checked + label { background-color: #d94141; color: white; }
.quality-2:checked + label { background-color: #e78641; color: white; }
.quality-3:checked + label { background-color: #f0b956; color: white; }
.quality-4:checked + label { background-color: #7daa63; color: white; }
.quality-5:checked + label { background-color: #489c4b; color: white; }

/* Styles pour les évaluations de service */
.service-1:checked + label { background-color: #d94141; color: white; }
.service-2:checked + label { background-color: #f0b956; color: white; }
.service-3:checked + label { background-color: #7daa63; color: white; }
.service-4:checked + label { background-color: #489c4b; color: white; }

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--color-red);
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #b13831;
}

/* Navigation */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.nav-btn {
    padding: 10px 15px;
    background-color: var(--color-cream);
    border: 1px solid var(--color-brown);
    border-radius: 5px;
    color: var(--color-brown);
    font-family: 'Alegreya Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: var(--color-brown);
    color: white;
}

/* Utilitaires */
.hidden {
    display: none !important;
}

/* Sélecteur de date */
.date-selector {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: var(--color-beige);
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

.date-selector select {
    padding: 8px;
    border: 1px solid var(--color-brown);
    border-radius: 5px;
    background-color: white;
    font-family: 'Alegreya Sans', sans-serif;
    cursor: pointer;
}

/* Onglets */
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    user-select: none; /* Empêche la sélection du texte */
}

.tab.active {
    border-bottom: 3px solid var(--color-red);
    font-weight: bold;
    color: var(--color-red);
}

.tab-content {
    transition: opacity 0.3s ease;
}

/* Statistiques */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--color-brown);
}

.chart-container {
    height: 200px;
    position: relative;
    margin-top: 20px;
}

.bar-chart {
    display: flex;
    height: 100%;
    align-items: flex-end;
    gap: 10px;
}

.bar {
    flex: 1;
    background-color: var(--color-red);
    position: relative;
    transition: height 0.5s ease;
}

.bar-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 14px;
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

/* Sélecteur de période */
.period-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.period-btn {
    padding: 5px 15px;
    border: 1px solid var(--color-gray);
    border-radius: 20px;
    background-color: white;
    font-family: 'Alegreya Sans', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-btn.active {
    background-color: var(--color-red);
    color: white;
    border-color: var(--color-red);
}

.export-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--color-green);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    font-size: 14px;
    margin-left: 10px;
}

.export-btn:hover {
    background-color: #458552;
}

/* Message d'erreur */
.error-message {
    background-color: #ffecec;
    color: var(--color-red);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Pas de données */
.no-data {
    text-align: center;
    padding: 20px;
    color: var(--color-gray);
    font-style: italic;
}

/* Statistiques de fréquence des composants */
.freq-chart-container {
    margin-top: 20px;
    min-height: 150px;
}

.freq-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.freq-item {
    display: flex;
    flex-direction: column;
}

.freq-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-brown);
}

.freq-bar-container {
    height: 30px;
    background-color: var(--color-background-alt);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.freq-bar {
    height: 100%;
    background-color: var(--color-red);
    border-radius: 15px;
    position: relative;
    transition: width 0.5s ease;
    animation: grow-bar 1s ease-out;
    min-width: 50px;
}

.freq-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 500;
    font-size: 14px;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Animation pour les barres horizontales */
@keyframes grow-bar {
    from { width: 0; }
    to { width: 100%; }
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 5px;
    }
    
    .radio-button label {
        width: 100%;
        text-align: center;
    }
    
    .date-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-selector select {
        width: 100%;
    }
    
    .period-selector {
        flex-wrap: wrap;
    }
    
    .freq-bar {
        min-width: 40px;
    }
    
    .freq-value {
        right: 5px;
        font-size: 12px;
    }
}
/* Styles pour les composants du repas */
.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.component-card {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}

.component-card:hover {
    transform: translateY(-5px);
}

.component-title {
    font-family: 'IM Fell English', serif;
    color: var(--color-brown);
    font-size: 18px;
    margin-bottom: 10px;
}

.component-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--color-red);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.component-value.updated {
    transform: scale(1.1);
    color: var(--color-green);
}

.component-label {
    font-size: 14px;
    color: var(--color-gray);
}

@media (max-width: 480px) {
    .stats-row {
        flex-direction: column;
    }
    
    .component-card {
        margin-bottom: 10px;
    }
}
.tabb {
    user-select: none;
    cursor: pointer;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #555;
    color: white;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
  }
  
  .tabb:hover {
    background-color: #666;
  }
  
  .tabb.wake-active {
    background-color: #009688;
  }