/* --- CSS RESET --- */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --primary: #ff6b00;
    --primary-hover: #e65c00;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #333;
    --section-bg: #1a1a1a;
}

html { 
    overflow-y: scroll !important; 
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header & Nav */
header {
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    padding: 10px 0;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

header h1 { color: var(--primary); margin: 0; font-size: 1.8rem; font-weight: 700; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--primary); }

/* Layout */
.container { 
    width: 100%;
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0 20px;
    flex: 1; 
}

.section-padding { padding: 60px 0; }

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Modal */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 85%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover { color: var(--primary); }

/* Budget & Tool Styles */
.budget-section {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.budget-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
}

.budget-amount { 
    color: var(--primary); 
    font-size: 1.8rem; 
    font-weight: 700;
}

input[type=range] { 
    width: 100%; 
    margin: 15px 0; 
    accent-color: var(--primary); 
    cursor: pointer; 
}

.stats {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.stat-item { text-align: center; flex: 1; }
.stat-item h3 { margin: 0; font-size: 1.4rem; color: var(--primary); }
.stat-item p { margin: 5px 0 0 0; font-size: 0.8rem; color: var(--text-muted); }

.controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.btn {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.2s;
}
.btn:hover, .btn.active { background-color: var(--primary); color: white; border-color: var(--primary); }

/* Meal Cards */
.meal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.meal-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.meal-card:hover { transform: translateY(-5px); border-color: #555; }

.brand-logo-container {
    height: 80px;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center; 
    justify-content: center; 
    padding: 10px;
}

.meal-header { display: flex; justify-content: space-between; margin-bottom: 15px; }
.meal-title { margin: 0; font-size: 1.1rem; font-weight: 600; color: #fff; }
.meal-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.macros { display: flex; gap: 8px; margin: 15px 0; margin-top: auto; }
.macro-box {
    flex: 1;
    text-align: center;
    background-color: #2a2a2a;
    padding: 10px 5px;
    border-radius: 8px;
}
.macro-box span { font-size: 0.7rem; color: var(--text-muted); display: block; }
.macro-box strong { font-size: 1rem; }

.protein-text { color: #4CAF50; }
.carb-text { color: #FFC107; }
.fat-text { color: #F44336; }

.meal-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calories { color: var(--text-muted); font-size: 0.85rem; }

.maps-btn {
    padding: 5px 10px;
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
}

.maps-btn:hover { background-color: var(--primary); color: white; }

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.blog-content { padding: 25px; }
.blog-content h3 { margin-top: 0; color: #fff; font-size: 1.3rem; line-height: 1.4; }
.blog-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; }

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Footer & Legal */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    background-color: #0a0a0a;
    color: rgba(255, 255, 255, 0.4); 
    font-size: 0.85rem;
}

.legal-notice {
    font-size: 0.7rem;
    margin-top: 20px;
    opacity: 0.5;
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}