/* ==========================================================================
   tvTech Solution Lab — Industrial Precision Dark Design System
   Shared across index.html, models.html, order-tracking.html
   ========================================================================== */

:root {
    /* Surfaces */
    --bg-primary: #090d16;
    --bg-secondary: #0f1623;
    --bg-card: #131c2e;
    --bg-card-hover: #182338;
    --bg-input: #0b101b;
    --bg-glass: rgba(9, 13, 22, 0.88);

    /* Typography colors (WCAG AA compliant on dark surfaces) */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Industrial Accents */
    --accent-cyan: #00d4ff;
    --accent-cyan-hover: #33ddff;
    --accent-cyan-dim: rgba(0, 212, 255, 0.10);
    --accent-cyan-border: rgba(0, 212, 255, 0.30);

    --accent-orange: #f97316;
    --accent-orange-hover: #ea580c;
    --accent-orange-dim: rgba(249, 115, 22, 0.12);
    --accent-orange-border: rgba(249, 115, 22, 0.35);

    --accent-green: #10b981;
    --accent-green-dim: rgba(16, 185, 129, 0.12);
    --accent-green-border: rgba(16, 185, 129, 0.32);

    --accent-yellow: #f59e0b;
    --accent-yellow-dim: rgba(245, 158, 11, 0.12);

    --accent-red: #f43f5e;
    --accent-red-dim: rgba(244, 63, 94, 0.12);

    /* Borders & Radii */
    --border-color: #1e293b;
    --border-strong: #334155;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    --shadow-elevated: 0 16px 40px -6px rgba(0, 0, 0, 0.65);
    --glow-cyan: 0 0 0 1px rgba(0, 212, 255, 0.25), 0 8px 24px -4px rgba(0, 212, 255, 0.18);
    --glow-orange: 0 8px 24px -4px rgba(249, 115, 22, 0.35);

    /* Font stacks (Be Vietnam Pro has 100% native Vietnamese diacritics) */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Be Vietnam Pro', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Blueprint Technical Grid Background + Radar Scanline */
.grid-bg {
    position: fixed;
    inset: 0;
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 45% at 50% -10%, rgba(0, 212, 255, 0.11), transparent 70%),
        linear-gradient(rgba(30, 41, 59, 0.45) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 41, 59, 0.45) 1px, transparent 1px);
    background-size: 100% 100%, 48px 48px, 48px 48px;
    animation: blueprintDrift 36s linear infinite;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.grid-bg::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.045), rgba(0, 212, 255, 0.12) 98%, transparent);
    border-bottom: 1px solid rgba(0, 212, 255, 0.22);
    animation: radarScan 11s ease-in-out infinite;
    pointer-events: none;
}

@keyframes blueprintDrift {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 48px 48px, 48px 48px; }
}

@keyframes radarScan {
    0% { transform: translateY(-160px); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(105vh); opacity: 0; }
}

/* Accessibility & Focus */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: var(--accent-cyan);
    color: #04131a;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    z-index: 3000;
    text-decoration: none;
}

.skip-link:focus {
    left: 12px;
}

:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* ==========================================================================
   Unified Header & Mobile Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.header.header-hidden {
    transform: translateY(-100%);
}

.nav {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.16), rgba(249, 115, 22, 0.16));
    border: 1px solid var(--accent-cyan-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-brand span {
    color: var(--accent-cyan);
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.nav-links a svg {
    width: 15px;
    height: 15px;
    opacity: 0.8;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-links a.active {
    color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.nav-cta:hover {
    border-color: var(--accent-cyan-border);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.nav-cta .cta-role {
    font-family: var(--font-sans);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
}

.led-indicator {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    flex-shrink: 0;
    animation: ledPulse 2.2s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Mobile Menu Button & Drawer */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--accent-cyan-border);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-drawer {
    display: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px 18px;
}

.mobile-drawer.open {
    display: block;
}

.mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.mobile-drawer-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

.mobile-drawer-links a svg {
    width: 18px;
    height: 18px;
    color: var(--accent-cyan);
}

.mobile-drawer-links a.active,
.mobile-drawer-links a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.mobile-drawer-phones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.mobile-drawer-phones a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-orange);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--glow-orange);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-orange-hover);
    transform: translateY(-2px);
}

.btn-cyan {
    background: var(--accent-cyan);
    color: #04131a;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(0, 212, 255, 0.25);
}

.btn-cyan:hover:not(:disabled) {
    background: var(--accent-cyan-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent-cyan);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* Technical Section Headers */
.sec-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-cyan-dim);
    border: 1px solid var(--accent-cyan-border);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.sec-heading {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 10px;
}

.sec-desc {
    color: var(--text-secondary);
    font-size: 15.5px;
    max-width: 640px;
}

/* ==========================================================================
   Unified Footer
   ========================================================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 56px 24px 36px;
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.3fr;
    gap: 40px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.footer-col h4 {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-contact-list svg {
    width: 17px;
    height: 17px;
    color: var(--accent-cyan);
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-contact-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-contact-list a:hover {
    color: var(--accent-cyan);
}

.footer-bottom {
    max-width: 1280px;
    margin: 24px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-bottom .highlight {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* ==========================================================================
   Floating Action Buttons (Zalo & Map) & Toast
   ========================================================================== */
.zalo-fab,
.map-fab {
    position: fixed;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.zalo-fab {
    bottom: 20px;
    background: #0068ff;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 104, 255, 0.4);
}

.map-fab {
    bottom: 78px;
    background: var(--bg-card);
    color: var(--accent-orange);
    border-color: var(--accent-orange-border);
    box-shadow: var(--shadow-card);
}

.zalo-fab:hover,
.map-fab:hover {
    transform: translateY(-3px);
}

.zalo-fab svg,
.map-fab svg {
    width: 22px;
    height: 22px;
}

/* Toast Notification */
.tvt-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    max-width: min(92vw, 520px);
    background: var(--bg-secondary);
    border: 1px solid var(--accent-cyan);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 2200;
    font-size: 14px;
    line-height: 1.5;
}

.tvt-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.tvt-toast.error {
    border-color: var(--accent-red);
}

/* ==========================================================================
   Responsive Rules (Shared)
   ========================================================================== */
@media (max-width: 960px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 0 16px;
        height: 60px;
    }

    .nav-actions .nav-cta:nth-child(2) {
        display: none;
    }

    .nav-actions .nav-cta {
        padding: 7px 10px;
        font-size: 12px;
    }

    .nav-actions .nav-cta .cta-role {
        display: none;
    }

    .footer {
        padding: 40px 16px 32px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Industrial Micro-Interactions & Motion Effects
   ========================================================================== */

/* 1. Rotating Mechanical Gear Logo */
.logo-icon svg {
    animation: gearSpin 18s linear infinite;
    transition: transform 0.4s ease;
}

.logo:hover .logo-icon svg {
    animation-duration: 3s;
}

@keyframes gearSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 2. Interactive Cursor Spotlight on Cards */
.spotlight-card {
    position: relative;
    overflow: hidden;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        480px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 212, 255, 0.11),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.spotlight-card:hover::before {
    opacity: 1;
}

/* 3. Scroll-Reveal Staggered Entrance */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 4. Light Sweep Shimmer on Primary Action Buttons */
.hero-track-btn.primary,
.btn-submit,
.btn-primary {
    position: relative;
    overflow: hidden;
}

.hero-track-btn.primary::after,
.btn-submit::after,
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 65%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-22deg);
    animation: btnLightSweep 5.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btnLightSweep {
    0%, 65% { left: -120%; }
    100% { left: 160%; }
}

@media (prefers-reduced-motion: reduce) {
    .grid-bg,
    .grid-bg::after,
    .logo-icon svg,
    .hero-track-btn.primary::after,
    .btn-submit::after,
    .btn-primary::after {
        animation: none !important;
    }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
