/* ===============================
   VARIABLES DE THÈME (AJOUTÉES)
================================ */
:root {
    --bg-body: #f5f5f5;
    --bg-card: #fff;
    --bg-sidebar: #f08a5b;
    --bg-sidebar-hover: #f3a480;
    --text-main: #222;
    --text-about: #444;
    --accent: #ff7a18; /* Orange */
    --hero-gradient: linear-gradient(135deg, #ffb347, #ffcc7a);
    --shadow-color: rgba(0,0,0,0.1);
    --overlay-bg: rgba(255, 255, 255, 0.3);
}

body.dark-theme {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --bg-sidebar: #b91c1c; /* Rouge foncé */
    --bg-sidebar-hover: #dc2626; /* Rouge vif */
    --text-main: #f5f5f5;
    --text-about: #ccc;
    --accent: #ef4444; /* Rouge */
    --hero-gradient: linear-gradient(135deg, #991b1b, #ef4444);
    --shadow-color: rgba(0,0,0,0.5);
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

/* ===============================
   RESET & BASE
================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Manrope", sans-serif;
}

body {
    background: var(--bg-body); /* VARIABLE */
    color: var(--text-main);    /* VARIABLE */
    min-height: 100vh;
    transition: background 0.4s, color 0.4s; /* Transition douce */
}

/* ===============================
   SIDEBAR
================================ */
nav {
    background-color: var(--bg-sidebar); /* VARIABLE */
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 220px;
    border-right: 1px solid var(--border-color); /* VARIABLE */
    z-index: 1000;
    padding-top: 40px;
    transition: left 0.3s ease, background 0.4s;
}

nav.hidden {
    left: -220px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-main); /* VARIABLE */
    font-weight: 500;
}

nav li a:hover {
    background-color: var(--bg-sidebar-hover); /* VARIABLE */
    color: #fff;
    transition: background 0.2s ease, color 0.1s ease;
}

/* Hamburger */
.hamburger {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 1101;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 4px;
    background: var(--text-main); /* VARIABLE (devient blanc en dark) */
    margin-bottom: 5px;
    border-radius: 2px;
    transition: all 0.3s ease, background 0.4s;
}

.hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(6.2px, 6.2px);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6.2px, -6.2px);
}

#mainContent {
    margin-left: 0px;
    padding-top: 40px;
    transition: margin-left 0.3s ease;
}

#mainContent.shift {
    margin-left: 220px;
}

/* ===============================
   HERO
================================ */
.hero {
    text-align: center;
    padding: 60px 20px 40px 20px;
    background: var(--hero-gradient); /* VARIABLE */
    color: var(--text-main);          /* VARIABLE */
    margin-bottom: 40px;
    transition: background 0.4s;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
}

.hero-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--accent); /* VARIABLE */
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: 0.3s;
}

.hero-btn:hover {
    opacity: 0.8;
}

/* ===============================
   SECTIONS
================================ */
section {
    margin-bottom: 50px;
}

section h2 {
    font-size: 1.8rem;
    color: var(--accent); /* VARIABLE */
    margin-bottom: 20px;
}

/* ===============================
   TOP RECIPE
================================ */
#topRecipeContainer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.top-recipe .recipe-card {
    background: var(--bg-card); /* VARIABLE */
    padding: 20px;
    border-radius: 14px;
    width: 300px;
    text-align: center;
    box-shadow: 0 6px 15px var(--shadow-color); /* VARIABLE */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.4s;
}

.top-recipe .recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px var(--shadow-color);
}

.top-recipe .recipe-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    object-fit: cover;
    height: 180px;
}

.top-recipe .recipe-card p {
    font-weight: 600;
    margin-top: 10px;
}

/* ===============================
   RECENT RECIPES GRID
================================ */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.recipes-grid .recipe-card {
    background: var(--bg-card); /* VARIABLE */
    padding: 15px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 4px 10px var(--shadow-color); /* VARIABLE */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.4s;
}

.recipes-grid .recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px var(--shadow-color);
}

.recipes-grid .recipe-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 10px;
    object-fit: cover;
    height: 150px;
}

/* ===============================
   ABOUT / PARAGRAPHE CUISINE
================================ */
.about-cooking p {
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: auto;
    text-align: center;
    color: var(--text-about); /* VARIABLE */
}

/* ===============================
   SLIDER
================================ */
.slider-container {
    justify-content: center;
    white-space: nowrap;
    padding-bottom: 10px;
    display: flex;
}

.slider {
    display: inline-flex;
    gap: 15px;
}

.slider .recipe-card {
    background: var(--bg-card); /* VARIABLE */
    padding: 20px;
    border-radius: 14px;
    width: 250px;
    text-align: center;
    box-shadow: 0 6px 15px var(--shadow-color); /* VARIABLE */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.4s;
}

.slider .recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.slider .recipe-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    object-fit: cover;
    height: 150px;
}

/* ===============================
   RAPIDE RECIPE
================================ */
#RapideRecipeContainer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.recipeRapide .recipe-card {
    background: var(--bg-card); /* VARIABLE */
    padding: 20px;
    border-radius: 14px;
    width: 300px;
    text-align: center;
    box-shadow: 0 6px 15px var(--shadow-color); /* VARIABLE */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.4s;
}

.recipeRapide .recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.recipeRapide .recipe-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    object-fit: cover;
    height: 180px;
}

.recipeRapide .recipe-card p {
    font-weight: 600;
    margin-top: 10px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    #mainContent {
        margin-left: 0;
        padding: 20px;
    }

    .hero {
        padding: 40px 20px;
    }

    .top-recipe .recipe-card,
    .recipes-grid .recipe-card,
    .slider .recipe-card {
        width: 100%;
        height: auto;
    }

    .slider .recipe-card img,
    .recipes-grid .recipe-card img,
    .top-recipe .recipe-card img {
        height: auto;
    }
}

/* Overlay pour effet flou */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg); /* VARIABLE */
    backdrop-filter: blur(5px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 999;
}

#overlay.active {
    opacity: 1;
    pointer-events: auto;
}