/* Custom Styles & Minimalist Modern Polish */

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

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-mono-receipt {
    font-family: var(--font-mono);
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Subtle border and shadow tokens */
.border-subtle {
    border-color: #f1f5f9;
}

/* OCR Scanner Viewfinder Box */
.ocr-viewfinder {
    position: relative;
    border: 1.5px solid #0f172a;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75);
    pointer-events: none;
}
.ocr-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
    animation: scanMove 2s infinite linear;
}
@keyframes scanMove {
    0% { top: 5%; opacity: 0.3; }
    50% { opacity: 1; }
    100% { top: 95%; opacity: 0.3; }
}

/* Toast Notifications */
.toast-item {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(110%);
    opacity: 0;
}
.toast-item.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-item.hide {
    transform: translateX(120%);
    opacity: 0;
}

/* =========================================================================
   FORMULA 1 & AUTOMOTIVE TELEMETRY THEME (TACHOMETER, CARBON, SHIFT LIGHTS)
   ========================================================================= */

/* Carbon Fiber Weave Pattern */
.bg-carbon {
    background-color: #080c14;
    background-image: 
        linear-gradient(45deg, #0f172a 25%, transparent 25%), 
        linear-gradient(-45deg, #0f172a 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #0f172a 75%), 
        linear-gradient(-45deg, transparent 75%, #0f172a 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.bg-carbon-glow {
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.08), transparent 40%),
                radial-gradient(circle at bottom left, rgba(239, 68, 68, 0.05), transparent 40%),
                #070a12;
}

/* F1 Telemetry Badge */
.f1-badge {
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* F1 Shift Lights Cluster (Telemetry RPM) */
.shift-lights {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    background: #050811;
    border: 1px solid #1e293b;
    border-radius: 9999px;
}

.shift-led {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #1e293b;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.shift-led.green.active { background: #10b981; box-shadow: 0 0 6px #10b981; }
.shift-led.yellow.active { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.shift-led.red.active { background: #ef4444; box-shadow: 0 0 7px #ef4444; }
.shift-led.blue.active { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }

/* Chequered Flag / Finish Line Ribbon */
.racing-chequered {
    background-image: 
        linear-gradient(45deg, #ffffff 25%, #090d16 25%, #090d16 50%, #ffffff 50%, #ffffff 75%, #090d16 75%, #090d16 100%);
    background-size: 8px 8px;
}

/* F1 Pit Stop Lights Bar (Red to Green signal) */
.pit-lights-bar {
    display: inline-flex;
    gap: 4px;
    padding: 2px 6px;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 8px;
}
.pit-bulb {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #1e293b;
}
.pit-bulb.lit-red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.pit-bulb.lit-green { background: #10b981; box-shadow: 0 0 6px #10b981; }

/* Tachometer / Circular Telemetry Speedometer Gauge */
.tachometer-gauge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tachometer-gauge svg {
    transform: rotate(-90deg);
}
.gauge-track {
    stroke: #1e293b;
    fill: none;
    stroke-width: 4.5;
}
.gauge-fill {
    fill: none;
    stroke-width: 4.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease, stroke 0.4s ease;
}

/* -------------------------------------------------------------------------
   THERMAL PRINTER STYLES (58mm & 80mm ESC/POS layout)
------------------------------------------------------------------------- */
@media print {
    body * {
        visibility: hidden;
    }
    
    #thermal-ticket-container,
    #thermal-ticket-container * {
        visibility: visible;
    }

    #thermal-ticket-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: #ffffff;
        color: #000000;
        font-family: 'JetBrains Mono', monospace;
    }

    @page {
        margin: 0;
        size: auto;
    }
}
