@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;

    /* Brand & Status Colors */
    --accent-color: #3491fe;
    --accent-rgb: 52, 145, 254;
    --accent-color-2: #5aa8ff;
    --accent-gradient: linear-gradient(135deg, #3491fe 0%, #5aa8ff 100%);
    --danger-color: #fd5153;
    --danger-rgb: 253, 81, 83;
    --success-color: #01ba78;
    --success-rgb: 1, 186, 120;
    --warning-color: #fe7923;
    --warning-rgb: 254, 121, 35;
    --yellow-color: #fdb112;
    --yellow-rgb: 253, 177, 18;
    --purple-color: #9168de;
    --button-blue: #3491fe;
    --coffee-color: #8b5e3c;
    --coffee-rgb: 139, 94, 60;
    --alcohol-color: var(--danger-color);
    --alcohol-rgb: var(--danger-rgb);

    /* Layout Colors - Light */
    --bg-color: #F7F7F4;
    --bg-color-2: #EFEFEA;
    --card-bg: #FFFFFF;
    --card-bg-2: #F3F6FA;
    --surface-soft: rgba(255, 255, 255, 0.76);
    --surface-raised: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.9));
    --surface-tint: rgba(var(--accent-rgb), 0.055);
    --text-primary: #111423;
    --text-secondary: #656B7C;
    --border-color: rgba(22, 30, 46, 0.08);
    --border-subtle: rgba(22, 30, 46, 0.05);
    --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --nav-bg: rgba(250, 251, 248, 0.72);
    --nav-border: rgba(52, 145, 254, 0.12);

    /* Component Specific Colors */
    --calendar-bg-default: #E8E9EF;
    --calendar-bg-weekend: #DADBE3;
    --calendar-bg-active: var(--success-color);
    --calendar-border-active: var(--success-color);
    --calendar-text-active: #FFFFFF;

    /* Nutrient Colors */
    --color-calories: var(--accent-color);
    --color-protein: var(--success-color);
    --color-fat: var(--yellow-color);
    --color-carbs: var(--purple-color);

    /* Typography Scale - Base is 16px */
    --font-size-xs: 0.625rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 1rem;
    --font-size-md: 1.0625rem;
    --font-size-lg: 1.75rem;
    --font-size-xl: 2.375rem;

    /* Spacing Scale - FIXED PX to prevent breaking on font-size change */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 20px;
    --space-xl: 30px;

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Shadows - Light */
    --shadow-sm: 0 3px 10px rgba(27, 39, 68, 0.05), 0 1px 2px rgba(27, 39, 68, 0.04);
    --shadow-md: 0 14px 34px rgba(27, 39, 68, 0.09), 0 3px 10px rgba(27, 39, 68, 0.05);
    --shadow-lg: 0 22px 60px rgba(27, 39, 68, 0.16), 0 8px 22px rgba(27, 39, 68, 0.08);
    --shadow-accent: 0 12px 28px rgba(var(--accent-rgb), 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);

    /* Other Tokens */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --font-stack: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --logo-image: url('assets/brand/logo.svg');

    --user-font-size: 16px;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    /* Layout Colors - Dark */
    --bg-color: #111720;
    --bg-color-2: #171F2A;
    --card-bg: #1B2430;
    --card-bg-2: #243040;
    --surface-soft: rgba(27, 36, 48, 0.78);
    --surface-raised: linear-gradient(180deg, rgba(34, 45, 60, 0.96), rgba(27, 36, 48, 0.94));
    --surface-tint: rgba(var(--accent-rgb), 0.12);
    --text-primary: #F4F7FB;
    --text-secondary: #A4AFBF;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(22, 30, 42, 0.72);
    --nav-border: rgba(255, 255, 255, 0.09);

    /* Calendar - Dark */
    --calendar-bg-default: #252538;
    --calendar-bg-weekend: #2D2D44;

    /* Shadows - Dark */
    --shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.34), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.48);
    --shadow-accent: 0 12px 30px rgba(var(--accent-rgb), 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html {
    font-size: var(--user-font-size);
    height: 100%;
    min-height: 100%;
    min-height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}
