@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #060a13;
    --bg-surface: rgba(13, 20, 38, 0.45);
    --bg-surface-solid: #0d1426;
    --bg-panel: rgba(22, 33, 62, 0.3);
    --border-color: rgba(0, 240, 255, 0.15);
    --border-hover: rgba(0, 240, 255, 0.4);
    
    --clr-cyan: #00f0ff;
    --clr-purple: #8a2be2;
    --clr-pink: #ff007f;
    --clr-green: #39ff14;
    --clr-yellow: #ffdf00;
    --clr-text-main: #e2e8f0;
    --clr-text-muted: #8a9fc4;
    
    --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.25);
    --glow-cyan-strong: 0 0 25px rgba(0, 240, 255, 0.6);
    --glow-purple: 0 0 15px rgba(138, 43, 226, 0.25);
    --glow-pink: 0 0 15px rgba(255, 0, 127, 0.25);
    
    --font-family: 'Outfit', sans-serif;
    --sidebar-width: 280px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(138, 43, 226, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 240, 255, 0.1) 0px, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    color: var(--clr-text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--clr-cyan);
    box-shadow: var(--glow-cyan);
}

/* App Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(8, 12, 24, 0.85);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 100;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--clr-cyan), var(--clr-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-cyan);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    stroke: white;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, var(--clr-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--clr-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke: var(--clr-text-muted);
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--clr-text-main);
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.1);
}

.nav-item.active {
    color: var(--clr-cyan);
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--border-color);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1);
}

.nav-item.active svg {
    stroke: var(--clr-cyan);
    filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.5));
}

.system-status {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    display: inline-block;
}

.dot.green {
    background: var(--clr-green);
    box-shadow: 0 0 8px var(--clr-green);
}

.dot.yellow {
    background: var(--clr-yellow);
    box-shadow: 0 0 8px var(--clr-yellow);
}

.dot.pink {
    background: var(--clr-pink);
    box-shadow: 0 0 8px var(--clr-pink);
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    position: relative;
    padding: 32px;
}

.panel {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.panel.active {
    display: block;
}

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

/* Typography elements */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--clr-text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 15px;
    color: var(--clr-text-muted);
    margin-top: 4px;
}

/* Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stats-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--clr-cyan), transparent);
}

.stats-card.purple::before {
    background: linear-gradient(to bottom, var(--clr-purple), transparent);
}

.stats-card.pink::before {
    background: linear-gradient(to bottom, var(--clr-pink), transparent);
}

.stats-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.05);
}

.stats-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--clr-text-muted);
}

.stats-value {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.stats-desc {
    font-size: 13px;
    color: var(--clr-text-muted);
}

/* Grid rows for larger components */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    position: relative;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.card-title svg {
    width: 20px;
    height: 20px;
    stroke: var(--clr-cyan);
}

/* Action button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    font-family: var(--font-family);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-cyan), var(--clr-purple));
    color: #fff;
    box-shadow: var(--glow-cyan);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    box-shadow: var(--glow-cyan-strong);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(22, 33, 62, 0.6);
    color: var(--clr-text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--clr-cyan);
}

.btn-danger {
    background: rgba(255, 0, 127, 0.15);
    color: #ff3b6f;
    border: 1px solid rgba(255, 0, 127, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 0, 127, 0.3);
    box-shadow: var(--glow-pink);
}

.btn-group {
    display: flex;
    gap: 12px;
}

/* Camera Feedback and Calibration elements */
.tracker-setup-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.tracker-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.video-element {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mirror webcam */
}

.video-element.unmirrored {
    transform: scaleX(1);
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transform: scaleX(-1);
}

.canvas-overlay.unmirrored {
    transform: scaleX(1);
}

.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.hud-overlay.tracking-active {
    border-color: rgba(57, 255, 20, 0.3);
    box-shadow: inset 0 0 30px rgba(57, 255, 20, 0.08);
}

.hud-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid var(--clr-cyan);
}

.hud-tl { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.hud-tr { top: 16px; right: 16px; border-left: none; border-bottom: none; }
.hud-bl { bottom: 16px; left: 16px; border-right: none; border-top: none; }
.hud-br { bottom: 16px; right: 16px; border-left: none; border-top: none; }

.hud-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--clr-cyan), transparent);
    opacity: 0;
    z-index: 16;
}

.hud-overlay.tracking-active .hud-scanner {
    opacity: 0.7;
    animation: scanning 3s linear infinite;
}

@keyframes scanning {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.tracker-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 5;
    text-align: center;
    padding: 20px;
}

.tracker-placeholder svg {
    width: 64px;
    height: 64px;
    stroke: var(--clr-text-muted);
}

/* File Upload Viewport */
.upload-container {
    width: 100%;
    min-height: 250px;
    border: 2px dashed rgba(0, 240, 255, 0.2);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px;
    cursor: pointer;
    background: rgba(13, 20, 38, 0.2);
    transition: var(--transition-fast);
}

.upload-container:hover, .upload-container.dragover {
    border-color: var(--clr-cyan);
    background: rgba(0, 240, 255, 0.04);
    box-shadow: var(--glow-cyan);
}

.upload-container svg {
    width: 50px;
    height: 50px;
    stroke: var(--clr-cyan);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.3));
}

.upload-text {
    font-size: 15px;
    color: var(--clr-text-muted);
    text-align: center;
    line-height: 1.5;
}

.upload-text span {
    color: var(--clr-cyan);
    font-weight: 600;
}

/* File info overlay */
.file-info-badge {
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid var(--clr-purple);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Video Player UI for processing */
.video-player-hud {
    margin-top: 16px;
    background: rgba(8, 12, 24, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.play-timeline {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.timeline-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--clr-cyan), var(--clr-purple));
    border-radius: 3px;
}

.timing-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--clr-text-muted);
}

.vdo-analysis-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 10, 19, 0.85);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.vdo-analysis-progress-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.radial-loader {
    position: relative;
    width: 100px;
    height: 100px;
}

.radial-loader-svg {
    transform: rotate(-90deg);
}

.radial-loader-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.radial-loader-circle-fill {
    fill: none;
    stroke: var(--clr-cyan);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    transition: stroke-dashoffset 0.1s linear;
}

.loader-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

/* Calibration dot overlays */
.calibration-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #03070e;
    z-index: 1000;
    display: none;
}

.calibration-fullscreen.active {
    display: block;
}

.calibration-dot {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--clr-cyan);
    border: 3px solid #fff;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--clr-cyan), 0 0 0 6px rgba(0, 240, 255, 0.2);
    transition: background-color var(--transition-fast), transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1010;
}

.calibration-dot::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 1px dashed var(--clr-cyan);
    border-radius: 50%;
    animation: rotate 6s linear infinite;
}

.calibration-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.calibration-dot.active {
    background: var(--clr-pink);
    box-shadow: 0 0 20px var(--clr-pink), 0 0 0 8px rgba(255, 0, 127, 0.25);
    border-color: #fff;
}

.calibration-click-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #fff;
    font-weight: 700;
    pointer-events: none;
}

.calibration-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
    max-width: 500px;
}

.calibration-instructions h2 {
    font-size: 26px;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fff, var(--clr-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calibration-instructions p {
    color: var(--clr-text-muted);
    font-size: 15px;
    line-height: 1.6;
}

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

/* Reaction Test Canvas */
.test-playground {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(5, 9, 21, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}

.test-playground.click-active {
    background: rgba(255, 0, 127, 0.05);
}

.test-stimulus {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.1s ease;
    z-index: 100;
}

.test-stimulus.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: pulse 1s infinite alternate;
}

.test-stimulus.gaze-target {
    background: radial-gradient(circle, var(--clr-cyan) 0%, rgba(138, 43, 226, 0.6) 70%, transparent 100%);
    border: 3px double var(--clr-cyan);
    box-shadow: var(--glow-cyan-strong);
}

.test-stimulus.visual-click {
    background: radial-gradient(circle, var(--clr-pink) 0%, rgba(255, 0, 127, 0.6) 70%, transparent 100%);
    border: 3px double var(--clr-pink);
    box-shadow: 0 0 25px var(--clr-pink);
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.9); box-shadow: 0 0 15px rgba(0, 240, 255, 0.4); }
    100% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 35px rgba(0, 240, 255, 0.8); }
}

.test-ready-state {
    text-align: center;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.test-ready-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.test-ready-state p {
    color: var(--clr-text-muted);
    font-size: 14px;
    max-width: 400px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.test-gaze-pointer {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(57, 255, 20, 0.75);
    border: 2px solid #fff;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--clr-green);
    z-index: 120;
    display: none;
}

/* History log layout */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.history-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--clr-text-muted);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--clr-text-main);
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-cyan { background: rgba(0, 240, 255, 0.1); color: var(--clr-cyan); border: 1px solid rgba(0, 240, 255, 0.2); }
.badge-purple { background: rgba(138, 43, 226, 0.1); color: #c084fc; border: 1px solid rgba(138, 43, 226, 0.2); }
.badge-pink { background: rgba(255, 0, 127, 0.1); color: var(--clr-pink); border: 1px solid rgba(255, 0, 127, 0.2); }
.badge-green { background: rgba(57, 255, 20, 0.1); color: var(--clr-green); border: 1px solid rgba(57, 255, 20, 0.2); }

/* Custom layout helpers */
.flex-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.margin-bottom-20 {
    margin-bottom: 20px;
}

.alert-box {
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
}

.alert-box svg {
    width: 20px;
    height: 20px;
    stroke: var(--clr-cyan);
    flex-shrink: 0;
    margin-top: 2px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.text-large {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    margin: 10px 0;
}

/* Timeline Sync Chart Container */
.chart-container-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
    margin-top: 16px;
}

.performance-meter-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.meter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.meter-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.meter-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--clr-cyan);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.meter-bar-fill.cyan { background: var(--clr-cyan); }
.meter-bar-fill.purple { background: var(--clr-purple); }
.meter-bar-fill.pink { background: var(--clr-pink); }
.meter-bar-fill.green { background: var(--clr-green); }

/* Quick Status List items */
.status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-list-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.status-list-label {
    color: var(--clr-text-muted);
}

.status-list-value {
    color: #fff;
    font-weight: 600;
}

.status-list-value.high { color: var(--clr-green); }
.status-list-value.med { color: var(--clr-yellow); }
.status-list-value.low { color: var(--clr-pink); }

/* Mobile Responsive Media Queries */
@media (max-width: 768px) {
    /* 1. App Container Layout Switch to bottom navbar */
    .app-container {
        flex-direction: column-reverse;
    }

    /* 2. Sidebar transforms to Bottom Navigation Bar */
    .sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 8px 16px;
        backdrop-filter: blur(25px);
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }

    /* Hide desktop-only sidebar widgets on mobile */
    .logo-container, 
    .system-status {
        display: none !important;
    }

    /* Adjust Navigation Menu for bottom bar */
    .nav-menu {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        gap: 0;
    }

    .nav-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 12px;
        font-size: 10px;
        color: var(--clr-text-muted);
        border: none;
        border-radius: 8px;
        background: transparent !important;
        box-shadow: none !important;
    }

    .nav-item svg {
        width: 22px;
        height: 22px;
    }

    .nav-item.active {
        color: var(--clr-cyan);
    }

    /* 3. Main Content Area spacing adjustments */
    .main-content {
        padding: 16px 16px 90px 16px; /* Extra bottom padding to avoid bar overlay */
        overflow-y: auto;
    }

    /* Header styling adjustments */
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 24px;
    }

    /* 4. Grid Stack layouts */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .stats-card {
        padding: 16px;
    }

    .stats-value {
        font-size: 26px;
    }

    .main-grid,
    .tracker-setup-grid,
    .grid-2col {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .card {
        padding: 18px;
    }

    /* 5. Camera Preview & Web Video players resizing */
    .tracker-wrapper {
        aspect-ratio: 4/3;
    }

    /* Test playground aspect ratio for mobile screens */
    .test-playground {
        aspect-ratio: 4/3;
    }

    .test-stimulus {
        width: 60px;
        height: 60px;
    }

    .test-stimulus.active {
        transform: translate(-50%, -50%) scale(1);
    }

    /* Button alignment styles */
    .btn-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        padding: 10px 18px;
        font-size: 14px;
    }

    .btn-stop-test {
        width: auto !important;
    }

    .upload-container {
        min-height: 180px;
        padding: 20px;
    }

    .upload-text {
        font-size: 13px;
    }

    /* History table responsive columns */
    .history-table th:nth-child(4),
    .history-table td:nth-child(4),
    .history-table th:nth-child(6),
    .history-table td:nth-child(6) {
        display: none;
    }
}
