:root {
    --primary-color: #e67e22;
    --bg-color: #fcf8f5;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --table-header: #34495e;
    --star-bg: rgba(254, 249, 231, 0.6);
    --figurant-bg: rgba(244, 246, 247, 0.6);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.filter-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.filter-section h2 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #7f8c8d;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* Boutons de filtres en haut */
.ingredient-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: #f0f3f4;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
}

.ingredient-badge:hover {
    background-color: #e5e8e8;
}

.ingredient-badge.active {
    background-color: #fdebd0;
    border-color: var(--primary-color);
    color: #b7950b;
}

.ingredient-icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.ingredient-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.btn-clear {
    background: none;
    border: 1px solid #bdc3c7;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #7f8c8d;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #f2f3f4;
    color: #34495e;
}

/* Style du Tableau */
.recipe-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.recipe-table th {
    background-color: var(--table-header);
    color: #ffffff;
    text-align: left;
    padding: 15px;
    font-weight: 600;
}

.recipe-table td {
    padding: 15px;
    border-bottom: 1px solid #f2f3f4;
    vertical-align: middle;
}

.recipe-table tr:last-child td {
    border-bottom: none;
}

.td-stars {
    background-color: var(--star-bg);
    width: 25%;
}

.td-figurants {
    background-color: var(--figurant-bg);
    width: 30%;
}

.td-name {
    font-weight: bold;
    font-size: 1.05rem;
    color: #2c3e50;
    width: 20%;
}

.td-drink {
    background-color: #fafcfc;
    width: 25%;
    border-left: 1px dashed #e5e8e8;
}

.cell-drinks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Badge de la boisson */
.drink-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #edf2f7;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #4a5568;
    cursor: help; /* Curseur d'aide pour indiquer qu'il y a une info au survol */
    border: 1px solid #e2e8f0;
}

.drink-badge .drink-type {
    font-size: 1rem;
}

/* Info-bulle pour la raison du Sobrelier au survol du badge */
.drink-badge::after {
    content: attr(data-reason);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #2c3e50;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    width: 220px; /* Largeur fixe pour que le texte de l'explication passe à la ligne */
    white-space: normal;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
}

.drink-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Style de l'en-tête cliquable */
.clickable-th {
    cursor: pointer;
    background-color: #2c3e50 !important; /* Couleur un peu plus foncée */
    transition: background-color 0.2s ease;
    user-select: none;
}

.clickable-th:hover {
    background-color: var(--primary-color) !important; /* Devient orange au survol pour inviter au clic */
}

#toggle-label {

}

/* Version Badge Alcoolisé (Légèrement ambré/doré pour rappeler la bière et le vin) */
.drink-badge.alcohol {
    background-color: #fef5e7;
    border-color: #f5b041;
    color: #7e5109;
}


/* Grille d'icônes à l'intérieur des cellules */
.cell-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Info-bulle au survol */
.ingredient-item {
    position: relative;
    display: inline-flex;
    cursor: help;
    background: #fff;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ingredient-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #2c3e50;
    color: #fff;
    padding: 5px 9px;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 10;
}

.ingredient-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* État Exclu (Rouge) au 2ème clic */
.ingredient-badge.excluded {
    background-color: #fadbd8;
    border-color: #e74c3c;
    color: #922b21;
}

/* Optionnel : petite transition visuelle pour rendre le changement d'état fluide */
.ingredient-badge {
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
