/* Minimal modern dark header theme for Apheum mockup */
:root {
    /* canonical palette from app/static/css/theme.css */
    --dark-green: #008000;
    --light-green: #CDFEC2;
    --dark-red: #FF2F2F;
    --light-red: #FE5F5F;
    --yellow: #FFC107;
    --dark: #031602;
    --dark-gray: #434343;
    --gray: #696969;
    --light-gray: #A1A1A1;
    --super-light-gray: #E5E5E5;
    --white: #FFFFFF;
    --element-background: #F8F8F9;

    /* app accent (warm, non-blue) */
    --theme-color: #b58a5a;

    /* mock theme variables (mapped to canonical palette) */
    --bg: #10141a;
    --surface: #1a2029;
    --muted: #aeb7c4;
    --accent: #b58a5a;
    --danger: var(--dark-red);
    --card: #171d25;
    --glass: rgba(255, 255, 255, 0.03);
    --max-width: 1200px;
    --header-height: 75px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --header-bg: var(--surface);
    --header-text: #f5f7fb;
    --theme-color-rgb: 181, 138, 90;

    /* Apheum palette additions requested */
    --apheum-bg: #f5f1ea;
    --apheum-card: #f9f7f2;
    --apheum-text: #161616;
    --apheum-muted: #666157;
    --apheum-line: rgba(22, 22, 22, 0.12);
    --apheum-accent: #161616;
    --apheum-radius: 28px;

    /* default to dark-mode palette to avoid flash/mismatch before JS applies theme */
    background: var(--bg);
    color: var(--body-text);
    --body-bg: var(--bg);
    --body-text: #eef2f7;
    --drawer-bg: #171d25;
    --drawer-text: #f3f6fb;
    --lead-color: #bdc6d2;
}

/* Light mode variables (override) */
[data-theme="light"] {
    --bg: #F8F8F9; /* element-background from theme.css */
    --surface: #FFFFFF;
    --muted: #696969; /* main gray */
    --accent: #b58a5a; /* keep accent identical */
    --danger: #FF2F2F;
    --card: #FFFFFF;
    --glass: rgba(0, 0, 0, 0.03);
    --header-height: 80px;
}

html[data-theme="dark"] {
    --bg: #10141a;
    --surface: #1a2029;
    --card: #171d25;
    --body-bg: #10141a;
    --body-text: #eef2f7;
    --drawer-bg: #171d25;
    --drawer-text: #f3f6fb;
    --lead-color: #bdc6d2;
    --header-bg: #1a2029;
    --header-text: #f5f7fb;
    --theme-color: #b58a5a;
    --accent: #b58a5a;
    --theme-color-rgb: 181, 138, 90;
    --apheum-line: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] {
    --bg: #f5f1ea;
    --surface: #f7f4ee;
    --card: #f9f7f2;
    --body-bg: #f5f1ea;
    --body-text: #161616;
    --drawer-bg: #ffffff;
    --drawer-text: #161616;
    --lead-color: #666157;
    --header-bg: #f7f4ee;
    --header-text: #161616;
    --theme-color: #212529;
    --accent: #212529;
    --theme-color-rgb: 33, 37, 41;
    --apheum-line: rgba(22, 22, 22, 0.12);
}

/* Drawer header / close button adapt to drawer colors */
.drawer__header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.drawer__close {
    color: var(--drawer-text);
}

/* ensure switch knob contrasts inside drawer */
.drawer .form-switch input::after {
    background: var(--drawer-text);
}

.form-switch input:checked {
    background: var(--apheum-accent);
}

/* switch label color inside drawer should use drawer text */
.drawer .switch-label {
    color: var(--drawer-text);
}

/* button text contrast variable */
.btn {
    color: var(--btn-text, #fff);
}

html[data-theme="dark"] {
    --btn-text: #1c150f;
}

html[data-theme="light"] {
    --btn-text: #ffffff;
}

* {
    box-sizing: border-box
}

body.mock-theme {
    margin: 0;
    font-family: 'Figtree', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    color: var(--body-text);
    background: var(--body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem
}

.mock-header {
    background: var(--header-bg);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-height);
    border-bottom: 1px solid var(--apheum-line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem
}

.logo {
    height: 44px
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.2px
}

/* Theme toggle button in the header */
.theme-toggle {
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: .4rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.02);
    color: color-mix(in srgb, var(--surface) 90%, black 10%)
}

.theme-toggle:focus {
    outline: 2px solid rgba(0, 0, 0, 0.12);
    outline-offset: 2px
}

.nav-desktop {
    display: flex;
    gap: 1.1rem
}

.nav-link {
    color: color-mix(in srgb, var(--header-text) 82%, transparent);
    text-decoration: none;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    font-weight: 500
}

.nav-link:hover {
    color: var(--header-text);
    background: color-mix(in srgb, var(--header-text) 12%, transparent)
}

.burger {
    display: none;
    background: none;
    border: 0;
    padding: .6rem;
    border-radius: var(--radius-sm)
}

.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px
}

.nav-mobile {
    display: none;
    background: #0a0a0a;
    padding: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04)
}

.nav-link-mobile {
    display: block;
    padding: .8rem 1rem;
    color: var(--muted);
    text-decoration: none;
    border-radius: 6px
}

.nav-link-mobile:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02)
}

.main-area {
    padding: 2.5rem 1rem
}

.hero {
    padding: 2.2rem 0
}

.hero h1 {
    font-size: 34px;
    margin: 0 0 0.5rem;
    font-weight: 700
}

.lead {
    color: var(--lead-color);
    max-width: 72ch;
    font-size: 15px
}

.actions {
    margin-top: 1.25rem;
    display: flex;
    gap: .75rem
}

.btn {
    background: var(--accent);
    color: var(--btn-text, #fff);
    padding: .7rem 1rem;
    border-radius: var(--radius-md);
    border: 0;
    cursor: pointer;
    font-weight: 600
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
    border-radius: var(--radius-sm);
    padding: .55rem .9rem
}

.cards {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.75rem
}

.card {
    background: var(--card);
    padding: 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--apheum-line);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12)
}

.card h3 {
    margin: 0 0 .4rem
}

/* toasts container (top-right to match mock_toast.css) */
.toasts {
    position: fixed;
    right: 1rem;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    z-index: 9999
}

@media (max-width: 1100px) {
    .nav-desktop {
        display: none
    }

    .burger {
        display: block
    }

    .nav-mobile {
        display: block
    }
}

/* Desktop: show nav fully */
@media (min-width: 1101px) {
    .nav-mobile {
        display: none !important
    }
}

/* Toast dismiss animation (used by mock JS) */
.toasts .toast {
    transition: opacity .32s ease, transform .32s ease
}

.toasts .toast.dismiss {
    opacity: 0;
    transform: translateY(8px) scale(.98)
}


.grayscale {
    filter: grayscale(100%);
}
