/* ========================================================
   ZONEPULSE TERMINAL DESIGN SYSTEM (STALCRAFT / ZONE PDA)
   Authored by Art Direction & Senior Frontend Engineering
   Theme: Rugged Military PDA Terminal / Radar / Dosimeter
   ======================================================== */

[v-cloak] {
    display: none !important;
}

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Rajdhani:wght@500;600;700&display=swap');

:root {
    /* Main Background & Hardware Surfaces */
    --color-bg: #0f1418;
    --color-surface: #131920;
    --color-surface-panel: #161e27;
    --color-surface-raised: #1a2430;
    --color-surface-muted: #202c3a;
    --color-surface-hover: #263445;
    
    /* 1px Hardware Borders */
    --color-border: #233140;
    --color-border-subtle: #1c2733;
    --color-border-hover: #3c4f66;
    --color-border-focus: #5b8ae6;
    
    /* Text Hierarchy (High Contrast, WCAG AA Compliant) */
    --color-text: #e4ecf2;
    --color-text-muted: #8b9cae;
    --color-text-dim: #6d7f92;
    --color-text-disabled: #475569;
    
    /* Core Accents: Blue Radar & PDA Amber */
    --color-accent: #5b8ae6;
    --color-accent-hover: #4a77ce;
    --color-accent-dim: rgba(91, 138, 230, 0.15);
    
    --color-pda-amber: #d9a441;
    --color-pda-amber-dim: rgba(217, 164, 65, 0.15);
    
    /* Gold is strictly reserved for ZonePulse Logo & Premium badge */
    --color-gold: #d4a24c;
    --color-gold-hover: #e5b35c;
    
    /* Profit / Cost: Functional colors ONLY */
    --color-profit: #3ad07a;
    --color-profit-bg: rgba(58, 208, 122, 0.10);
    --color-profit-border: rgba(58, 208, 122, 0.28);
    
    --color-cost: #ff6361;
    --color-cost-bg: rgba(255, 99, 97, 0.10);
    --color-cost-border: rgba(255, 99, 97, 0.28);
    
    --color-warning: #d9a441;
    --color-success: #3ad07a;

    /* Stalcraft Canonical Rarities */
    --rarity-common: #e6e9ec;
    --rarity-uncommon: #3ad07a;
    --rarity-special: #4ab8e6;
    --rarity-rare: #e64ac9;
    --rarity-exceptional: #ff7b6b;
    --rarity-legendary: #f0c84a;
    --rarity-unique: #f576de;

    /* Terminal Radii (Tight 2-4px, no bulbous SaaS rounds) */
    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;

    /* Density Default (Large) */
    --row-py: 12px;
    --card-p: 12px 14px;
    --fs-base: 14px;
    --card-gap: 12px;
}

/* Density Levels */
html[data-density="compact"] {
    --row-py: 4px;
    --card-p: 8px 10px;
    --fs-base: 12px;
    --card-gap: 8px;
}

html[data-density="normal"] {
    --row-py: 8px;
    --card-p: 10px 12px;
    --fs-base: 13px;
    --card-gap: 10px;
}

html, html[data-density="large"] {
    --row-py: 12px;
    --card-p: 12px 14px;
    --fs-base: 14px;
    --card-gap: 12px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: var(--fs-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Selection Color */
::selection {
    background: rgba(91, 138, 230, 0.35);
    color: #ffffff;
}

/* Tabular Numbers */
.mono-num,
.tabular-nums {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* Terminal Headings & Badges */
.font-terminal,
.font-label {
    font-family: 'Rajdhani', 'Chakra Petch', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Subtle Millimeter Grid in Empty Backgrounds */
.grid-bg {
    background-image: 
        linear-gradient(to right, rgba(35, 49, 64, 0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(35, 49, 64, 0.10) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Terminal Hardware Panel with 1px border */
.terminal-panel {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    position: relative;
}

/* Hardware Corner Brackets */
.corner-brackets {
    position: relative;
}
.corner-brackets::before,
.corner-brackets::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    pointer-events: none;
    z-index: 2;
}
.corner-brackets::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--color-accent);
    border-left: 2px solid var(--color-accent);
}
.corner-brackets::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--color-accent);
    border-right: 2px solid var(--color-accent);
}

.corner-brackets-amber::before {
    border-color: var(--color-pda-amber);
}
.corner-brackets-amber::after {
    border-color: var(--color-pda-amber);
}

/* Screws in Panel Corners */
.mil-screws {
    position: relative;
}
.mil-screws::before,
.mil-screws::after {
    content: '•';
    position: absolute;
    font-size: 11px;
    line-height: 1;
    color: #3b4d61;
    pointer-events: none;
    z-index: 2;
}
.mil-screws::before { top: 4px; left: 5px; }
.mil-screws::after { top: 4px; right: 5px; }

/* Stencil Stamp */
.stencil-stamp {
    font-family: 'Rajdhani', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 2px;
    display: inline-block;
    line-height: 1.2;
}

/* Flat Military Buttons with 1px Down Press */
.btn-terminal {
    background: #16202a;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 100ms ease, border-color 100ms ease, color 100ms ease;
}
.btn-terminal:hover {
    background: #1e2c3b;
    border-color: var(--color-border-hover);
    color: #ffffff;
}
.btn-terminal:active {
    transform: translateY(1px);
}
.btn-terminal:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-accent);
}
.btn-terminal:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-terminal-primary {
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: #0b1117;
    font-weight: 800;
}
.btn-terminal-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #ffffff;
}

.btn-terminal-amber {
    background: var(--color-pda-amber);
    border: 1px solid var(--color-pda-amber);
    color: #0b1117;
    font-weight: 800;
}
.btn-terminal-amber:hover {
    background: #c89332;
    border-color: #c89332;
    color: #ffffff;
}

/* Stalker Hardware Toggle Switch */
.stalker-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.stalker-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.stalker-toggle-track {
    width: 34px;
    height: 18px;
    background-color: #121820;
    border: 1px solid #283748;
    border-radius: 2px;
    transition: background-color 150ms ease, border-color 150ms ease;
    position: relative;
    flex-shrink: 0;
}
.stalker-toggle input:checked + .stalker-toggle-track {
    background-color: #1e334a;
    border-color: var(--color-accent);
}
.stalker-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background-color: #4b6076;
    border-radius: 1px;
    transition: transform 150ms ease, background-color 150ms ease;
}
.stalker-toggle input:checked + .stalker-toggle-track .stalker-toggle-thumb {
    transform: translateX(16px);
    background-color: var(--color-accent);
}

/* Radar Sweep Screen Display */
.radar-screen {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91,138,230,0.12) 0%, rgba(15,20,24,0.95) 75%);
    border: 1px solid rgba(91, 138, 230, 0.4);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 16px rgba(0,0,0,0.8);
}
.radar-sweep-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-accent));
    transform-origin: 0 0;
    animation: radar-sweep-anim 3.5s linear infinite;
}
@keyframes radar-sweep-anim {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card Container for Row View with Crosshair Cursor */
.sz-card-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: var(--card-gap);
    padding: 6px 2px 14px 2px;
    scrollbar-color: var(--color-surface-muted) var(--color-surface);
    scrollbar-width: thin;
    cursor: crosshair;
}

/* Radar Lot Cards */
.sz-card {
    background: #141b23;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    position: relative;
    padding: var(--card-p);
    transition: border-color 120ms ease, background-color 120ms ease;
}

.sz-card:hover {
    border-color: var(--color-border-hover);
    background-color: #17202a;
}

/* Rarity Side Indicator (Left Stripe) */
.rarity-stripe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    z-index: 5;
}
.rarity-stripe-COMMON { background-color: var(--rarity-common); }
.rarity-stripe-UNCOMMON { background-color: var(--rarity-uncommon); }
.rarity-stripe-SPECIAL { background-color: var(--rarity-special); }
.rarity-stripe-RARE { background-color: var(--rarity-rare); }
.rarity-stripe-EXCLUSIVE { background-color: var(--rarity-exceptional); }
.rarity-stripe-LEGENDARY { background-color: var(--rarity-legendary); }
.rarity-stripe-UNIQUE { background-color: var(--rarity-unique); }

/* Rarity Corner Brackets for RARE and above */
.rarity-corners {
    position: relative;
}
.rarity-corners::before,
.rarity-corners::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    pointer-events: none;
    z-index: 3;
    opacity: 0.85;
}
.rarity-corners::before {
    top: -1px; right: -1px;
    border-top: 2px solid var(--rarity-color, var(--color-accent));
    border-right: 2px solid var(--rarity-color, var(--color-accent));
}
.rarity-corners::after {
    bottom: -1px; left: -1px;
    border-bottom: 2px solid var(--rarity-color, var(--color-accent));
    border-left: 2px solid var(--rarity-color, var(--color-accent));
}

/* Inputs & Form Elements */
.sz-input {
    background-color: #11171f;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    transition: border-color 100ms ease, box-shadow 100ms ease;
}
.sz-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}
.sz-input::placeholder {
    color: var(--color-text-disabled);
}

.sz-select {
    background-color: #11171f;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    height: 34px;
    padding: 0 28px 0 10px;
    font-size: 13px;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9cae' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}
.sz-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Profit / Loss Badges */
.badge-profit {
    background-color: var(--color-profit-bg);
    color: var(--color-profit);
    border: 1px solid var(--color-profit-border);
    border-radius: 2px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.badge-loss {
    background-color: var(--color-cost-bg);
    color: var(--color-cost);
    border: 1px solid var(--color-cost-border);
    border-radius: 2px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* Navigation & Sidebar Items */
.sz-sidebar {
    width: 56px;
    z-index: 50 !important;
    transition: width 150ms ease-in-out;
}
.sz-sidebar:hover,
.sz-sidebar:focus-visible {
    width: 220px;
}
.sz-sidebar .nav-label {
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    white-space: nowrap;
}
.sz-sidebar:hover .nav-label,
.sz-sidebar:focus-visible .nav-label {
    opacity: 1;
    pointer-events: auto;
}
.sz-logo-collapsed {
    transition: opacity 120ms ease;
}
.sz-logo-expanded {
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}
.sz-sidebar:hover .sz-logo-collapsed,
.sz-sidebar:focus-visible .sz-logo-collapsed {
    opacity: 0;
}
.sz-sidebar:hover .sz-logo-expanded,
.sz-sidebar:focus-visible .sz-logo-expanded {
    opacity: 1;
    pointer-events: auto;
}
.sz-sidebar-item {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 16px;
    color: var(--color-text-muted);
    border-left: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: color 100ms ease, background-color 100ms ease;
}
.sz-sidebar-item:hover {
    color: var(--color-text);
    background-color: #17212b;
}
.sz-sidebar-item.active {
    color: var(--color-accent);
    background-color: rgba(91, 138, 230, 0.10);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: #1e2b38;
    border-radius: 1px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2e4155;
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
