/* ====================================================
   TuaRai.AI - Cyberpunk AI Scanner Design System
   ตัวอะไร - CSS Stylesheet
   ==================================================== */

/* CSS Custom Properties */
:root {
    --bg-primary:    #0a0a0f;
    --bg-secondary:  #0d1117;
    --bg-card:       rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(22, 32, 52, 0.9);

    --neon-green:  #00ff88;
    --neon-cyan:   #00d4ff;
    --neon-purple: #a855f7;
    --neon-red:    #ff3366;
    --neon-yellow: #ffdd00;
    --neon-orange: #ff8800;

    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --border-color:     rgba(0, 255, 136, 0.15);
    --border-hover:     rgba(0, 212, 255, 0.4);
    --glass-bg:         rgba(255, 255, 255, 0.03);
    --glass-border:     rgba(255, 255, 255, 0.08);

    --font-heading: 'Orbitron', monospace;
    --font-body:    'Rajdhani', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    --nav-height: 64px;
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.tuarai-body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.6;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); letter-spacing: 0.05em; }
.neon-green  { color: var(--neon-green) !important; }
.neon-cyan   { color: var(--neon-cyan) !important; }
.neon-purple { color: var(--neon-purple) !important; }
.neon-red    { color: var(--neon-red) !important; }
.text-muted  { color: var(--text-muted) !important; }

/* ===== Navbar ===== */
.tuarai-nav {
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    height: var(--nav-height);
    z-index: 1000;
}

.brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #000; font-size: 18px;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.1em;
}

.brand-dot { color: var(--neon-green); }

.nav-link {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.4rem 0.8rem !important;
    border-radius: 6px;
}

.nav-link:hover, .nav-link.active {
    color: var(--neon-green) !important;
    background: rgba(0, 255, 136, 0.08);
}

/* ===== Mobile Navbar Collapse ===== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(10, 10, 15, 0.98);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        margin-top: 0.5rem;
        padding: 0.75rem;
        backdrop-filter: blur(20px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    }

    .navbar-collapse .nav-link {
        color: var(--text-primary) !important;
        padding: 0.65rem 1rem !important;
        border-radius: 8px;
        margin-bottom: 0.25rem;
        border: 1px solid transparent;
        display: flex;
        align-items: center;
    }

    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link.active {
        color: var(--neon-green) !important;
        background: rgba(0, 255, 136, 0.08);
        border-color: rgba(0, 255, 136, 0.2);
    }

    .navbar-collapse .nav-link i {
        width: 20px;
        text-align: center;
    }

    .navbar-toggler {
        border-color: rgba(0, 255, 136, 0.4) !important;
        padding: 0.35rem 0.6rem;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 255, 136, 0.25) !important;
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0,255,136,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }
}

/* ===== Page Wrapper ===== */
.page-wrapper { padding-top: var(--nav-height); }

/* ===== Hero Section ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: calc(var(--nav-height) + 2rem) 1rem 4rem;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,255,136,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,212,255,0.04) 0%, transparent 50%),
        var(--bg-primary);
}

.hero-particles {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(0,255,136,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 60%, rgba(0,212,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 80%, rgba(168,85,247,0.3) 0%, transparent 100%);
    animation: particleFloat 8s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-20px); opacity: 1; }
}

.hero-content { position: relative; z-index: 2; }

/* Logo Animation */
.hero-logo { display: flex; justify-content: center; }

.logo-ring {
    width: 120px; height: 120px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

.logo-inner {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,212,255,0.2));
    border: 2px solid var(--neon-green);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2;
    box-shadow: 0 0 30px rgba(0,255,136,0.3), inset 0 0 20px rgba(0,255,136,0.1);
    animation: logoBreath 3s ease-in-out infinite;
}

.logo-icon { font-size: 2.5rem; color: var(--neon-green); }

.logo-orbit {
    position: absolute; inset: 0;
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 50%;
    border-top-color: var(--neon-cyan);
    animation: logoOrbit 3s linear infinite;
}

@keyframes logoBreath { 0%,100% { box-shadow: 0 0 30px rgba(0,255,136,0.3); } 50% { box-shadow: 0 0 60px rgba(0,255,136,0.5), 0 0 80px rgba(0,212,255,0.2); } }
@keyframes logoOrbit { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Hero Text */
.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.1em;
    line-height: 1;
    text-shadow: 0 0 40px rgba(0,255,136,0.3);
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--neon-cyan);
    letter-spacing: 0.2em;
    margin-top: 0.5rem;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
    animation: glitch 5s infinite;
}

@keyframes glitch {
    0%, 94%, 100% { text-shadow: none; }
    95% { text-shadow: -2px 0 var(--neon-red), 2px 0 var(--neon-cyan); }
    97% { text-shadow: 2px 0 var(--neon-green), -2px 0 var(--neon-purple); }
}

/* Buttons */
.btn-hero {
    background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
    color: #000;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    border: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    text-transform: uppercase;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0,255,136,0.4);
    color: #000;
}

.btn-outline-hero {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex; align-items: center;
    text-transform: uppercase;
}

.btn-outline-hero:hover {
    background: rgba(0,212,255,0.1);
    box-shadow: 0 0 25px rgba(0,212,255,0.3);
    color: var(--neon-cyan);
    transform: translateY(-2px);
}

.btn-outline-cyber {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex; align-items: center;
}

.btn-outline-cyber:hover {
    background: rgba(0,255,136,0.1);
    box-shadow: 0 0 15px rgba(0,255,136,0.3);
    color: var(--neon-green);
    transform: translateY(-1px);
}

.btn-scan, .btn-scan-submit, .btn-scan-main {
    background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
    color: #000;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.05em;
    border: none;
    transition: var(--transition);
}

.btn-scan:hover, .btn-scan-submit:hover, .btn-scan-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,255,136,0.4);
    color: #000;
}

.btn-scan-main:disabled, .btn-scan-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

/* Feature Pills */
.feature-pill {
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.2);
    color: var(--neon-green);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.danger-pill {
    background: rgba(255,51,102,0.08);
    border-color: rgba(255,51,102,0.3);
    color: var(--neon-red);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute; bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center;
    animation: scrollBounce 2s infinite;
}

.scroll-dot {
    width: 6px; height: 6px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-green);
}

@keyframes scrollBounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(10px); } }

/* ===== Section Backgrounds ===== */
.section-dark {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-mid {
    background: var(--bg-primary);
}

/* Section Titles */
.section-title { font-family: var(--font-heading); font-weight: 900; }

.title-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neon-green);
    letter-spacing: 0.3em;
    background: rgba(0,255,136,0.1);
    border: 1px solid rgba(0,255,136,0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

/* Page Headers */
.page-header { padding-top: calc(var(--nav-height) + 1rem); }
.page-title { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 900; }

/* ===== Cards ===== */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,212,255,0.1);
}

/* Step Cards */
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.step-card:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 30px rgba(0,255,136,0.1);
    transform: translateY(-4px);
}

.step-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-green);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.step-icon {
    width: 64px; height: 64px;
    background: rgba(0,255,136,0.1);
    border: 1px solid rgba(0,255,136,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: var(--neon-green);
    margin: 0 auto 1rem;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    border-color: rgba(0,212,255,0.4);
    box-shadow: 0 8px 30px rgba(0,212,255,0.1);
    transform: translateY(-3px);
}

.feature-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin-bottom: 1rem;
}

.feature-icon.cyan  { background: rgba(0,212,255,0.1); color: var(--neon-cyan); border: 1px solid rgba(0,212,255,0.3); }
.feature-icon.green { background: rgba(0,255,136,0.1); color: var(--neon-green); border: 1px solid rgba(0,255,136,0.3); }
.feature-icon.purple{ background: rgba(168,85,247,0.1); color: var(--neon-purple); border: 1px solid rgba(168,85,247,0.3); }

/* ===== Upload / Drop Zone ===== */
.quick-scan-card, .upload-dropzone {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.quick-scan-card { padding: 2rem; }

/* drop-zone = home page quick scan container */
.drop-zone {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    min-height: 200px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.02);
    border: 2px dashed var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone.drag-over {
    border-color: var(--neon-green);
    background: rgba(0,255,136,0.05);
}

.upload-dropzone {
    padding: 3rem 2rem;
    min-height: 280px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}

.upload-dropzone.drag-over {
    border-color: var(--neon-green);
    background: rgba(0,255,136,0.05);
    box-shadow: 0 0 40px rgba(0,255,136,0.15), inset 0 0 40px rgba(0,255,136,0.03);
}

.upload-dropzone:hover {
    border-color: rgba(0,255,136,0.4);
    background: rgba(0,255,136,0.02);
}

.file-input {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    width: 100%; height: 100%;
}

.drop-content, .upload-idle { text-align: center; pointer-events: none; }

.drop-icon, .upload-icon-wrap {
    font-size: 3rem;
    color: var(--neon-cyan);
    position: relative; display: inline-block;
}

.upload-pulse {
    position: absolute; inset: -10px;
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

.upload-formats {
    display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap;
}

.upload-formats span {
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.2);
    color: var(--neon-cyan);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.supported-formats {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Preview */
.drop-preview, .upload-preview {
    width: 100%; height: 100%;
    position: relative;
}

.drop-preview img, .preview-image {
    max-width: 100%; max-height: 300px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.preview-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: var(--transition);
}

.drop-preview:hover .preview-overlay { opacity: 1; }

.file-info-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.file-icon {
    width: 40px; height: 40px;
    background: rgba(0,212,255,0.1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--neon-cyan); font-size: 1.2rem;
}

.file-name { font-weight: 600; font-size: 0.95rem; }
.file-size { font-size: 0.8rem; font-family: var(--font-mono); }

/* Options */
.option-label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.1em; }

.option-chip {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: not-allowed;
    display: flex; align-items: center; gap: 0.3rem;
}

.option-chip.active {
    border-color: rgba(0,255,136,0.3);
    color: var(--neon-green);
    background: rgba(0,255,136,0.08);
}

.option-chip input { display: none; }

/* Tips Card */
.tips-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
}

.tips-title { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 0.75rem; }

.tips-list { list-style: none; padding: 0; }
.tips-list li { padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-secondary); }

.tips-divider { height: 1px; background: var(--glass-border); margin: 1rem 0; }

.identify-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.identify-tags span {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== Scanner Page ===== */
.scanner-page { background: #000; }
.scanner-page .tuarai-nav { background: rgba(0,0,0,0.95); }

.scanner-container {
    height: 100vh;
    width: 100%;
    position: fixed; inset: 0;
    overflow: hidden;
    display: flex; flex-direction: column;
}

.viewfinder-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.camera-feed {
    width: 100%; height: 100%;
    object-fit: cover;
    background: #000;
}

/* Scanner Overlay */
.scanner-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 30px; height: 30px;
    border-color: var(--neon-green);
    border-style: solid;
}

.corner-tl { top: 15%; left: 10%; border-width: 3px 0 0 3px; }
.corner-tr { top: 15%; right: 10%; border-width: 3px 3px 0 0; }
.corner-bl { bottom: 25%; left: 10%; border-width: 0 0 3px 3px; }
.corner-br { bottom: 25%; right: 10%; border-width: 0 3px 3px 0; }

.scan-line {
    position: absolute;
    left: 10%; right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
    box-shadow: 0 0 10px var(--neon-green);
    animation: scanDown 2.5s ease-in-out infinite;
    top: 15%;
}

@keyframes scanDown {
    0%   { top: 15%; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 75%; opacity: 0; }
}

.reticle {
    position: absolute;
    display: flex; align-items: center; justify-content: center;
}

.reticle-ring {
    width: 60px; height: 60px;
    border: 1px solid rgba(0,255,136,0.4);
    border-radius: 50%;
    animation: reticlePulse 2s ease-in-out infinite;
}

.reticle-dot {
    position: absolute;
    width: 6px; height: 6px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
}

@keyframes reticlePulse { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.3); opacity: 1; } }

.scanner-status {
    position: absolute;
    bottom: 30%; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    border: 1px solid var(--border-color);
    color: var(--neon-green);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Camera Error */
.camera-error {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-primary);
    text-align: center;
    padding: 2rem;
}

/* Scanner Controls */
.scanner-controls {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex; align-items: center;
    justify-content: center; gap: 2rem;
    padding: 0 1rem;
    z-index: 100;
}

.camera-mode-group {
    display: flex; gap: 0.5rem;
}

.mode-btn {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition);
    font-size: 1rem;
}

.mode-btn:hover, .mode-btn.active {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0,255,136,0.1);
}

.capture-btn {
    background: none; border: none; cursor: pointer;
    transition: var(--transition);
}

.capture-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.capture-outer {
    width: 72px; height: 72px;
    border: 3px solid var(--neon-green);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(0,255,136,0.3);
}

.capture-inner {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #000; font-size: 1.5rem;
}

.capture-btn:hover:not(:disabled) .capture-outer {
    box-shadow: 0 0 40px rgba(0,255,136,0.6);
    transform: scale(1.05);
}

/* AI Processing */
.ai-processing {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
}

.processing-content { text-align: center; }

.ai-rings { position: relative; width: 120px; height: 120px; margin: 0 auto; }

.ai-ring {
    position: absolute; border: 2px solid transparent;
    border-radius: 50%;
    animation: ringRotate linear infinite;
}

.ai-ring.r1 { inset: 0; border-top-color: var(--neon-green); animation-duration: 1.5s; }
.ai-ring.r2 { inset: 15px; border-top-color: var(--neon-cyan); animation-duration: 2s; animation-direction: reverse; }
.ai-ring.r3 { inset: 30px; border-top-color: var(--neon-purple); animation-duration: 2.5s; }

.ai-center-dot {
    position: absolute; inset: 50px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--neon-green);
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes ringRotate { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
@keyframes dotPulse { 0%,100% { transform: scale(0.8); } 50% { transform: scale(1.2); } }

.processing-steps { text-align: left; margin-top: 1rem; }

.p-step {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    padding: 0.2rem 0;
    transition: var(--transition);
}

.p-step.active { color: var(--neon-green); }
.p-step.done { color: var(--neon-cyan); }

/* Quick Result Panel */
.quick-result-panel {
    position: fixed;
    bottom: 120px; left: 50%;
    transform: translateX(-50%);
    width: min(90%, 400px);
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid var(--neon-green);
    border-radius: var(--radius);
    padding: 1rem;
    z-index: 150;
    box-shadow: 0 0 40px rgba(0,255,136,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp { from { transform: translateX(-50%) translateY(20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

.qr-header { display: flex; align-items: center; gap: 0.75rem; }
.qr-emoji { font-size: 2rem; }
.qr-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.qr-category { color: var(--neon-cyan); font-size: 0.8rem; }
.qr-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; }

.qr-confidence { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.conf-bar-wrap { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.conf-bar { height: 100%; background: var(--neon-green); border-radius: 2px; transition: width 0.5s ease; }

.danger-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 600;
    background: rgba(0,255,136,0.1);
    border: 1px solid rgba(0,255,136,0.3);
    color: var(--neon-green);
}

.qr-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* Demo Banner */
.demo-banner {
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--neon-purple);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
}

.demo-banner-sm {
    position: fixed;
    top: calc(var(--nav-height) + 0.5rem);
    right: 1rem;
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--neon-purple);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    z-index: 50;
}

/* ===== Result Page ===== */
.result-image-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky; top: calc(var(--nav-height) + 1rem);
}

.result-image-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.result-image {
    width: 100%; max-height: 400px;
    object-fit: cover; display: block;
    border-radius: var(--radius);
}

.result-image-placeholder {
    aspect-ratio: 4/3;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.placeholder-emoji { font-size: 5rem; }

.result-scan-effect {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,255,136,0.05) 50%, transparent 60%);
    animation: resultScan 3s ease-in-out infinite;
}

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

.img-corner {
    position: absolute; width: 20px; height: 20px;
    border-color: var(--neon-green); border-style: solid;
}

.img-corner.tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.img-corner.tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.img-corner.bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.img-corner.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

/* Confidence */
.conf-track {
    height: 8px; background: rgba(255,255,255,0.1);
    border-radius: 4px; overflow: hidden;
}

.conf-fill {
    height: 100%; border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--neon-green);
}

.conf-fill.high { background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan)); }
.conf-fill.medium { background: var(--neon-yellow); }
.conf-fill.low { background: var(--neon-red); }

.conf-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; }

/* Result Header */
.result-header-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex; align-items: flex-start; gap: 1rem;
}

.result-emoji { font-size: 3.5rem; line-height: 1; }
.result-name-en { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 900; color: var(--text-primary); margin: 0; }
.result-name-th { font-family: var(--font-body); font-size: 1.2rem; color: var(--neon-cyan); margin: 0.25rem 0 0; font-weight: 600; }

.meta-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.category-badge {
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.3);
    color: var(--neon-cyan);
}

.scientific-badge {
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--neon-purple);
    font-style: italic;
}

/* Danger Card */
.danger-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid;
}

.danger-safe   { background: rgba(0,255,136,0.05); border-color: rgba(0,255,136,0.3); }
.danger-medium { background: rgba(255,136,0,0.05); border-color: rgba(255,136,0,0.3); }
.danger-high   { background: rgba(255,51,102,0.05); border-color: rgba(255,51,102,0.4); animation: dangerPulse 2s ease-in-out infinite; }

@keyframes dangerPulse { 0%,100% { box-shadow: 0 0 0 rgba(255,51,102,0); } 50% { box-shadow: 0 0 20px rgba(255,51,102,0.3); } }

.danger-header { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; justify-content: space-between; }
.danger-level-badge { font-family: var(--font-mono); font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: rgba(0,0,0,0.3); }

.danger-scale { display: flex; gap: 0.4rem; margin: 0.75rem 0; }
.danger-dot { width: 20px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; transition: var(--transition); }
.danger-dot.active { background: var(--neon-green); }

.danger-safe .danger-dot.active { background: var(--neon-green); }
.danger-medium .danger-dot.active { background: var(--neon-orange); }
.danger-high .danger-dot.active { background: var(--neon-red); box-shadow: 0 0 8px var(--neon-red); }

.danger-label-th { font-weight: 700; font-size: 1rem; }
.danger-warning { font-size: 0.85rem; color: var(--neon-red); }

/* Info Cards */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.info-card-title { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.description-text { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; }
.description-en { font-size: 0.85rem; line-height: 1.6; }

/* Suggestions */
.suggestions-list { list-style: none; padding: 0; }
.suggestion-item { padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-secondary); border-bottom: 1px solid var(--glass-border); }
.suggestion-item:last-child { border-bottom: none; }

/* Tags */
.tags-title { font-size: 0.8rem; letter-spacing: 0.1em; }
.tag-chip {
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.2);
    color: var(--neon-green);
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* Labels Chart */
.labels-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.label-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.label-name { width: 130px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.label-bar-fill { height: 100%; background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan)); border-radius: 3px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.label-score { width: 36px; text-align: right; font-family: var(--font-mono); color: var(--neon-green); }

/* ===== History Page ===== */
.stat-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.stat-mini-value { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 900; }
.stat-mini-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Filter Bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.filter-search { position: relative; }
.filter-search i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.filter-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-input:focus {
    outline: none;
    border-color: rgba(0,255,136,0.3);
    background: rgba(0,255,136,0.03);
}

.filter-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus { outline: none; border-color: rgba(0,255,136,0.3); }
.filter-select option { background: var(--bg-secondary); }

/* Scan History Items */
.scan-history-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.scan-history-item:hover {
    border-color: rgba(0,212,255,0.3);
    box-shadow: 0 4px 20px rgba(0,212,255,0.08);
}

.shi-image {
    width: 64px; height: 64px;
    border-radius: 8px; overflow: hidden;
    flex-shrink: 0; background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
}

.shi-img { width: 100%; height: 100%; object-fit: cover; }
.shi-emoji { font-size: 2rem; }
.shi-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.shi-name { font-weight: 700; font-size: 1rem; }
.shi-name-th { font-size: 0.85rem; }
.shi-time { font-size: 0.8rem; font-family: var(--font-mono); }
.shi-desc { font-size: 0.82rem; line-height: 1.5; }
.shi-emoji-badge { font-size: 1.1rem; margin-right: 0.3rem; }

.conf-badge {
    background: rgba(0,255,136,0.1);
    border: 1px solid rgba(0,255,136,0.3);
    color: var(--neon-green);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.danger-mini-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.danger-level-0, .danger-level-1 {
    background: rgba(0,255,136,0.1);
    border: 1px solid rgba(0,255,136,0.3);
    color: var(--neon-green);
}

.danger-level-2, .danger-level-3 {
    background: rgba(255,136,0,0.1);
    border: 1px solid rgba(255,136,0,0.3);
    color: var(--neon-orange);
}

.danger-level-4, .danger-level-5 {
    background: rgba(255,51,102,0.1);
    border: 1px solid rgba(255,51,102,0.3);
    color: var(--neon-red);
}

/* Empty State */
.empty-state { padding: 4rem 2rem; }
.empty-icon { opacity: 0.3; }

/* ===== Dashboard ===== */
.big-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.big-stat-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }

.bsc-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; margin: 0 auto 0.75rem;
}

.bsc-icon.cyan   { background: rgba(0,212,255,0.1); color: var(--neon-cyan); }
.bsc-icon.green  { background: rgba(0,255,136,0.1); color: var(--neon-green); }
.bsc-icon.red    { background: rgba(255,51,102,0.1); color: var(--neon-red); }
.bsc-icon.purple { background: rgba(168,85,247,0.1); color: var(--neon-purple); }

.bsc-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 900; }
.bsc-label { font-size: 0.85rem; font-weight: 600; margin-top: 0.25rem; }
.bsc-sub { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
}

.dc-title { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 1rem; }

.category-bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.cat-label { width: 100px; font-size: 0.85rem; color: var(--text-secondary); }
.cat-track { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.cat-fill { height: 100%; background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan)); border-radius: 4px; transition: width 0.8s ease; }
.cat-count { width: 30px; text-align: right; font-family: var(--font-mono); font-size: 0.85rem; color: var(--neon-green); }

.recent-scan-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--glass-border); }
.recent-scan-row:last-child { border-bottom: none; }
.rsr-emoji { font-size: 1.5rem; }
.rsr-name { font-weight: 600; font-size: 0.9rem; }
.rsr-conf { font-family: var(--font-mono); font-weight: 700; }

.empty-chart { text-align: center; padding: 2rem; }

.danger-dashboard-card { border-color: rgba(255,51,102,0.2); }
.danger-scan-card { background: rgba(255,51,102,0.05); border: 1px solid rgba(255,51,102,0.2); border-radius: var(--radius); padding: 0.75rem; }
.dsc-header { display: flex; align-items: center; gap: 0.5rem; }
.dsc-emoji { font-size: 1.5rem; }
.dsc-name { font-weight: 600; font-size: 0.9rem; }
.danger-dot-badge { font-size: 0.75rem; color: var(--neon-red); }

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
}

.tech-card:hover { border-color: rgba(0,212,255,0.3); transform: translateY(-2px); }
.tech-name { font-family: var(--font-heading); font-size: 0.85rem; font-weight: 700; }
.tech-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ===== About Page ===== */
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
}

.about-card:hover { border-color: rgba(0,212,255,0.3); }
.about-icon { font-size: 2rem; }
.about-list { list-style: none; padding: 0; }
.about-list li { padding: 0.35rem 0; font-size: 0.9rem; }

/* Architecture Flow */
.architecture-section { padding: 0; }

.architecture-flow {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.arch-step { text-align: center; }
.arch-icon {
    width: 56px; height: 56px;
    background: rgba(0,255,136,0.1);
    border: 1px solid rgba(0,255,136,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--neon-green);
    margin: 0 auto 0.5rem;
}

.arch-label { font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700; }
.arch-sub { font-size: 0.7rem; color: var(--text-muted); }
.arch-arrow { color: var(--neon-cyan); font-size: 1rem; opacity: 0.6; }

/* Tech Details */
.tech-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.tech-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.tech-table td { padding: 0.4rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--glass-border); }
.tech-table td:first-child { color: var(--text-muted); width: 50%; }

/* Java Classes */
.class-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: var(--transition);
}

.class-card:hover { border-color: rgba(0,255,136,0.3); transform: translateY(-2px); }
.class-type {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.3rem;
}

/* OOP Cards */
.oop-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.oop-card:hover { border-color: rgba(168,85,247,0.3); transform: translateY(-2px); }

/* Developer Card */
.developer-card {
    background: var(--bg-card);
    border: 1px solid rgba(0,255,136,0.25);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: 0 0 40px rgba(0,255,136,0.06);
    transition: var(--transition);
}

.developer-card:hover {
    border-color: rgba(0,255,136,0.5);
    box-shadow: 0 0 60px rgba(0,255,136,0.12);
}

.dev-avatar {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,212,255,0.2));
    border: 2px solid rgba(0,255,136,0.4);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--neon-green);
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(0,255,136,0.2);
}

.dev-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: 0.05em;
}

.dev-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.id-badge {
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.3);
    color: var(--neon-cyan);
}

.subject-badge {
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--neon-purple);
}

.dev-desc { font-size: 0.9rem; line-height: 1.7; }

@media (max-width: 576px) {
    .developer-card { flex-direction: column; align-items: center; text-align: center; }
}

/* About Footer */
.about-footer { padding: 3rem; }
.af-badges { flex-wrap: wrap; }
.af-badge {
    background: rgba(0,255,136,0.08);
    border: 1px solid rgba(0,255,136,0.2);
    color: var(--neon-green);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* ===== History Thumbnail ===== */
.history-thumb-link { text-decoration: none; }
.history-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    aspect-ratio: 1;
    position: relative;
    transition: var(--transition);
}

.history-thumb:hover { border-color: var(--neon-green); transform: scale(1.03); }

.thumb-img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }

.thumb-info {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.8);
    padding: 0.3rem 0.5rem;
    display: flex; justify-content: space-between; align-items: center;
}

.thumb-name { font-size: 0.7rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.thumb-conf { font-size: 0.65rem; font-family: var(--font-mono); color: var(--neon-green); }

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.loading-content { text-align: center; }
.loading-progress { height: 2px; width: 200px; background: rgba(255,255,255,0.1); border-radius: 1px; overflow: hidden; margin: 0 auto; }
.progress-bar-cyber { height: 100%; background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan)); border-radius: 1px; animation: loadBar 2s ease-in-out infinite; }
@keyframes loadBar { 0% { width: 0; margin-left: 0; } 50% { width: 80%; margin-left: 10%; } 100% { width: 0; margin-left: 100%; } }

/* ===== Footer ===== */
.tuarai-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-brand { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }

/* Footer Developer Card */
.footer-dev {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,255,136,0.05);
    border: 1px solid rgba(0,255,136,0.15);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    text-align: left;
}

.footer-dev-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, rgba(0,255,136,0.2), rgba(0,212,255,0.2));
    border: 1px solid rgba(0,255,136,0.4);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--neon-green);
    font-size: 1rem;
    flex-shrink: 0;
}

.footer-dev-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

.footer-dev-id {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    margin-top: 0.1rem;
}

.footer-dev-subject {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.footer-subject-badge {
    display: inline-block;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--neon-purple);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.3rem;
    vertical-align: middle;
}

/* ===== Error Card ===== */
.error-card {
    background: rgba(255,51,102,0.05);
    border: 1px solid rgba(255,51,102,0.2);
    border-radius: var(--radius-lg);
    padding: 3rem;
}

/* ===== Grid Overlay ===== */
.grid-overlay {
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(0,255,136,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,136,0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 5;
}

/* ===== Utility ===== */
.fw-black { font-weight: 900; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .result-header-card { flex-direction: column; }
    .result-emoji { font-size: 2.5rem; }
    .result-name-en { font-size: 1.8rem; }

    .architecture-flow { gap: 0.25rem; }
    .arch-arrow { transform: rotate(90deg); }

    .scanner-controls { gap: 1rem; }

    .quick-result-panel { width: 95%; }

    .shi-info { min-width: 0; }
    .shi-header { flex-direction: column; gap: 0.25rem; }

    .hero-actions { flex-direction: column; align-items: center; }
    .btn-hero, .btn-outline-hero { width: 100%; max-width: 280px; justify-content: center; }
}

@media (max-width: 576px) {
    .corner-tl, .corner-bl { left: 5%; }
    .corner-tr, .corner-br { right: 5%; }
    .scan-line { left: 5%; right: 5%; }
}
