/* ==========================================================
   NUTRICRAFT — FRESH MODERN CULINARY TEMA UI/UX
   ========================================================== */

:root {
    --emerald: #059669;
    --emerald-dark: #047857;
    --emerald-light: #ecfdf5;
    --orange: #ea580c;
    --orange-light: #fff7ed;
    --slate: #1e293b;
    --slate-muted: #64748b;
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--slate);
    line-height: 1.6;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--emerald);
}

.nav-brand small {
    color: var(--slate-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    text-decoration: none;
    color: var(--slate-muted);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: var(--emerald-light);
    color: var(--emerald);
}

/* BUTTONS */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: var(--emerald); color: white; }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-secondary { background: var(--orange); color: white; }
.btn-outline { border: 2px solid var(--emerald); color: var(--emerald); background: transparent; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }
.btn-full { width: 100%; margin-top: 0.5rem; }

/* PAGE PANES (SPA) */
.page-pane {
    display: none;
    padding: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.page-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HERO SECTION */
.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding: 2.5rem 0;
}

.hero-badge {
    background: #d1fae5;
    color: var(--emerald-dark);
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}

.hero-content h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 1rem 0;
}

.gradient-text { color: var(--emerald); }

.hero-subtext {
    color: var(--slate-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.hero-btn-group {
    display: flex;
    gap: 1rem;
}

.hero-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    object-fit: cover;
}

.hero-card {
    position: relative;
}

.image-tag {
    position: absolute;
    bottom: 15px; left: 15px;
    background: rgba(255,255,255,0.9);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

.objectives-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.obj-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.obj-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }

/* MODULES */
.module-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.progress-box { width: 220px; }
.progress-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 0.3rem; }
.progress-fill { height: 100%; background: var(--emerald); transition: width 0.3s; }

.module-tab-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.mod-tab-btn {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
}

.mod-tab-btn.active {
    background: var(--emerald);
    color: white;
    border-color: var(--emerald);
}

.module-pane {
    display: none;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.module-pane.active { display: block; }

.highlight-callout {
    background: var(--emerald-light);
    border-left: 4px solid var(--emerald);
    padding: 1rem;
    margin: 1.2rem 0;
    border-radius: 0 8px 8px 0;
}

.recipe-sample-card {
    background: #f1f5f9;
    padding: 1.2rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.recipe-part { margin-bottom: 0.8rem; }
.part-label { background: var(--slate); color: white; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }

.structure-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.struct-card {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.struct-header { font-weight: 700; color: var(--emerald); margin-bottom: 0.4rem; }

.vocab-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.vocab-card {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.module-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

/* SIMULATIONS */
.sim-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.8rem;
}

.sim-1-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin: 1rem 0;
}

.drag-pool, .drop-box {
    background: var(--bg-main);
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed var(--border);
    min-height: 120px;
}

.drag-element {
    background: var(--surface);
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: grab;
    font-size: 0.88rem;
}

.sortable-step-list {
    list-style: none;
    margin: 1rem 0;
}

.sortable-step-list li {
    background: var(--bg-main);
    padding: 0.8rem;
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: move;
}

.sim-feedback { margin-top: 0.8rem; font-weight: 700; }
.sim-feedback.success { color: var(--emerald); }
.sim-feedback.error { color: #dc2626; }

/* FORMS & MODALS */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-backdrop.active { display: flex; }

.modal-box {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 440px;
    position: relative;
}

.modal-box.wide { max-width: 650px; }

.modal-close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    border: none; background: none; font-size: 1.5rem; cursor: pointer;
}

.field-group { margin-bottom: 1rem; }
.field-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.field-group input, .field-group textarea, .field-group select {
    width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem;
}

.password-field { display: flex; position: relative; }
.pwd-eye-btn { position: absolute; right: 8px; top: 8px; border: none; background: none; cursor: pointer; }

/* TABLES */
.table-container { overflow-x: auto; margin-top: 1rem; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.88rem; }
.data-table th, .data-table td { padding: 0.8rem; border: 1px solid var(--border); text-align: left; }
.data-table th { background: #f1f5f9; }

/* FOOTER */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--slate-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-btn-group { justify-content: center; }
    .structure-cards-container, .vocab-grid, .sim-1-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}