/* --- 1. THEME DEFINITIONS --- */
:root {
    --bg: #f5f5f5;
    --card: #fff;
    --text: #333;
    --accent: #27ae60;
    --radius: 15px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --font: 'Segoe UI', sans-serif;
}

body[data-theme="dark"] {
    --bg: #121212;
    --card: #1e1e1e;
    --text: #e0e0e0;
    --accent: #2ecc71;
}

/* --- 2. BASE LAYOUT --- */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    margin: 0;
    min-height: 100vh;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
}

.recipe-container {
    background: var(--card);
    max-width: 1200px;
    width: 95%;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 50px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}

.ingredients-area {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding-right: 20px;
}

body[data-theme="dark"] .ingredients-area {
    border-right-color: rgba(255, 255, 255, 0.1);
}

/* --- 3. CONTROLS --- */
.controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* --- BOUTONS DES CONTROLES --- */
.controls button {
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--accent);
}

@media (hover: hover) {
    .controls button:hover {
        transform: translateY(-2px) translateX(-1px) rotate(2deg);
        filter: brightness(1.05);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    }
}

.controls button:active {
    transform: translateY(0);
    
    background: var(--bg);
    color: var(--text);
    
}

.nav-logo {
    height: 45px;
    width: auto;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.1);
}

.btn-retour {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-retour:hover {
    transform: translateY(-2px) translateX(1px) rotate(-2deg) !important;
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

#theme-toggle {
    margin: 0 15px;
}



body[data-theme="dark"] .controls button {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .controls {
    background: rgba(30, 30, 30, 0.8);
    border-bottom-color: #444;
}


/* --- 4. HEADER --- */
.header-area {
    grid-column: 1 / -1;
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body[data-theme="dark"] .header-area {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.header {
    text-align: center;
}

.header h1 {
    margin-top: 0;
    font-size: 2.5em;
    line-height: 1.1;
}

.header-description {
    font-size: 1.2em;
    opacity: 0.8;
}

.recipe-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* --- RESPONSIVE DESKTOP POUR LE HEADER --- */
@media (min-width: 801px) {
    .header-area {
        grid-template-columns: 2fr 1fr;
        align-items: center;
        gap: 40px;
    }

    .header {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
    }

    .recipe-image {
        grid-column: 2;
        grid-row: 1;
        aspect-ratio: 1 / 1;
        max-height: unset;
        height: 100%;
    }
}

/* --- 5. INGREDIENTS & PORTION --- */
.ingredients-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-bottom: 15px;
    height: 45px;
}

.ingredients-header-row h3 {
    margin: 0;
}

.ingredients-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.ingredients-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.qty {
    font-weight: bold;
    color: var(--accent);
    margin-right: 8px;
    font-size: 1.1em;
}

.tooltip-icon {
    width: 18px;
    height: 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    cursor: help;
    position: relative;
}

.tooltip-icon::after {
    content: attr(data-info);
    position: absolute;
    bottom: 130%;
    right: 0;
    background: #333;
    color: #fff;
    padding: 8px;
    border-radius: 5px;
    width: 180px;
    font-size: 11px;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    z-index: 10;
}

.tooltip-icon:hover::after {
    visibility: visible;
    opacity: 1;
}

.equipment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.equipment-list li {
    background: rgba(0, 0, 0, 0.05);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body[data-theme="dark"] .equipment-list li {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- 6. NOTES (VERSION DISCRÈTE) --- */
.notes-area {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.03);
    border-left: 3px solid var(--accent);
    padding: 15px 18px;
    margin-top: 50px;
    border-radius: 6px;
}

/* Mode sombre */
body[data-theme="dark"] .notes-area {
    background: rgba(255, 255, 255, 0.04);
}

/* Titre */
.notes-area h4 {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    color: var(--accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Icône discrète */
.notes-area h4::before {
    content: "📝";
    font-size: 0.9em;
    opacity: 0.8;
}

/* Liste */
.notes-list {
    padding-left: 16px;
    margin: 0;
    line-height: 1.5;
    font-size: 0.9em;
}

/* Items */
.notes-list li {
    margin-bottom: 5px;
    opacity: 0.8;
}

.section-title {
    color: var(--accent);
    letter-spacing: 1px;
    margin-top: 10px;
    margin-bottom: 0px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    font-size: 0.9em;
}

.stepper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
}

.stepper button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--card);
    color: var(--text);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s ease, background 0.2s ease;
}

.stepper button:active {
    transform: scale(0.92);
    background: var(--accent);
    color: white;
}

.stepper span {
    width: 36px;
    text-align: center;
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1em;
    user-select: none;
}

.loading-msg {
    text-align: center;
    grid-column: 1 / -1;
}

.equipment-header-container {
    margin-top: 30px;
}

.instruction-step {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1.05em;
}

/* --- RESPONSIVE MOBILE GENERAL --- */
@media (max-width: 800px) {
    .recipe-container {
        grid-template-columns: 1fr;
    }

    .ingredients-area {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding-bottom: 20px;
    }
}