/* Ariella – fridge dashboard styles. MudBlazor supplies the palette via --mud-palette-* variables. */

html, body {
    background: var(--mud-palette-background);
    -webkit-tap-highlight-color: transparent;
}

/* Lion touches: the mark, a golden "mane" line under the bar, and her name in Hebrew. */
.app-bar { border-bottom: 3px solid #e3a256; }
.app-bar .brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: inherit; text-decoration: none;
}
.app-bar .brand-mark { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .15)); }
.app-bar .brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
.app-bar .brand-he { font-size: 1.05rem; opacity: .8; font-weight: 400; }
@media (max-width: 600px) { .app-bar .brand-he { display: none; } }
.page { padding-top: 16px; padding-bottom: 24px; }
@media (max-width: 600px) {
    .nav-btn .mud-button-label { font-size: 0; }
    .nav-btn .mud-button-icon-start { margin: 0; }
    .page { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Dashboard grid: three columns on the tablet, one on phones ---------- */
.dashboard {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 900px) {
    .dashboard { grid-template-columns: 1.15fr 1fr 1fr; align-items: start; }
}
@media (min-width: 600px) and (max-width: 899px) {
    /* Portrait tablet: feed | nappy+sleep, then calendar and recent side by side below. */
    .dashboard { grid-template-columns: 1fr 1fr; align-items: start; }
    .dashboard .col:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
.dashboard .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
    padding: 16px 18px;
    border-radius: 18px !important;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head .mud-typography-h6 { font-weight: 650; }

.muted { color: var(--mud-palette-text-secondary); }
.small { font-size: .85rem; }

.big-clock {
    font-size: clamp(2.6rem, 6vw, 3.6rem);
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.mid-clock {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.since-label { color: var(--mud-palette-text-secondary); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }

.feed-running, .feed-idle { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.side-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.side-split .side {
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--mud-palette-background);
    display: flex; flex-direction: column;
}
.side-split .side span { font-size: .8rem; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.side-split .side strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.side-split .side.active { outline: 2px solid var(--mud-palette-primary); }

.feed-due {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    column-gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: color-mix(in srgb, var(--mud-palette-secondary) 12%, transparent);
}
.feed-due .due-label { font-weight: 600; }
.feed-due .due-clock { font-size: 1.8rem; font-variant-numeric: tabular-nums; text-align: right; grid-row: span 2; align-self: center; }
.feed-due .due-sub { color: var(--mud-palette-text-secondary); font-size: .9rem; }
.feed-due.due { background: color-mix(in srgb, var(--mud-palette-warning) 18%, transparent); border-color: var(--mud-palette-warning); }
.feed-due.overdue { background: color-mix(in srgb, var(--mud-palette-error) 14%, transparent); border-color: var(--mud-palette-error); }
.feed-due.overdue .due-clock { color: var(--mud-palette-error); }

.next-side {
    font-size: 1.15rem;
    padding: 8px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
    width: 100%;
}

.btn-stack { display: flex; flex-direction: column; gap: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row.three { grid-template-columns: repeat(3, 1fr); }
.mud-button-root.tall { min-height: 56px; font-size: 1.05rem; text-transform: none; font-weight: 600; }
.mud-button-root.huge { min-height: 76px; font-size: 1.2rem; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-row.summary { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: 16px; }
.stat {
    background: var(--mud-palette-background);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex; flex-direction: column;
}
.stat-row.summary .stat { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); }
.stat strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--mud-palette-text-secondary); }

/* ---------- Lists ---------- */
.event-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.event-list li {
    display: grid;
    grid-template-columns: 9.5em 1fr;
    column-gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.event-list li:last-child { border-bottom: 0; }
.event-when { color: var(--mud-palette-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.event-title { font-weight: 550; overflow-wrap: anywhere; }
.event-where { grid-column: 2; color: var(--mud-palette-text-secondary); font-size: .85rem; }

.activity {
    display: grid;
    grid-template-columns: 22px 3.2em 1fr auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 4px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
}
.activity:hover { background: var(--mud-palette-action-default-hover); }
.activity-list li:last-child .activity { border-bottom: 0; }
.activity-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.activity-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-ago { color: var(--mud-palette-text-secondary); font-size: .85rem; white-space: nowrap; }
.who {
    font-size: .7rem; font-weight: 700;
    min-width: 26px; height: 26px; padding: 0 4px;
    border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--mud-palette-secondary) 18%, transparent);
    color: var(--mud-palette-secondary);
}

.history-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.history-day { font-weight: 650; }
.agenda-day { margin-bottom: 12px; }
.agenda-label { font-weight: 650; }

/* ---------- Login (static page, no MudBlazor JS) ---------- */
.login-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 16px;
    background: #f7f4fa;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #221b2b;
}
.login-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(60, 30, 90, .12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-card img { align-self: center; }
.login-card h1 { margin: 4px 0 0; text-align: center; font-size: 1.6rem; }
.login-sub { margin: 0 0 8px; text-align: center; color: #5f566b; }
.login-he { margin: -2px 0 2px; text-align: center; color: #b06f2a; font-size: .95rem; }
.login-he span { font-size: 1.15rem; }
.login-card label { font-weight: 600; font-size: .9rem; margin-top: 6px; }
.login-card input {
    font: inherit; font-size: 1.1rem;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d6cde0;
    background: #fff; color: inherit;
}
.login-card input:focus { outline: 2px solid #7c5c9e; border-color: transparent; }
.login-card button {
    margin-top: 14px;
    font: inherit; font-weight: 650; font-size: 1.1rem;
    padding: 14px;
    border: 0; border-radius: 12px;
    background: #7c5c9e; color: #fff;
    cursor: pointer;
}
.login-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: #8a1c1c; }
@media (prefers-color-scheme: dark) {
    .login-shell { background: #0f0d12; color: #ece6f2; }
    .login-card { background: #1a1720; box-shadow: none; border: 1px solid #2e2836; }
    .login-sub { color: #a79fb3; }
    .login-he { color: #e3a256; }
    .login-card input { background: #0f0d12; border-color: #3a3344; }
    .login-error { background: #3a1717; color: #ffb4b4; }
}

/* ---------- Blazor error banner ---------- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #222;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
