/* ===== Evo Dingee Tracker – app styles ===== */

/* Font: Figtree everywhere (html:root beats MudThemeProvider's :root variables) */
html:root {
    --mud-typography-default-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-h1-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-h2-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-h3-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-h4-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-h5-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-h6-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-subtitle1-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-subtitle2-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-body1-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-body2-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-button-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-caption-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --mud-typography-button-text-transform: none;

    --evo-navy: #12355B;
    --evo-lagoon: #0B7A75;
    --evo-lagoon-light: #D7EFEC;
    --evo-income: #1F8A4C;
    --evo-expense: #C8453B;
    --evo-unpaid: #C98A12;
}

body {
    font-family: var(--mud-typography-default-family);
    background: var(--mud-palette-background);
    color: var(--evo-navy);
}

/* ---------- App bar ---------- */
.evo-appbar {
    padding-top: env(safe-area-inset-top, 0px);
}

.evo-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.evo-topnav {
    margin-left: 32px;
    gap: 4px;
}

.evo-topnav a {
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
}

.evo-topnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.evo-topnav a.active { color: #fff; background: rgba(255, 255, 255, .14); }

.evo-user {
    font-weight: 500;
    margin-right: 4px;
    opacity: .9;
}

/* ---------- Main content ---------- */
.evo-container {
    padding-top: 20px;
    padding-bottom: 24px;
}

/* Space for the bottom nav on phones */
.evo-main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.evo-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 16px;
}

.evo-title {
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

/* ---------- Active trips hero ---------- */
.evo-active-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--evo-lagoon) !important;
    color: #fff !important;
    border-radius: 14px !important;
}

.evo-active-icon { font-size: 2.4rem !important; opacity: .85; }
.evo-active-number { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.evo-active-label { font-size: .95rem; opacity: .9; margin-top: 4px; }

/* ---------- Budget stats ---------- */
.evo-stat {
    padding: 14px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    height: 100%;
}

.evo-stat-label { font-size: .85rem; color: var(--mud-palette-text-secondary); font-weight: 500; }
.evo-stat-value { font-size: 1.45rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }

.text-income { color: var(--evo-income); }
.text-expense { color: var(--evo-expense); }
.text-unpaid { color: var(--evo-unpaid); }

/* ---------- Mobile bottom navigation ---------- */
.evo-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    display: flex;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.evo-bottomnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

.evo-bottomnav a.active { color: var(--evo-lagoon); }

.evo-bottomnav a.active .mud-icon-root {
    background: var(--evo-lagoon-light);
    border-radius: 16px;
    padding: 2px 16px;
    width: auto;
    box-sizing: content-box;
}

/* ---------- Desktop / mobile switching (MudBlazor md = 960px) ---------- */
.desktop-only { display: none !important; }

@media (min-width: 960px) {
    .desktop-only { display: flex !important; }
    .evo-bottomnav { display: none; }
    .evo-main { padding-bottom: 0; }
    .evo-container { padding-top: 32px; }
}

/* ---------- Account pages (Bootstrap) tidy-up ---------- */
.evo-container h1 { font-weight: 800; font-size: 1.8rem; color: var(--evo-navy); }
.evo-container .btn-primary { background: var(--evo-lagoon); border-color: var(--evo-lagoon); }
.evo-container .btn-primary:hover { background: #09625e; border-color: #09625e; }

/* ---------- Blazor error bar ---------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #FFF4D6;
    color: #5a4300;
    box-shadow: 0 -1px 4px rgba(18, 53, 91, .15);
}

#blazor-error-ui .reload { margin-left: 8px; font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
