:root {
    /* Standaard Maaltijdplanning kleur (rood) */
    --primary: #DC2626;
    --primary-hover: #B91C1C;
    --primary-50: rgba(220, 38, 38, 0.05);
    --primary-100: rgba(220, 38, 38, 0.1);
    --primary-200: rgba(220, 38, 38, 0.2);
    --toast-bg: #DC2626;
    --bg-light: #FAFAFA;
    --bg-dark: #0B0F1A;
    --card-light: #ffffff;
    --card-dark: #151B2E;
    --nav-height-desktop: 64px;
    --nav-height-mobile: 64px;
    --transition-speed: 0.4s;
    --radius-premium: 2.5rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-light);
    color: #1e293b;
    margin: 0;
    /* Desktop: ruimte aan de bovenkant voor de nav */
    padding-top: var(--nav-height-desktop);
    padding-bottom: 20px;
    overflow-x: hidden;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Container die alles binnen de lijntjes houdt */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem;
    width: 100%;
}

/* Fix voor elementen die uit beeld vallen */
section {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.card-shadow {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

/* Mobiele optimalisatie voor modals */
.modal-content {
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 2rem;
}

/* Zorg dat grid kaarten niet te groot worden op kleine schermen */
.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 1.8rem !important;
    }
}

/* Dark Mode Overrides - deel 1 */
html.dark body {
    background-color: var(--bg-dark);
    color: #f8fafc;
}

/* ==========================================================================
   2. THEMA'S (LIGHT & DARK MODE)
   ========================================================================== */
/* Schaduwen Light Mode */
.card-shadow {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed);
}

.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass {
    background: rgba(21, 27, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.premium-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

.shadow-premium {
    box-shadow: 0 20px 50px -12px var(--primary-200);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.shadow-orange-200,
.shadow-primary-200 {
    box-shadow: 0 12px 28px -6px var(--primary-200, rgba(249, 115, 22, 0.35));
}

.shadow-blue-100 {
    box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.25);
}

/* Dark Mode Overrides - deel 2 */
html.dark .card-shadow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 4px rgba(0, 0, 0, 0.3);
}

/* In dark mode: subtielere gekleurde schaduwen (niet te fel op donkere bg) */
html.dark .shadow-orange-100,
html.dark .shadow-primary-100 {
    box-shadow: 0 6px 18px -4px var(--primary-100, rgba(249, 115, 22, 0.15));
}
html.dark .shadow-orange-200,
html.dark .shadow-primary-200 {
    box-shadow: 0 8px 24px -6px var(--primary-100, rgba(249, 115, 22, 0.15));
}
html.dark .shadow-blue-100 {
    box-shadow: 0 4px 15px -2px rgba(59, 130, 246, 0.15);
}

html.dark #app-nav {
    background: rgba(15, 23, 42, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark .bg-white {
    background-color: var(--card-dark) !important;
    color: #f1f5f9;
}

html.dark .bg-slate-50 {
    background-color: var(--bg-dark) !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700 {
    color: var(--text-dark) !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400,
html.dark .text-slate-300 {
    color: #94a3b8 !important;
}

html.dark .border-slate-100,
html.dark .border-slate-50 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark input,
html.dark select,
html.dark textarea {
    background-color: var(--card-dark) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark input:focus,
html.dark select:focus {
    border-color: var(--primary) !important;
}

/* ==========================================================================
   3. NAVIGATIE
   ========================================================================== */
#app-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height-desktop);
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-links-wrapper {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--primary-50, rgba(249, 115, 22, 0.06));
}

.nav-link.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    border-radius: 12px 12px 0 0;
}

/* Mobiele Navigatie */
@media (max-width: 768px) {
    #app-nav {
        top: auto;
        bottom: 0;
        height: var(--nav-height-mobile);
        padding-bottom: env(safe-area-inset-bottom);
        border-bottom: none;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-container {
        padding: 0;
    }

    .nav-links-wrapper {
        width: 100%;
        gap: 0;
        justify-content: space-around;
    }

    .nav-link {
        flex: 1;
        border-radius: 0;
        border-bottom: none !important;
    }

    .nav-link span:first-child {
        font-size: 1.4rem;
        transition: transform 0.2s ease;
    }

    .nav-link span:last-child {
        font-size: 9px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .nav-link.active {
        background: var(--primary-50, rgba(249, 115, 22, 0.08));
    }

    .nav-link.active span:first-child {
        transform: translateY(-3px) scale(1.1);
    }

    body {
        /* Mobiel: nav staat onderaan, dus bovenkant is vrij */
        padding-top: 20px;
        /* Onderkant krijgt ruimte voor de nav + safe area (voor iPhone notch) */
        padding-bottom: calc(var(--nav-height-mobile) + env(safe-area-inset-bottom) + 20px);
    }
}

/* Tactile Buttons for Mobile */
@media (max-width: 768px) {
    button, .btn-primary, .nav-link, a.inline-block {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Voorkomt inzoomen op iOS */
        padding: 12px 16px !important;
    }

    .mobile-grid-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .mobile-px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ==========================================================================
   4. COMPONENTEN (CARDS, BADGES, INPUTS)
   ========================================================================== */
/* Eaters & Badges */
.eater-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.eater-btn.active {
    background-color: white !important;
    color: var(--primary) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.eater-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
}

.eater-badge-member {
    border-color: #f1f5f9;
    background-color: #ffffff;
}

.eater-badge-member:has(input:checked) {
    border-color: var(--primary);
    background-color: var(--primary-50, #fff7ed);
}

.eater-badge-guest {
    border-style: dashed;
    border-color: #e2e8f0;
    background-color: #f8fafc;
}

.eater-badge-guest:has(input:checked) {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Tags */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.remove {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.8;
}

/* Shopping List */
.boodschap-item {
    transition: all 0.3s ease;
}

.boodschap-checked {
    opacity: 0.4;
    text-decoration: line-through;
    order: 999;
    background-color: transparent !important;
}

/* Settings Tabs */
.settings-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-tab.active-tab {
    background-color: white;
    color: var(--primary) !important;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.05);
}

html.dark .settings-tab.active-tab {
    background-color: var(--card-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   5. ANIMATIES & UTILS
   ========================================================================== */
.animate-pop {
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.ai-pulse-bg {
    background-size: 200% 200%;
    animation: aiGradient 2s ease infinite;
}

@keyframes aiGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary-200, #fed7aa);
    border-radius: 10px;
}

html.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

html.dark #loading-screen {
    background: var(--bg-dark);
}
@keyframes slideInRight {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out forwards;
}

@media (max-width: 1024px) {
    #expert-sidebar:not(.hidden) {
        display: flex;
        width: 85%;
        max-width: 300px;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
}
