/* --- Variables Centralisées (Nouvelle Palette appliquée au Graphisme original) --- */
:root {
    --fridge-dark: #361D2E;
    /* Couleur A : Prune Foncé (Remplace le gris foncé) */
    --fridge-primary: #86A397;
    /* Couleur B : Vert Sauge (Remplace le vert Bootstrap) */
    --fridge-bg: #CBC0AD;
    /* Couleur C : Grège (Remplace le gris très clair) */
    --fridge-accent: #E1B07E;
    /* Couleur E : Camel (Remplace le bleu accent) */
    --fridge-secondary: #E5BE9E;
    /* Couleur D : Pêche (Nouveau ton moyen) */

    --fridge-danger: #e74c3c;
    --fridge-success: #2ecc71;
    --main-green: #86A397;
}

/* --- Styles de Base --- */
body {
    background-color: var(--fridge-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--fridge-dark);
}

main {
    flex-grow: 1;
}

/* --- Utilitaires --- */
.transition {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.x-small {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* --- Composants : Navigation --- */
.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: bold;
    letter-spacing: 1px;
}

/* --- Composants : Cards --- */
.card-img-top {
    height: 200px;
    object-fit: cover;
}

.admin-card {
    border-radius: 12px;
    border: none;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.stat-card {
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--fridge-accent);
    opacity: 0.8;
}

/* --- Cartes de Recettes --- */
.recipe-card {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.recipe-badge-time {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--fridge-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--fridge-dark);
}

.recipe-like-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fridge-danger);
    border: none;
    transition: transform 0.2s;
    z-index: 10;
}

/* --- Sections : Héro & Recherche --- */
.search-hero {
    background-color: var(--fridge-dark);
    color: white;
    padding: 3rem 0;
    text-align: center;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.main-search-input {
    border-radius: 50px 0 0 50px;
    padding: 15px 25px;
    border: none;
    font-size: 1.1rem;
}

.main-search-btn {
    border-radius: 0 50px 50px 0;
    padding: 15px 30px;
    background-color: var(--fridge-primary);
    border: none;
    font-weight: bold;
}

/* --- Filtres & Sidebar --- */
.filter-sidebar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.filter-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--fridge-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--fridge-secondary);
    padding-bottom: 10px;
}

/* --- Planning Hebdomadaire --- */
.table-planning {
    table-layout: fixed;
}

.table-planning th {
    background-color: var(--fridge-dark);
    color: white;
    text-align: center;
    width: 14.28%;
    font-weight: 500;
}

.category-row {
    background-color: var(--fridge-secondary);
    color: var(--fridge-dark);
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.meal-cell {
    height: 100px;
    position: relative;
    vertical-align: middle;
    text-align: center;
    transition: background-color 0.2s;
    cursor: pointer;
}

.meal-cell:hover {
    background-color: rgba(225, 176, 126, 0.1);
}

.btn-add {
    background-color: white;
    border: 2px dashed #ced4da;
    color: #adb5bd;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.meal-cell:hover .btn-add {
    border-color: var(--fridge-primary);
    color: var(--fridge-primary);
    transform: scale(1.1);
}

.selected-recipe {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--fridge-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.selected-recipe img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Modales spécifiques Planning --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.recipe-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    background: white;
    z-index: 1050;
    border-radius: 12px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-overlay.show,
.recipe-modal.show {
    opacity: 1;
    visibility: visible;
}

.recipe-modal.show {
    transform: translate(-50%, -50%);
}

.modal-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--fridge-primary);
    border-bottom-color: var(--fridge-primary);
    background-color: white;
}

/* --- Édition de Profil --- */
.avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.btn-edit-avatar {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #ffffff;
    transition: transform 0.2s ease;
}

.btn-edit-avatar:hover {
    transform: scale(1.1);
}

.d-none-file {
    display: none;
}

.form-label i {
    color: #6c757d;
    margin-right: 5px;
}

/* --- Authentification --- */
.auth-wrapper {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    background: white;
}

.auth-header {
    background-color: var(--fridge-dark);
    color: white;
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}

.auth-icon {
    font-size: 3rem;
    color: var(--fridge-accent);
    margin-bottom: 10px;
}

.auth-body {
    padding: 2rem;
}

.btn-auth {
    background-color: var(--fridge-accent);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-auth:hover {
    background-color: var(--fridge-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(134, 163, 151, 0.3);
}

/* --- Admin Navigation --- */
.admin-nav .nav-link {
    color: var(--fridge-dark);
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all 0.3s;
    margin-right: 5px;
}

.admin-nav .nav-link.active {
    background-color: var(--fridge-dark);
    color: white;
}

/* --- Profil Utilisateur --- */
.spanMovie {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--fridge-dark);
    padding-left: 10px;
}

/* --- Splide Carousels --- */
.splide__arrow {
    background: var(--main-green);
    opacity: 0.8;
}

.splide__arrow svg {
    fill: white;
}

/* Animation au survol des cartes */
.transition {
    transition: all 0.3s ease-in-out;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .15) !important;
}