/* SAM Labels Explorer - Dark Theme */

:root {
    /* Colors - Deep space inspired palette */
    --bg-primary: #0a0e14;
    --bg-secondary: #111820;
    --bg-tertiary: #1a2332;
    --bg-elevated: #212d40;
    --bg-hover: #2a3a50;
    
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --accent-primary: #58a6ff;
    --accent-secondary: #7ee787;
    --accent-warning: #f0883e;
    --accent-danger: #f85149;
    
    --approved-color: #7ee787;
    --pending-color: #f0883e;
    --prediction-color: #a371f7;
    
    --border-color: #21262d;
    --border-light: #30363d;
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --sidebar-width: 240px;
    --header-height: 64px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
    font-size: 24px;
    color: var(--accent-primary);
    animation: pulse 3s ease-in-out infinite;
}

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

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

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

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-item a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active a {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.db-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--approved-color);
    animation: pulse 2s ease-in-out infinite;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--accent-primary);
}

.breadcrumb-sep {
    color: var(--text-muted);
    margin: 0 4px;
}

.breadcrumb-current {
    color: var(--text-primary);
}

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

.content-body {
    flex: 1;
    padding: 32px;
    background: var(--bg-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #79b8ff;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-danger:hover {
    background: #ff6b6b;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
}

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

.stat-card.accent {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(88, 166, 255, 0.1));
}

.stat-icon {
    font-size: 28px;
    color: var(--accent-primary);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: -1px;
}

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

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.chart-card.wide {
    grid-column: span 1;
}

.chart-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Donut Chart */
.approval-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.donut-chart {
    position: relative;
    width: 160px;
    height: 160px;
}

.circular-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 3;
}

.circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.circle.approved {
    stroke: var(--approved-color);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-value {
    display: block;
    font-size: 28px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--approved-color);
}

.donut-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.approval-legend {
    width: 100%;
}

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

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

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

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

.legend-label {
    flex: 1;
    color: var(--text-secondary);
}

.legend-value {
    font-family: var(--font-mono);
    font-weight: 500;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 120px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #79b8ff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bar-value {
    width: 60px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Section Cards */
.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    overflow: hidden;
    min-width: 0;
}

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

.section-title {
    font-size: 16px;
    font-weight: 500;
}

.view-all-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Flight List */
.flight-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

.flight-icon {
    color: var(--accent-primary);
}

.flight-id {
    flex: 1;
    font-family: var(--font-mono);
}

.flight-arrow {
    color: var(--text-muted);
}

.flight-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.flight-date {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
    margin-right: 8px;
}

/* Browse Page */
.browse-container {
    max-width: 1400px;
}

.search-bar {
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.flight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.flight-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.flight-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.flight-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flight-card-icon {
    font-size: 20px;
    color: var(--accent-primary);
}

.flight-card-id {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}

.flight-card-arrow {
    color: var(--text-muted);
}

.flight-card-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.flight-card-date {
    color: var(--text-secondary);
}

.flight-card-stats {
    color: var(--accent-secondary);
}

.instance-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.flight-card-classes {
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
}

.search-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 16px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-bar.advanced {
    flex-direction: column;
    gap: 16px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex-wrap: wrap;
}

.filter-row.filter-actions {
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.filter-group.filter-search {
    flex: 1;
    min-width: 200px;
}

.filter-group.filter-search .search-input {
    width: 100%;
}

.filter-info {
    margin-left: auto;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group.size-filter,
.filter-group.confidence-filter {
    flex: 0 0 auto;
    min-width: 160px;
}

.filter-label {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--accent-primary);
}

.filter-range {
    width: 80px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    appearance: none;
    outline: none;
    cursor: pointer;
}

.filter-range::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.filter-range::-webkit-slider-thumb:hover {
    background: var(--accent-secondary);
}

.range-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 35px;
}

.filter-info {
    margin-left: auto;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.image-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.image-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.image-thumb-container {
    position: relative;
    padding-top: 75%;
    background: var(--bg-tertiary);
}

.image-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bbox-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: var(--pending-color);
    color: var(--bg-primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.bbox-badge.approved {
    background: var(--approved-color);
}

.image-card-info {
    padding: 12px;
}

.image-id {
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-classes {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding: 20px;
    flex-wrap: wrap;
}

.pagination-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
}

.page-btn {
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    font-family: var(--font-sans);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-btn-go {
    padding: 8px 12px;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 500;
}

.page-btn-go:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.page-info {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
}

.page-input {
    width: 70px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
}

.page-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Image Viewer */
.viewer-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 64px);
}

.viewer-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.image-viewer-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.image-viewer {
    flex: 1;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    transform-origin: center center;
    transition: transform 0.2s ease;
}

.image-container {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.viewer-image {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    display: block;
}

.bbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bbox-overlay rect {
    pointer-events: all;
    cursor: pointer;
}

.bbox-overlay rect:hover {
    stroke-width: 3;
}

.bbox-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.viewer-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    color: var(--text-muted);
    font-size: 12px;
}

.control-select {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.toggle-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    border-color: var(--accent-primary);
}

.zoom-level {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

/* Viewer Sidebar */
.viewer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.sidebar-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapse-icon {
    font-size: 10px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-primary);
}

.info-value.mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Annotations List */
.annotations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.annotation-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.annotation-card-empty {
    opacity: 0.5;
    background: var(--bg-secondary);
}

.annotation-card-empty:hover {
    opacity: 0.7;
}

.annotation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.class-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.class-name {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
}

.bbox-count {
    font-size: 11px;
    color: var(--text-muted);
}

.approval-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.approval-badge.approved {
    background: var(--approved-color);
    color: var(--bg-primary);
}

.approval-badge.pending {
    background: var(--pending-color);
    color: var(--bg-primary);
}

.annotation-meta {
    font-size: 11px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

/* Version Navigator */
.version-navigator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin: 8px 0;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.version-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.version-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.version-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.version-info {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.version-hint {
    font-size: 10px;
    color: var(--pending-color);
    font-style: italic;
}

.version-latest {
    font-size: 10px;
    color: var(--approved-color);
    font-weight: 600;
}

.meta-label {
    color: var(--text-muted);
}

.meta-value {
    color: var(--text-secondary);
}

/* Tooltip */
.bbox-tooltip {
    position: absolute;
    display: none;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Bbox Modal */
.bbox-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.bbox-modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.bbox-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.bbox-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.bbox-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.bbox-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.bbox-modal-body {
    padding: 24px;
}

.bbox-detail-section {
    margin-bottom: 24px;
}

.bbox-detail-section:last-child {
    margin-bottom: 0;
}

.bbox-detail-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bbox-detail-section p {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
    word-break: break-word;
}

.bbox-coords {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.coord-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.coord-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
}

.coord-value {
    color: var(--text-primary);
    font-weight: 500;
}

.coord-raw {
    color: var(--text-muted);
    font-size: 12px;
}

.review-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.review-badge.approved {
    background: var(--accent-secondary);
    color: var(--text-on-accent);
}

.review-badge.pending {
    background: var(--accent-warning);
    color: var(--text-on-accent);
}

/* Annotators Table */
.annotators-container {
    max-width: 1200px;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.stat-mini-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 24px;
    min-width: 160px;
}

.stat-mini-value {
    font-size: 24px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-mini-label {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th.sortable {
    cursor: pointer;
}

.data-table th.sortable:hover {
    color: var(--accent-primary);
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.data-table tr:hover td {
    background: var(--bg-tertiary);
}

.data-table .num {
    font-family: var(--font-mono);
    text-align: right;
}

.data-table .approved {
    color: var(--approved-color);
}

.data-table .pending {
    color: var(--pending-color);
}

.annotator-id {
    font-family: var(--font-mono);
    font-size: 13px;
}

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

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.approved {
    background: var(--approved-color);
}

/* Sparkline Chart */
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
    padding: 2px;
}

.sparkline-bar {
    flex: 1;
    min-width: 3px;
    max-width: 8px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
    transition: background var(--transition-fast);
    cursor: pointer;
    opacity: 0.7;
}

.sparkline-bar:hover {
    background: var(--accent-secondary);
    opacity: 1;
}

/* Annotator Timeline List */
.annotator-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.annotator-timeline-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

.annotator-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.annotator-name {
    font-weight: 500;
    color: var(--text-primary);
}

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

.annotator-timeline-item .sparkline {
    height: 32px;
    margin-top: 4px;
}

/* Search Page */
.search-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.search-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 32px);
}

.filter-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-elevated);
    transition: background var(--transition-fast);
}

.filter-section-header:hover {
    background: var(--bg-hover);
}

.filter-section-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.filter-section-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.filter-section-content {
    padding: 16px;
    background: var(--bg-tertiary);
}

.filter-section h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.filter-section .filter-group {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 16px;
}

.filter-section .filter-label {
    margin-bottom: 6px;
}

.filter-section .filter-select,
.filter-section .filter-input {
    width: 100%;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.filter-actions .btn {
    flex: 1;
}

.results-panel {
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.results-count span {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.result-card:hover {
    border-color: var(--accent-primary);
}

.result-thumb-container {
    position: relative;
    padding-top: 75%;
    background: var(--bg-tertiary);
}

.result-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    padding: 10px 12px;
}

.result-id {
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stats Panel */
.stats-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
}

.stats-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.stats-panel-header h3 {
    font-size: 14px;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-primary);
}

.stats-panel-body {
    padding: 20px;
}

.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-mini {
    text-align: center;
}

.stats-classes h4,
.stats-section h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.stats-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.annotator-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.annotator-item {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);
}

.date-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.date-label {
    color: var(--text-muted);
    font-weight: 500;
}

.date-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.no-data {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.class-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.class-count {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Loading States */
.loading-placeholder {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    opacity: 0.3;
}

.empty-text {
    font-size: 14px;
}

.error-state {
    padding: 40px;
    text-align: center;
    color: var(--accent-danger);
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* Sample Notice */
.sample-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.notice-icon {
    color: var(--accent-primary);
}

/* Filter Inline */
.filter-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Analytics Page */
.analytics-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 100%;
    overflow-x: hidden;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

.analytics-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    flex-wrap: wrap;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.analytics-card-header h3 {
    font-size: 14px;
    font-weight: 500;
}

.analytics-card-body {
    padding: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.map-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.map-stat {
    display: flex;
    flex-direction: column;
}

.map-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.map-stat-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--accent-primary);
}

.timeline-chart {
    height: 300px;
}

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

.camera-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.camera-icon {
    font-size: 20px;
}

.camera-id {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
}

.camera-flights {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Cameras Page Styles */
.cameras-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.camera-set-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.camera-set-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.camera-set-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.camera-set-header h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.camera-set-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.camera-heads {
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

.flight-count {
    color: var(--text-muted);
}

.flight-time {
    color: var(--accent-secondary);
    font-weight: 500;
}

/* Camera Sets Legend */
.camera-sets-legend {
    padding: 8px 0;
}

.camera-set-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.camera-set-legend-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.camera-set-legend-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.camera-set-flights {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.flight-link {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.flight-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.class-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.class-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.class-item-name {
    width: 100px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.class-item-bar {
    flex: 1;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.class-item-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.class-item-value {
    width: 60px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

/* Activity Heatmap - GitHub Style */
.activity-heatmap {
    overflow-x: auto;
    padding-bottom: 8px;
    width: 100%;
    max-width: 100%;
}

.heatmap-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: fit-content;
    width: max-content;
}

/* Month labels row */
.heatmap-months {
    display: flex;
    gap: 0;
    padding-left: 100px;
    margin-bottom: -8px;
    position: relative;
    height: 20px;
}

.heatmap-month-label {
    font-size: 11px;
    color: var(--text-muted);
    position: absolute;
    white-space: nowrap;
}

/* Each annotator's row */
.heatmap-annotator {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.heatmap-annotator-name {
    width: 90px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top: 4px;
}

/* Weeks container */
.heatmap-weeks {
    display: flex;
    gap: 3px;
}

/* Day labels column */
.heatmap-day-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 24px;
    flex-shrink: 0;
}

.heatmap-day-label {
    height: 13px;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* Week column (7 days) */
.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Individual cell */
.heatmap-cell {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
    z-index: 10;
    position: relative;
}

.heatmap-cell.empty {
    background: transparent;
    cursor: default;
}

.heatmap-cell.empty:hover {
    transform: none;
    outline: none;
}

/* Activity levels */
.heatmap-cell.level-0 { background: var(--bg-tertiary); }
.heatmap-cell.level-1 { background: rgba(126, 231, 135, 0.25); }
.heatmap-cell.level-2 { background: rgba(126, 231, 135, 0.45); }
.heatmap-cell.level-3 { background: rgba(126, 231, 135, 0.65); }
.heatmap-cell.level-4 { background: rgba(126, 231, 135, 0.85); }
.heatmap-cell.level-5 { background: rgb(126, 231, 135); }

.heatmap-cell.selected {
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
    z-index: 10;
    position: relative;
}

/* Tooltip */
.heatmap-tooltip {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 1000;
    pointer-events: none;
    display: none;
    transform: translate(-50%, -100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.heatmap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-primary);
}

/* Legend */
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding-left: 100px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .viewer-container {
        grid-template-columns: 1fr;
    }
    
    .viewer-sidebar {
        order: -1;
        max-height: 300px;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-right: 16px;
    flex-shrink: 0;
}

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

.menu-icon {
    display: block;
    line-height: 1;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

body.sidebar-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-overlay {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        grid-template-columns: 1fr;
    }
    
    .search-panel {
        position: static;
    }
}


/* Legacy index.html overrides (for backwards compatibility) */
body.legacy-view {
    background-color: var(--bg-primary);
}

body.legacy-view .app-container {
    display: block;
}

body.legacy-view .sidebar {
    display: none;
}

body.legacy-view .main-content {
    margin-left: 0;
}

/* =============================================================================
   QUIZ STYLES
   ============================================================================= */

.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Setup Panel */
.quiz-setup {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
}

.quiz-setup-header {
    text-align: center;
    margin-bottom: 32px;
}

.quiz-setup-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-setup-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0;
}

.quiz-setup-section {
    margin-bottom: 28px;
}

.quiz-setup-section h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

/* Mode Options */
.quiz-mode-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quiz-mode-option {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.quiz-mode-option input {
    display: none;
}

.quiz-mode-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.quiz-mode-option input:checked + .quiz-mode-label {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.quiz-mode-icon {
    font-size: 28px;
}

.quiz-mode-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Labels Panel */
.quiz-labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
}

.quiz-labels-toggle {
    color: var(--text-muted);
    font-size: 12px;
}

.quiz-labels-panel {
    margin-top: 12px;
}

.quiz-labels-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quiz-labels-count {
    color: var(--text-muted);
    font-size: 13px;
    margin-left: auto;
}

.quiz-labels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.quiz-label-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-label-checkbox:hover {
    border-color: var(--accent-primary);
}

.quiz-label-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.quiz-label-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.quiz-label-name {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.3;
}

.quiz-label-english {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
}

/* Start Button */
.quiz-start-btn {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-on-accent);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quiz-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--accent-primary-rgb), 0.3);
}

.quiz-start-icon {
    font-size: 20px;
}

/* Game Area */
.quiz-game {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stats Bar */
.quiz-stats-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.quiz-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quiz-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.quiz-settings-btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-settings-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* Question Area */
.quiz-question-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.quiz-image-container {
    margin-bottom: 24px;
}

.quiz-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.quiz-canvas {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.quiz-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-primary);
    color: var(--text-muted);
}

.quiz-image-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 4px;
}

.quiz-context-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.quiz-context-toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.quiz-source-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.quiz-source-badge.annotation {
    background: rgba(var(--accent-primary-rgb), 0.15);
    color: var(--accent-primary);
}

.quiz-source-badge.prediction {
    background: rgba(var(--accent-info-rgb, 78, 205, 196), 0.15);
    color: var(--accent-info, #4ECDC4);
}

/* Answer Choices */
.quiz-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quiz-choice-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quiz-choice-btn:hover:not(.disabled) {
    border-color: var(--choice-color, var(--accent-primary));
    background: rgba(var(--accent-primary-rgb), 0.05);
}

.quiz-choice-btn.disabled {
    cursor: default;
    opacity: 0.7;
}

.quiz-choice-btn.correct {
    border-color: var(--accent-secondary) !important;
    background: rgba(var(--accent-secondary-rgb, 46, 204, 113), 0.15) !important;
}

.quiz-choice-btn.wrong {
    border-color: var(--accent-danger) !important;
    background: rgba(var(--accent-danger-rgb, 231, 76, 60), 0.15) !important;
}

.quiz-choice-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.quiz-choice-btn.correct .quiz-choice-letter {
    background: var(--accent-secondary);
    color: var(--text-on-accent);
}

.quiz-choice-btn.wrong .quiz-choice-letter {
    background: var(--accent-danger);
    color: var(--text-on-accent);
}

.quiz-choice-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
}

/* Result Overlay */
.quiz-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.quiz-result-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: quiz-result-pop 0.3s ease;
}

@keyframes quiz-result-pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.quiz-result-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border-radius: 50%;
    font-size: 40px;
    color: white;
}

.quiz-result-overlay.correct .quiz-result-icon {
    background: var(--accent-secondary);
}

.quiz-result-overlay.wrong .quiz-result-icon {
    background: var(--accent-danger);
}

.quiz-result-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.quiz-result-overlay.correct .quiz-result-title {
    color: var(--accent-secondary);
}

.quiz-result-overlay.wrong .quiz-result-title {
    color: var(--accent-danger);
}

.quiz-result-answer {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.quiz-result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-view-btn {
    text-decoration: none;
}

.quiz-next-btn {
    padding: 14px 24px;
    font-size: 16px;
}

.quiz-result-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.quiz-result-hint kbd {
    padding: 2px 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-container {
        padding: 12px;
    }
    
    .quiz-setup {
        padding: 20px;
    }
    
    .quiz-setup-header h2 {
        font-size: 22px;
    }
    
    .quiz-mode-options {
        flex-direction: column;
    }
    
    .quiz-mode-option {
        min-width: 100%;
    }
    
    .quiz-mode-label {
        flex-direction: row;
        justify-content: flex-start;
        padding: 14px 16px;
    }
    
    .quiz-mode-icon {
        font-size: 22px;
    }
    
    .quiz-labels-grid {
        grid-template-columns: 1fr;
        max-height: 200px;
    }
    
    .quiz-stats-bar {
        padding: 12px 16px;
        gap: 16px;
    }
    
    .quiz-stat-value {
        font-size: 16px;
    }
    
    .quiz-question-area {
        padding: 16px;
    }
    
    .quiz-image-wrapper {
        min-height: 200px;
    }
    
    .quiz-canvas {
        max-height: 280px;
    }
    
    .quiz-choices {
        grid-template-columns: 1fr;
    }
    
    .quiz-choice-btn {
        padding: 14px 16px;
    }
    
    .quiz-result-content {
        padding: 28px 20px;
    }
    
    .quiz-result-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    .quiz-result-title {
        font-size: 22px;
    }
}


/* Professional Quiz Choice Rows (Answer Buttons) */
.quiz-choices-professional {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-choice-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}

.quiz-choice-row:hover:not(.disabled):not(.correct):not(.wrong) {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.quiz-choice-row.disabled {
    cursor: default;
    pointer-events: none;
}

.quiz-choice-row.selected {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.quiz-choice-row.correct {
    border-color: var(--accent-secondary) !important;
    background: rgba(var(--accent-secondary-rgb, 46, 204, 113), 0.15) !important;
}

.quiz-choice-row.wrong {
    border-color: var(--accent-danger) !important;
    background: rgba(var(--accent-danger-rgb, 231, 76, 60), 0.15) !important;
}

.quiz-choice-label {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.quiz-choice-row:hover:not(.disabled) .quiz-choice-label {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.quiz-choice-row.correct .quiz-choice-label {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
}

.quiz-choice-row.wrong .quiz-choice-label {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
}

.quiz-choice-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.quiz-choice-english {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    margin-left: 4px;
}

/* Start Quiz Action Button */
.quiz-start-action {
    margin-top: 24px;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
}

.quiz-start-action:hover {
    background: rgba(var(--accent-primary-rgb), 0.1) !important;
    border-color: var(--accent-primary) !important;
}

.quiz-start-action .quiz-choice-label {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.quiz-start-action .quiz-choice-name {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Mobile adjustments for start button */
@media (max-width: 768px) {
    .quiz-start-action {
        margin-top: 16px;
        padding: 14px 16px;
    }
}

/* Quiz Feedback Card */
.quiz-feedback-professional {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 16px;
}

.quiz-feedback-professional.correct {
    border-color: var(--accent-secondary);
    background: rgba(var(--accent-secondary-rgb, 46, 204, 113), 0.1);
}

.quiz-feedback-professional.wrong {
    border-color: var(--accent-danger);
    background: rgba(var(--accent-danger-rgb, 231, 76, 60), 0.1);
}

.quiz-feedback-message {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-feedback-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.quiz-feedback-professional.correct .quiz-feedback-icon {
    background: var(--accent-secondary);
    color: white;
}

.quiz-feedback-professional.wrong .quiz-feedback-icon {
    background: var(--accent-danger);
    color: white;
}

.quiz-feedback-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quiz-feedback-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.quiz-feedback-answer {
    font-size: 14px;
    color: var(--text-secondary);
}

.quiz-feedback-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.quiz-feedback-link {
    font-size: 14px;
    color: var(--accent-primary);
    text-decoration: none;
}

.quiz-feedback-link:hover {
    text-decoration: underline;
}

.quiz-next-action {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-next-action:hover {
    background: var(--accent-secondary);
}

/* Mobile feedback styles */
@media (max-width: 768px) {
    .quiz-feedback-professional {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .quiz-feedback-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .quiz-feedback-status {
        font-size: 14px;
    }
    
    .quiz-feedback-answer {
        font-size: 13px;
    }
    
    .quiz-feedback-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .quiz-next-action {
        width: 100%;
        padding: 12px 20px;
    }
}

/* Compact Quiz Header */
.quiz-screen-header.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 12px;
    border-bottom: none;
    gap: 12px;
}

.quiz-screen-header.compact .quiz-question-number {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.quiz-screen-header.compact .quiz-flight-id {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quiz-screen-header.compact .quiz-labelset {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quiz-screen-header.compact .quiz-accuracy-badge {
    margin-left: auto;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .quiz-screen-header.compact {
        padding: 4px 0;
        margin-bottom: 8px;
    }
    
    .quiz-screen-header.compact .quiz-question-number {
        font-size: 13px;
    }
}

/* Hidden button state for quiz */
.quiz-choice-row.hidden {
    display: none !important;
}

/* Full width quiz image */
.quiz-game .quiz-image-wrapper {
    width: 100%;
    min-height: auto;
}

.quiz-game .quiz-canvas {
    width: 100%;
    max-width: none;
    max-height: none;
}

@media (max-width: 768px) {
    .quiz-game .quiz-image-wrapper {
        min-height: auto;
    }
    
    .quiz-game .quiz-canvas {
        max-height: none;
    }
}

/* Button loading state - prevents accidental tap-through */
.quiz-choice-row.loading {
    pointer-events: none;
    opacity: 0.7;
}
