/* Plotstead — dark theme, matching the FineDay / Tideline NZ house style.
   Design tokens + base elements + shared button/input primitives only.
   Component styles live in their .razor.css files. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/Inter-Bold.woff2") format("woff2"); }

:root {
    --bg: #0d1117;
    --bg-card: rgba(26, 31, 46, 0.9);
    --bg-row: rgba(26, 31, 46, 0.4);
    --bg-chip: #1a1f2e;
    --bg-sheet: #141923;
    --border: #252932;
    --border-card: rgba(255, 255, 255, 0.07);
    --border-row: rgba(255, 255, 255, 0.03);
    --border-chip: #2a3448;
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.42);
    --text-faint: rgba(255, 255, 255, 0.28);
    --accent: #4a90d9;
    --amber: #fca01a;
    --green: #69d84f;
    --red: #e06c75;
    --radius-card: 16px;
    --radius-chip: 20px;
    --radius-input: 12px;

    /* Subtle depth: a soft sheen for card surfaces, layered over their bg. */
    --sheen: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 55%);

    /* iOS reports the bottom inset via env(); Android edge-to-edge bridges it
       in natively as --safe-bottom. Use --inset-b wherever content must clear
       the bottom of the screen. */
    --inset-b: max(env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px));
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    /* Faint blue-tinted glow at the top so the dark canvas isn't dead flat. */
    background: radial-gradient(120% 60% at 50% 0%, #141b29 0%, var(--bg) 60%) fixed, var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
}

#app {
    height: 100%;
}

h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 4px;
}

h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* ── Inputs ─────────────────────────────────────────────────────────── */

input, select, textarea {
    background: var(--bg-chip);
    border: 1px solid var(--border-chip);
    border-radius: var(--radius-input);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: var(--text-faint);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='rgba(255,255,255,0.42)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

/* Native date/time picker indicators render black on dark otherwise */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

/* ── Buttons (bootstrap-compatible class names, house look) ─────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-chip);
    padding: 9px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn i {
    font-size: 17px;
}

.btn-primary {
    background: linear-gradient(180deg, #58a0e6 0%, var(--accent) 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #66aae9 0%, #5b9de0 100%);
}

.btn-primary:disabled {
    background: var(--bg-chip);
    color: var(--text-faint);
    cursor: default;
}

.btn-outline-primary {
    background: var(--bg-chip);
    border-color: var(--border-chip);
    color: var(--accent);
}

.btn-outline-primary:hover {
    background: #1f2538;
}

.btn-outline-secondary {
    background: var(--bg-chip);
    border-color: var(--border-chip);
    color: var(--text-dim);
}

.btn-outline-secondary:hover {
    background: #1f2538;
    color: var(--text);
}

.btn-outline-danger {
    background: none;
    border-color: rgba(224, 108, 117, 0.4);
    color: var(--red);
}

.btn-outline-danger:hover {
    background: rgba(224, 108, 117, 0.12);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.p-0 { padding: 0; }
.align-baseline { vertical-align: baseline; }

/* ── Shared primitives ──────────────────────────────────────────────── */

.medallion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    flex-shrink: 0;
}

.medallion i {
    font-size: 20px;
}

.sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0 auto 6px;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .sheet-handle {
        display: none;
    }
}

.empty-state {
    text-align: center;
    padding: 44px 16px;
    color: var(--text-dim);
    font-size: 14px;
}

.empty-state i {
    display: block;
    font-size: 34px;
    color: var(--text-faint);
    margin-bottom: 8px;
}

/* ── Scrollbars (thin, dark-friendly) ───────────────────────────────── */

.content-scroll, .modal-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    scrollbar-gutter: stable;
}

.content-scroll::-webkit-scrollbar, .modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.content-scroll::-webkit-scrollbar-track, .modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.content-scroll::-webkit-scrollbar-thumb, .modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}

/* ── Loading screen (pre-Blazor) ────────────────────────────────────── */

.loading-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: var(--bg);
}

.loading-logo {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}

.loading-logo-accent {
    color: var(--accent);
}

/* ── System chrome ──────────────────────────────────────────────────── */

.status-bar-safe-area {
    background-color: var(--bg);
    height: env(safe-area-inset-top);
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 999;
}

#blazor-error-ui {
    background: lightyellow;
    color: #000;
    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;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
