:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-bg: #f1f5f9;
    --border-color: #e2e8f0;
    --emerald-500: #10b981;
    --red-500: #ef4444;
    --amber-500: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: #e2e8f0; /* Darker background for desktop */
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

/* App Container constraint (Mobile view on desktop) */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background-color: var(--bg-main);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.icon { width: 20px; height: 20px; }

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    z-index: 10;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    flex: 1;
    margin-right: 1rem;
}

.search-box .icon { color: var(--text-muted); margin-right: 0.5rem; }

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
    color: var(--text-main);
}

.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: var(--secondary-bg);
}

/* Main Content Scroll */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Category Icons */
.category-row {
    display: flex;
    justify-content: space-around;
    padding: 1.5rem 1rem;
    background: var(--bg-card);
    margin-bottom: 0.5rem;
}

.category-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
}

.category-icon .icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--secondary-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.2s, background 0.2s;
}

.category-icon:active .icon-circle {
    transform: scale(0.95);
    background: #e2e8f0;
}

.category-icon .label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Hero Carousel */
.hero-section {
    padding: 1rem;
    background: var(--bg-card);
    margin-bottom: 0.5rem;
}

.hero-card {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" stroke="white" stroke-width="2" fill="none" opacity="0.1"/></svg>') repeat;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; opacity: 0.9; }
.hero-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.score-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.3);
}

.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.dot.active { background: var(--primary-color); width: 24px; border-radius: 4px; }

/* Topic Sections & Horizontal Scroll */
.topic-section {
    padding: 1.5rem 0 1.5rem 1rem;
    background: var(--bg-card);
    margin-bottom: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-right: 1rem;
}

.section-header h2 { font-size: 1.1rem; font-weight: 700; }
.section-header .view-all { font-size: 0.85rem; color: var(--primary-color); font-weight: 600; cursor: pointer; }

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-right: 1rem;
    padding-bottom: 0.5rem;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

/* Food Card */
.food-card {
    scroll-snap-align: start;
    min-width: 160px;
    max-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.food-card-img {
    height: 100px;
    background: var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.food-card-body {
    padding: 0.75rem;
}

.food-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.food-card-score {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--emerald-500);
    margin-bottom: 0.5rem;
}

.food-card-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 70px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 50;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    gap: 4px;
    transition: color 0.2s;
}

.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--primary-color); }

.nav-fab-container {
    position: relative;
    width: 60px;
    display: flex;
    justify-content: center;
}

.fab-camera {
    position: absolute;
    top: -45px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    border: 4px solid var(--bg-card);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}
.fab-camera:active { transform: translateY(2px); }
.fab-camera svg { width: 28px; height: 28px; }

/* Modals & Camera Overlay (Reusing/Adapting from previous) */
.hidden { display: none !important; }

#camera-fullscreen-overlay {
    position: absolute; /* Using absolute inside container */
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}
#camera-fullscreen-overlay video {
    flex: 1;
    width: 100%;
    object-fit: cover;
    background-color: #111;
}
.camera-controls-bottom {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 120px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex; justify-content: center; align-items: center;
    padding: 0 2rem; box-sizing: border-box;
}
.camera-gallery-wrapper { position: absolute; left: 2rem; }
.camera-shutter-btn {
    width: 70px; height: 70px; border-radius: 50%;
    background-color: #fff; border: 4px solid #aaa;
    cursor: pointer; box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}
.camera-shutter-btn:active { transform: scale(0.9); }
.camera-gallery-btn {
    width: 45px; height: 45px; border-radius: 10px;
    background-color: rgba(255,255,255,0.2); border: 2px solid #fff;
    cursor: pointer; display: flex; justify-content: center; align-items: center; color: #fff;
}
.camera-gallery-btn svg { width: 24px; height: 24px; }
.camera-close-btn {
    position: absolute; top: 1rem; left: 1rem;
    width: 40px; height: 40px; border-radius: 50%;
    background-color: rgba(0,0,0,0.5); color: #fff;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; border: none; z-index: 10000;
}

/* Modals */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}
.modal.card {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; }
.form-group input, .form-group select {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-main); font-size: 0.95rem; color: var(--text-main);
}
.modal-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.btn { flex: 1; padding: 0.75rem; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--primary-color); color: white; }
.btn.secondary { background: var(--secondary-bg); color: var(--text-main); }
