/* Modern Dark Theme with Vibrant Colors */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Blue/Cyan Theme - Starnet Style */
    --bg-dark: #e6f2ff;
    --bg-light: #f0f8ff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5fbff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #dbeafe;
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #34d399;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fbbf24;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #f87171;
    --danger-bg: #fee2e2;
    --info: #06b6d4;
    --info-hover: #0891b2;
    --info-light: #22d3ee;
    --cyan: #06b6d4;
    --cyan-light: #67e8f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --gradient-start: #3b82f6;
    --gradient-end: #06b6d4;
    --shadow: rgba(37, 99, 235, 0.1);
    --shadow-lg: rgba(37, 99, 235, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e6f2ff 0%, #dbeafe 50%, #bfdbfe 100%);
    color: var(--text-primary);
    min-height: 100vh;
    max-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    overflow: hidden;
}

/* Hero Section with Robots */
.hero-section {
    margin-bottom: 20px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--shadow), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.robots-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.robot-wrapper {
    flex-shrink: 0;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.robot-wrapper.robot-a {
    animation-delay: 0s;
}

.robot-wrapper.robot-i {
    animation-delay: 1.5s;
}

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

.robot-image {
    width: 120px;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(37, 99, 235, 0.3));
    transition: transform 0.3s ease;
}

.robot-image:hover {
    transform: scale(1.05);
}

.robot-placeholder {
    width: 120px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.robot-svg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
    color: white;
    font-size: 48px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px var(--shadow-lg);
    border: 4px solid white;
}

.hero-content {
    flex: 1;
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.6;
}

/* Header */
.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Icon animations in buttons */
.btn, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

/* Ensure text is always visible in secondary buttons */
.btn-secondary {
    color: #1e40af !important;
    font-weight: 700 !important;
}

.btn-secondary:hover {
    color: #1e3a8a !important;
}

.btn:hover {
    animation: iconSpin 0.6s ease;
}

@keyframes iconSpin {
    0%, 100% {
        transform: translateY(-3px) scale(1.02) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) scale(1.02) rotate(-5deg);
    }
    75% {
        transform: translateY(-3px) scale(1.02) rotate(5deg);
    }
}

/* Tech-style scan line effect */
.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    transition: left 0.5s;
}

.btn-secondary:hover::after {
    left: 100%;
    animation: scanLine 1.5s ease-in-out infinite;
}

@keyframes scanLine {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Buttons - Tech Style */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
    color: white;
    box-shadow: 
        0 4px 15px rgba(37, 99, 235, 0.4),
        0 0 20px rgba(6, 182, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover::after {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(37, 99, 235, 0.6),
        0 0 30px rgba(6, 182, 212, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #22d3ee 100%);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 15px rgba(37, 99, 235, 0.4),
        0 0 20px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border: 2px solid var(--primary);
    color: #1e40af;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 4px 15px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(6, 182, 212, 0.1) 100%);
    transition: width 0.4s;
    z-index: 0;
}

.btn-secondary:hover::before {
    width: 100%;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: var(--cyan);
    color: #1e3a8a;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 6px 20px rgba(37, 99, 235, 0.3),
        0 0 25px rgba(6, 182, 212, 0.2);
    transform: translateY(-2px);
}

.btn-secondary > * {
    position: relative;
    z-index: 1;
    color: inherit;
}

/* Filter Section */
.filter-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.filter-label {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.filter-btn > * {
    position: relative;
    z-index: 2;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0;
}

.filter-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    z-index: 1;
}

.filter-btn:hover::after {
    width: 200%;
    height: 200%;
}

.filter-btn:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(37, 99, 235, 0.3),
        0 0 25px rgba(6, 182, 212, 0.2);
    color: var(--primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    border-color: #1e40af;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(30, 64, 175, 0.4),
        0 0 20px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.02);
}

.filter-btn.active::before {
    opacity: 0;
}

.filter-btn.active::after {
    display: none;
}


.filter-btn > * {
    position: relative;
    z-index: 2;
}

/* ===== Racing Cockpit Gauges ===== */
.filter-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-lights {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.25);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.35), 0 0 16px rgba(148, 163, 184, 0.12);
    position: relative;
}

.light::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.05));
    opacity: 0.35;
}

.light-ok { background: rgba(16,185,129,0.55); box-shadow: 0 0 0 2px rgba(0,0,0,0.35), 0 0 18px rgba(16,185,129,0.35); }
.light-warn { background: rgba(245,158,11,0.55); box-shadow: 0 0 0 2px rgba(0,0,0,0.35), 0 0 18px rgba(245,158,11,0.35); }
.light-err { background: rgba(239,68,68,0.55); box-shadow: 0 0 0 2px rgba(0,0,0,0.35), 0 0 18px rgba(239,68,68,0.35); }

.cockpit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 22px;
    flex-shrink: 0;
}

.gauge-card {
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
    border-radius: 18px;
    padding: 22px 24px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.gauge-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 55%);
    pointer-events: none;
}

.gauge-card:hover {
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}

.gauge-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.gauge-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.gauge-sub {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.gauge-body {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 18px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.circular-gauge {
    --p: 0; /* 0..1 */
    --gauge: var(--primary);
    width: 170px;
    height: 170px;
    border-radius: 50%;
    position: relative;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

/* Outer ring with ticks */
.circular-gauge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        /* ticks */
        repeating-conic-gradient(from 220deg,
            rgba(255,255,255,0.14) 0 2deg,
            rgba(255,255,255,0.02) 2deg 10deg),
        /* progress */
        conic-gradient(from 220deg,
            var(--gauge) calc(var(--p) * 280deg),
            var(--ring-bg) 0);
    -webkit-mask: radial-gradient(circle, transparent 62px, #000 63px);
    mask: radial-gradient(circle, transparent 62px, #000 63px);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.06),
        0 0 26px rgba(99,102,241,0.18);
}

/* inner glossy panel */
.circular-gauge::after {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 35%, rgba(0,0,0,0.4) 75%),
        linear-gradient(135deg, rgba(2,6,23,0.65) 0%, rgba(15,23,42,0.55) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 10px 26px rgba(0,0,0,0.55);
}

.circular-inner {
    position: relative;
    z-index: 2;
    text-align: center;
}

.circular-value {
    font-size: 46px;
    font-weight: 950;
    letter-spacing: -0.8px;
    font-variant-numeric: tabular-nums;
    text-shadow:
        0 0 22px rgba(99, 102, 241, 0.28),
        0 2px 8px rgba(0, 0, 0, 0.65);
}

.circular-unit {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gauge-note {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(99,102,241,0.18);
    border: 1px solid rgba(99,102,241,0.25);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 12px;
}

.pill.warn {
    background: rgba(245,158,11,0.16);
    border-color: rgba(245,158,11,0.28);
}

/* Color-glow binding */
#speedGauge { --gauge: var(--primary); }
#errorRateGauge { --gauge: var(--danger); }

@media (max-width: 1024px) {
    .cockpit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .gauge-body { grid-template-columns: 1fr; }
    .circular-gauge { margin: 0 auto; }
    .gauge-note { text-align: center; }
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px var(--shadow), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--cyan) 100%);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px var(--shadow-lg), 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Odometer Style - หน้าปัดเลขไมล์ */
.odometer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid rgba(37, 99, 235, 0.3);
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(37, 99, 235, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.odometer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
    pointer-events: none;
}

.odometer-container.success {
    background: linear-gradient(135deg, var(--success-bg) 0%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(16, 185, 129, 0.2);
}

.odometer-container.danger {
    background: linear-gradient(135deg, var(--danger-bg) 0%, #fee2e2 100%);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(239, 68, 68, 0.2);
}

.odometer-container.warning {
    background: linear-gradient(135deg, var(--warning-bg) 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(245, 158, 11, 0.2);
}

.odometer-digit {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 56px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 
        0 0 10px rgba(37, 99, 235, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
    position: relative;
    display: inline-block;
    min-width: 0.6em;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
    padding: 8px 4px;
    border-radius: 6px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.odometer-container.success .odometer-digit {
    text-shadow: 
        0 0 10px rgba(16, 185, 129, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    color: #10b981;
}

.odometer-container.danger .odometer-digit {
    text-shadow: 
        0 0 10px rgba(239, 68, 68, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    color: #ef4444;
}

.odometer-container.warning .odometer-digit {
    text-shadow: 
        0 0 10px rgba(245, 158, 11, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    color: #f59e0b;
}

/* Odometer Animation - หมุนเหมือนหน้าปัด */
.odometer-digit.rolling {
    animation: odometerRoll 0.3s ease-in-out infinite;
}

@keyframes odometerRoll {
    0% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
    25% {
        transform: translateY(-8px) scaleY(0.8);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-12px) scaleY(0.6);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-8px) scaleY(0.8);
        opacity: 0.6;
    }
    100% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
}

/* Glow effect when rolling */
.odometer-container .odometer-digit.rolling {
    box-shadow: 
        0 0 15px currentColor,
        0 0 30px currentColor,
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Responsive Odometer */
@media (max-width: 768px) {
    .odometer-container {
        padding: 16px;
        min-height: 70px;
    }
    
    .odometer-digit {
        font-size: 42px;
        padding: 6px 3px;
    }
}

@media (max-width: 480px) {
    .odometer-container {
        padding: 12px;
        min-height: 60px;
    }
    
    .odometer-digit {
        font-size: 36px;
        padding: 4px 2px;
    }
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chart-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px var(--shadow), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chart-card:hover {
    box-shadow: 0 8px 32px var(--shadow-lg), 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.chart-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

#dailyChart {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
}

/* Activity List */
.activity-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
    -webkit-overflow-scrolling: touch;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    cursor: pointer;
}

.activity-item:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px var(--shadow);
}

.activity-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.activity-info {
    flex: 1;
}

.activity-file-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-time {
    font-size: 13px;
    color: var(--text-muted);
}

.activity-loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(37, 99, 235, 0.3);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px var(--shadow-lg), 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close {
    color: var(--text-secondary);
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close:hover {
    color: var(--danger);
    background: var(--bg-card-hover);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 30px;
    overflow-y: auto;
    flex: 1;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #e0f2fe 100%);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover {
    background: var(--primary-bg);
    transform: scale(1.01);
}

.data-table tbody tr:hover td {
    color: var(--primary);
}

/* View Buttons in Table */
.btn-view {
    padding: 6px 12px;
    margin: 2px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.btn-view:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
    border-radius: 10px;
    border: 2px solid var(--bg-light);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--info-hover) 100%);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 0 10px;
        height: calc(100vh - 30px);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
        max-height: 100vh;
        overflow: hidden;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
        height: calc(100vh - 20px);
    }
    
    /* Hero Section */
    .hero-section {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .robots-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .robot-wrapper {
        order: 2;
    }
    
    .robot-wrapper.robot-a {
        order: 1;
    }
    
    .robot-wrapper.robot-i {
        order: 3;
    }
    
    .hero-content {
        order: 2;
    }
    
    .robot-image {
        width: 80px;
        max-height: 150px;
    }
    
    .robot-svg {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    /* Header */
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        border-radius: 12px;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* Filter Section */
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }
    
    .filter-label {
        font-size: 14px;
    }
    
    .filter-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .filter-btn {
        padding: 12px 16px;
        font-size: 13px;
        text-align: center;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .stat-header {
        margin-bottom: 12px;
    }
    
    .stat-icon {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    /* Charts Row */
    .charts-row {
        grid-template-columns: 1fr;
        gap: 16px;
        flex: 1;
        min-height: 0;
    }
    
    .chart-card {
        padding: 20px;
        border-radius: 12px;
        min-height: 0;
        flex: 1;
    }
    
    .chart-card h3 {
        font-size: 16px;
        margin-bottom: 16px;
        flex-shrink: 0;
    }
    
    #dailyChart {
        height: 100%;
        min-height: 200px;
        flex: 1;
    }
    
    /* Activity List */
    .activity-list {
        flex: 1;
        min-height: 200px;
    }
    
    .activity-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .activity-icon {
        font-size: 18px;
    }
    
    .activity-file-name {
        font-size: 14px;
    }
    
    .activity-time {
        font-size: 12px;
    }
    
    /* Modal - Mobile Full Screen */
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .close {
        font-size: 32px;
        width: 36px;
        height: 36px;
    }
    
    .modal-body {
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Data Table - Mobile Scrollable */
    .data-table {
        font-size: 12px;
        min-width: 600px; /* Force horizontal scroll */
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .data-table th {
        font-size: 11px;
    }
    
    /* Scrollbar for mobile */
    .modal-body::-webkit-scrollbar {
        height: 6px;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    body {
        padding: 8px;
        max-height: 100vh;
        overflow: hidden;
    }
    
    .container {
        height: calc(100vh - 16px);
    }
    
    .hero-section {
        padding: 15px;
    }
    
    .robots-container {
        gap: 15px;
    }
    
    .robot-image {
        width: 60px;
        max-height: 120px;
    }
    
    .robot-svg {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 12px;
    }
    
    .header {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .filter-section {
        padding: 12px;
    }
    
    .filter-buttons {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 32px;
    }
    
    .chart-card {
        padding: 16px;
    }
    
    #dailyChart {
        height: 200px;
    }
    
    .activity-list {
        max-height: 250px;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    .filter-btn {
        min-height: 44px;
    }
    
    .close {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .stat-card:hover {
        transform: none;
    }
    
    .activity-item:hover {
        transform: none;
    }
    
    /* Better tap feedback */
    .btn:active {
        transform: scale(0.98);
    }
    
    .filter-btn:active {
        transform: scale(0.98);
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
