/* ─────────────────────────────────────────────────────────────────────────
   TheSans C5 — LucasFonts Web License
   Served via /fonts/{name} (FontController [Authorize]).
   Files live in Resources/Fonts/ — never in wwwroot, never publicly reachable.
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
    font-family: 'TheSans C5';
    src: url('/fonts/TheSansC5-5_Plain') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    font-synthesis: none;
}

@font-face {
    font-family: 'TheSans C5';
    src: url('/fonts/TheSansC5-6_SemiBold') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    font-synthesis: none;
}

@font-face {
    font-family: 'TheSans C5';
    src: url('/fonts/TheSansC5-7_Bold') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    font-synthesis: none;
}

/* ── Design token — change the font in ONE place, everywhere updates ─────── */
:root {
    --ff-primary: 'TheSans C5', Arial, Helvetica, system-ui, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Every element inherits the font — overrides browser UA defaults for
       buttons, inputs and selects which default to system-ui otherwise. */
    font-family: inherit;
}

/* ── Root sizing ─────────────────────────────────────────────────────────── */
html {
    font-size: clamp(12px, 1.1vw, 18px);
}

/* ── Body — single authoritative font declaration ────────────────────────── */
body {
    width: 100vw;
    height: 100vh;
    font-family: var(--ff-primary);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    /* Render TheSans C5 at its best on screen */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
*::-webkit-scrollbar        { width: 4px; height: 4px; }
*::-webkit-scrollbar-track  { padding: 1px; }
*::-webkit-scrollbar-thumb  { width: 2px; color: #f5f5f5; }

/* ── App shell ───────────────────────────────────────────────────────────── */
#app {
    width: 100vw;
    height: 100vh;
    overflow: auto;
}

iconify-icon {
    vertical-align: middle;
    font-size: 22px;
}

.blazored-toast-container {
    z-index: 9999 !important;
}

/* Legacy-style Plotly chart tooltips (Calculation Output) */
.js-plotly-plot .hoverlayer .hovertext {
    font-family: Arial, sans-serif !important;
}

/* Draggable coverage line handle (Calculation Output) */
.fft-coverage-drag-handle {
    position: absolute;
    z-index: 40;
    cursor: ns-resize;
    background: transparent;
    touch-action: none;
    pointer-events: auto;
}

.fft-coverage-drag-handle:hover,
.fft-coverage-drag-handle:active {
    background: rgba(0, 166, 226, 0.12);
}

.fft-coverage-drag-handle::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
    background: #00A6E2;
    opacity: 0.55;
    pointer-events: none;
}

.fft-coverage-drag-handle:hover::before {
    opacity: 1;
    height: 3px;
}

.fft-coverage-drag-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00A6E2;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 166, 226, 0.35);
    pointer-events: none;
}

/* Chart expand popup window (/calculation/chart) */
.chart-expand-layout {
    width: 100vw;
    height: 100vh;
    background: #ffffff;
}

.chart-expand-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.chart-expand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.chart-expand-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.chart-expand-title {
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.chart-expand-coverage {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
}

.chart-expand-coverage-label {
    white-space: nowrap;
}

.chart-expand-coverage-value {
    min-width: 42px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #FFFFFF;
    outline: 1px solid #E8EBED;
    outline-offset: -1px;
    color: #004388;
    text-align: center;
}

.chart-expand-coverage-chip {
    max-width: 260px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #E2E8F0;
    color: #374151;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-expand-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
}

.chart-expand-close:hover {
    background: #F3F4F6;
    color: #111827;
}

.chart-expand-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 12px 12px;
}

.chart-expand-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9CA3AF;
    font-size: 14px;
}

/* Page-local fan loader (used where GlobalLoader scope does not apply). */
.fft-page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.60);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
}

.fft-page-loader img {
    width: 80px;
    height: 80px;
}
