/* ============================
   CSS Variables & Base Styles
   ============================ */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e1e32;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --neutral: #6b6b7b; /* New neutral color */
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================
   Header
   ============================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent-primary);
}

/* ============================
   Main Content
   ============================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.upload-section {
    width: 100%;
    max-width: 800px;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ============================
   Detection Selector
   ============================ */
.detection-selector {
    margin-bottom: 32px;
}

.detection-selector h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.detection-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .detection-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .detection-options {
        grid-template-columns: 1fr;
    }
}

.detection-option {
    position: relative;
    cursor: pointer;
}

.detection-option.disabled {
    cursor: not-allowed;
}

.detection-option input {
    position: absolute;
    opacity: 0;
}

.option-content {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.option-content i {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.option-title {
    font-weight: 600;
    font-size: 1rem;
}

.option-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detection-option:hover .option-content {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.detection-option.disabled:hover .option-content {
    border-color: var(--border-color);
    transform: none;
}

.detection-option.active .option-content,
.detection-option input:checked + .option-content {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.detection-option.active .option-content i,
.detection-option input:checked + .option-content i {
    color: var(--accent-primary);
}

/* ============================
   Dropzone
   ============================ */
.dropzone {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    height: 300px;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone.dragover {
    transform: scale(1.01);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dropzone-icon {
    font-size: 3.5rem;
    color: var(--accent-primary);
    opacity: 0.8;
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dropzone-or {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Browse Button - Matching Style */
.browse-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

/* Preview State - Fixed Size */
.preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    max-height: 220px;
    justify-content: center;
}

.preview video {
    width: auto;
    height: 140px;
    max-width: 280px;
    border-radius: var(--radius-md);
    background: #000;
    object-fit: contain;
}

.preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 320px;
    background: var(--bg-tertiary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    gap: 12px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.file-info > i {
    font-size: 1.3rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 0.85rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.remove-btn {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-btn:hover {
    background: var(--danger);
    color: white;
}

/* ============================
   Upload Card Container
   ============================ */
.upload-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.upload-card h2 {
    margin-bottom: 24px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* ============================
   Buttons
   ============================ */
.actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.btn {
    padding: 14px 36px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Run Inference Button - Matching Style */
.run-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    min-width: 180px;
}

.run-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.run-btn i {
    font-size: 1rem;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================
   Progress Section
   ============================ */
.progress-section {
    margin-top: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-title {
    font-weight: 600;
}

.progress-percent {
    color: var(--accent-primary);
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-status {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================
   Results Page
   ============================ */
.results-page .main-content {
    align-items: stretch;
}

.results-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.results-container {
    display: grid;
    gap: 32px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--accent-primary);
}

.detection-badge {
    background: var(--accent-gradient);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Video Section - Full Width */
.video-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.video-wrapper {
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}

.video-wrapper video {
    width: 100%;
    max-height: 600px;
    display: block;
    object-fit: contain;
}

/* Header actions container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Data Table Section - Below Timeline */
.data-table-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
}

.data-table-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.data-table-section .section-header h2 {
    font-size: 1.1rem;
    margin: 0;
}

.event-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.data-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

/* Grade A Tables Container */
#gradeATablesWrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gradea-table-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.gradea-table-section h3 {
    font-size: 1rem;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.gradea-table-section h3 i {
    font-size: 0.9rem;
    color: var(--accent);
}

.gradea-table-section .data-table-wrapper {
    max-height: 300px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
}

.data-table th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 0.8rem;
    vertical-align: middle;
}

.data-table th:first-child {
    width: 50px;
    text-align: center;
}

.data-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.data-table td:first-child {
    text-align: center;
    font-weight: 500;
    color: var(--text-primary);
}

/* Specific column alignments */
.data-table .timestamp-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.data-table .timestamp-cell:hover {
    color: var(--accent);
    text-decoration: underline;
}

.data-table .duration-cell {
    font-weight: 600;
    color: var(--success);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status indicators in table */
.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.7rem;
}

.status-indicator.status-good {
    background: var(--success);
    color: white;
}

.status-indicator.status-bad {
    background: var(--danger);
    color: white;
}

.status-indicator.status-neutral {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.status-indicator i {
    font-size: 0.75rem;
}

/* Duration cell styling */
.duration-cell {
    font-weight: 500;
    color: var(--accent-primary);
}

/* Timestamp cell - clickable */
.timestamp-cell {
    color: var(--info);
    cursor: pointer;
}

.timestamp-cell:hover {
    text-decoration: underline;
}

/* Empty placeholder cells */
.placeholder-cell {
    color: var(--text-muted);
    font-style: italic;
}

/* Type badges for Grade A table */
.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.type-door {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.type-badge.type-belt {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
}

.type-badge.type-glove {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* Text muted utility */
.text-muted {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Timeline */
.timeline-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline {
    position: relative;
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    padding: 10px 0;
}

#timelineTracksContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-track-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 15px;
}

.timeline-track-label {
    width: 80px;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.timeline-track {
    position: relative;
    flex-grow: 1;
    height: 30px;
}

.timeline-track-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    transform: translateY(-50%);
}

.timeline-progress {
    display: none; /* Hide the overall progress bar */
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: rgba(99, 102, 241, 0.2);
    transition: width 0.1s linear;
    z-index: 1;
}

.active-periods {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.active-period {
    position: absolute;
    top: 50%;
    height: 10px;
    transform: translateY(-50%);
    border-radius: 5px;
    opacity: 0.7;
}

.door-active { background-color: #ef4444; }
.belt-active { background-color: #00d9ff; }
.gloveport-active { background-color: #6366f1; }

.timeline-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.5);
}

.timeline-marker.inuse,
.timeline-marker.running,
.timeline-marker.open {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.timeline-marker.notinuse,
.timeline-marker.stopped,
.timeline-marker.closed {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* Grade A specific timeline markers */
.timeline-marker.door-open,
.timeline-marker.door-closed {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.timeline-marker.belt-running,
.timeline-marker.belt-stopped {
    background: #00d9ff;
    box-shadow: 0 0 10px #00d9ff;
}

.timeline-marker.glove-inuse,
.timeline-marker.glove-notinuse {
    background: #6366f1;
    box-shadow: 0 0 10px #6366f1;
}

.timeline-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--text-primary);
    pointer-events: none;
    display: none;
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.danger {
    background: var(--danger);
}

.legend-dot.success {
    background: var(--success);
}

/* Events Section */
.events-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.event-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.events-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.event-item:hover {
    background: var(--bg-primary);
    transform: translateX(4px);
}

.event-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.event-icon.active {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.event-icon.inactive {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.event-details {
    flex: 1;
}

.event-state {
    font-weight: 600;
    font-size: 0.95rem;
}

.event-port {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.event-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: monospace;
}

/* Charts Section */
.charts-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.chart-container {
    width: 100%;
    min-height: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Multiple charts wrapper for Grade A */
.chart-wrapper {
    margin-bottom: 32px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.chart-wrapper:last-child {
    margin-bottom: 0;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-title i {
    color: var(--accent-primary);
}

.chart-container img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

/* Plotly chart overrides for dark theme */
.chart-container .plotly-graph-div {
    width: 100% !important;
}

.chart-container .js-plotly-plot {
    width: 100% !important;
}

/* Stats Section */
.stats-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-state i,
.error-state i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.loading-state i {
    color: var(--accent-primary);
}

.error-state i {
    color: var(--danger);
}

.error-state h3 {
    margin-bottom: 12px;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ============================
   Footer
   ============================ */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
    .detection-options {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav {
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

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

.results-container > * {
    animation: slideUp 0.5s ease forwards;
}

.results-container > *:nth-child(2) { animation-delay: 0.1s; }
.results-container > *:nth-child(3) { animation-delay: 0.2s; }
.results-container > *:nth-child(4) { animation-delay: 0.3s; }
