/* RETRO PATIENT MONITOR v3.0 - PIXEL DASHBOARD EDITION */
/* Authentic CRT Medical Terminal with Original Dashboard Layout */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono:wght@400&family=VT323&display=swap');

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

:root {
    /* CRT Phosphor Colors */
    --phosphor-green: #00ff41;
    --phosphor-amber: #ffb000;
    --phosphor-red: #ff0040;
    --phosphor-blue: #0080ff;
    --phosphor-white: #ffffff;
    
    /* Background Colors */
    --crt-black: #000000;
    --crt-dark: #001100;
    --crt-darker: #000800;
    --panel-bg: #002200;
    --panel-border: #004400;
    
    /* UI Colors */
    --text-primary: var(--phosphor-green);
    --text-secondary: #88cc88;
    --text-accent: var(--phosphor-amber);
    --text-error: var(--phosphor-red);
    --text-info: var(--phosphor-blue);
    
    /* Fonts */
    --font-mono: 'VT323', 'Share Tech Mono', monospace;
    --font-display: 'Orbitron', monospace;
    --font-terminal: 'Share Tech Mono', monospace;
    
    /* Effects */
    --glow-green: 0 0 10px var(--phosphor-green);
    --glow-red: 0 0 10px var(--phosphor-red);
    --glow-amber: 0 0 10px var(--phosphor-amber);
    --scan-opacity: 0.08;
}

body {
    font-family: var(--font-terminal);
    background: radial-gradient(ellipse at center, #003300 0%, var(--crt-black) 70%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* CRT Monitor Container */
.crt-monitor {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.screen-bezel {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    position: relative;
}

.screen-content {
    width: 100%;
    height: 100%;
    background: var(--crt-black);
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    animation: crt-flicker 0.15s infinite linear alternate;
}

/* CRT Effects */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, var(--scan-opacity)) 2px,
        rgba(0, 255, 65, var(--scan-opacity)) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

.screen-flicker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 98%,
        rgba(0, 255, 65, 0.03) 100%
    );
    animation: flicker-line 0.1s infinite linear;
    pointer-events: none;
    z-index: 999;
}

@keyframes crt-flicker {
    0% { opacity: 1; }
    98% { opacity: 1; }
    99% { opacity: 0.98; }
    100% { opacity: 1; }
}

@keyframes flicker-line {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100vw); }
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Sidebar */
.sidebar {
    width: 100px;
    background: linear-gradient(180deg, var(--panel-bg) 0%, var(--crt-darker) 100%);
    border-right: 3px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        rgba(0, 255, 65, 0.02) 2px,
        transparent 4px
    );
    pointer-events: none;
}

.logo {
    margin-bottom: 30px;
    text-align: center;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--panel-bg) 0%, var(--crt-dark) 100%);
    border: 2px solid var(--phosphor-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: var(--glow-green);
}

.pixel-heart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 20px;
    height: 20px;
}

.heart-pixel {
    background: var(--phosphor-green);
    width: 8px;
    height: 8px;
    box-shadow: 0 0 4px var(--phosphor-green);
    animation: heartbeat-glow 1.5s ease-in-out infinite;
}

@keyframes heartbeat-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--phosphor-green);
    text-shadow: var(--glow-green);
    letter-spacing: 1px;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.nav-item {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, var(--crt-dark) 0%, var(--crt-darker) 100%);
    border: 2px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: crosshair;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item:hover {
    background: linear-gradient(145deg, var(--panel-bg) 0%, var(--crt-dark) 100%);
    border-color: var(--phosphor-green);
    color: var(--phosphor-green);
    transform: translateY(-2px);
    box-shadow: var(--glow-green);
}

.nav-item:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--phosphor-green) 0%, #00cc33 100%);
    border-color: var(--phosphor-green);
    color: var(--crt-black);
    box-shadow: var(--glow-green);
}

.nav-item.power-nav.active {
    background: linear-gradient(135deg, var(--phosphor-red) 0%, #cc0033 100%);
    border-color: var(--phosphor-red);
    box-shadow: var(--glow-red);
}

.pixel-icon {
    display: grid;
    gap: 1px;
    width: 16px;
    height: 16px;
}

.dashboard-icon {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.heart-icon {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
}

.breath-icon,
.records-icon {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
}

.settings-icon {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.power-icon {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.icon-pixel {
    background: currentColor;
    width: 4px;
    height: 4px;
}

.icon-pixel.pulse {
    animation: pulse-pixel 1s ease-in-out infinite;
}

.icon-pixel.wave {
    animation: wave-pixel 2s ease-in-out infinite;
}

.icon-pixel.rotate {
    animation: rotate-pixel 3s linear infinite;
}

@keyframes pulse-pixel {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes wave-pixel {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

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

.nav-label {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 400;
}

/* Tooltip */
.nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--crt-darker);
    color: var(--phosphor-green);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--panel-border);
    box-shadow: var(--glow-green);
    z-index: 1000;
}

.nav-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--panel-border);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    color: var(--phosphor-green);
    text-shadow: var(--glow-green);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.system-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.version {
    color: var(--phosphor-amber);
    text-shadow: var(--glow-amber);
}

.separator {
    color: var(--phosphor-amber);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Pixel Buttons */
.pixel-btn {
    background: linear-gradient(145deg, var(--crt-dark) 0%, var(--crt-darker) 100%);
    border: 2px solid var(--panel-border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 12px;
    cursor: crosshair;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    min-height: 36px;
    min-width: 60px;
    justify-content: center;
}

.pixel-btn:hover {
    background: linear-gradient(145deg, var(--panel-bg) 0%, var(--crt-dark) 100%);
    border-color: var(--phosphor-green);
    color: var(--phosphor-green);
    text-shadow: var(--glow-green);
    box-shadow: var(--glow-green);
    transform: translateY(-1px);
}

.pixel-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pixel-btn:focus {
    outline: 2px solid var(--phosphor-green);
    outline-offset: 2px;
}

.pixel-btn.active {
    background: linear-gradient(135deg, var(--phosphor-green) 0%, #00cc33 100%);
    border-color: var(--phosphor-green);
    color: var(--crt-black);
    box-shadow: var(--glow-green);
}

.btn-led {
    width: 6px;
    height: 6px;
    background: var(--phosphor-red);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--phosphor-red);
}

.btn-led.active,
.power-led.active {
    background: var(--phosphor-green);
    box-shadow: 0 0 4px var(--phosphor-green);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--phosphor-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--phosphor-green);
    animation: status-pulse 2s infinite;
}

.status-dot.critical {
    background: var(--phosphor-red);
    box-shadow: 0 0 6px var(--phosphor-red);
    animation: critical-pulse 0.5s infinite;
}

.status-dot.urgent {
    background: var(--phosphor-amber);
    box-shadow: 0 0 6px var(--phosphor-amber);
    animation: critical-pulse 0.5s infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes critical-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.status-text {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* Panel Base Styles */
.analysis-box,
.graph-section,
.vital-card {
    background: linear-gradient(145deg, var(--panel-bg) 0%, var(--crt-darker) 100%);
    border: 2px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.05);
    transition: all 0.3s ease;
}

.vital-card.disabled {
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: none;
    border-color: var(--text-secondary);
}

.vital-card.disabled .card-title {
    color: var(--text-secondary);
}

.vital-card.disabled .card-icon {
    opacity: 0.3;
}

.vital-card.active-phase {
    border-color: var(--phosphor-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 255, 65, 0.1));
}

.vital-card.active-phase .card-title {
    color: var(--phosphor-green);
    text-shadow: 0 0 5px var(--phosphor-green);
}

.vital-card.active-phase .card-icon {
    filter: drop-shadow(0 0 3px var(--phosphor-green));
}

.panel-header {
    background: linear-gradient(180deg, var(--crt-dark) 0%, var(--panel-bg) 100%);
    border-bottom: 2px solid var(--panel-border);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--phosphor-green);
    text-shadow: var(--glow-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 8px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.status-led {
    width: 6px;
    height: 6px;
    background: var(--phosphor-red);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--phosphor-red);
}

.status-led.active {
    background: var(--phosphor-green);
    box-shadow: 0 0 4px var(--phosphor-green);
}

.panel-body {
    padding: 16px;
    height: calc(100% - 60px);
}

.diagnosis-actions { margin-top: 12px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Analysis Box */
.analysis-box {
    grid-column: 1;
}

.terminal-screen {
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
    padding: 12px;
    height: 200px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
}

.terminal-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.prompt {
    color: var(--phosphor-green);
    font-weight: 700;
}

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

.terminal-line.current .text {
    color: var(--phosphor-amber);
    text-shadow: var(--glow-amber);
}

.alert-section {
    margin-top: 16px;
    opacity: 1;
    transition: all 0.3s ease;
   
}

.alert-section.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.alert-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 0, 64, 0.1);
    border: 2px solid var(--phosphor-red);
    border-radius: 4px;
    animation: alert-pulse 1s infinite;
}

@keyframes alert-pulse {
    0%, 100% { 
        border-color: var(--phosphor-red);
        box-shadow: 0 0 0 0 rgba(255, 0, 64, 0.4);
    }
    50% { 
        border-color: #ff4466;
        box-shadow: 0 0 0 8px rgba(255, 0, 64, 0.1);
    }
}

.alert-icon {
    font-size: 20px;
    color: var(--phosphor-red);
    text-shadow: var(--glow-red);
}

.alert-message {
    color: var(--phosphor-red);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    margin: 0;
}

/* Graph Section */
.graph-section {
    grid-column: 2;
    display: flex;
    flex-direction: column;
}

/* Combined (Section 2) layout */
.combined-section .panel-body { display: flex; flex-direction: column; }
.combined-layout { display: grid; grid-template-columns: 1fr; grid-auto-rows: auto; gap: 16px; align-items: stretch; }
.combined-left { display: flex; flex-direction: column; gap: 16px; }
.combined-right { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.combined-left .graph-container { flex: 1; }

.graph-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    padding: 6px 10px;
    font-size: 9px;
    min-width: 50px;
    min-height: 28px;
}

.graph-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crt-screen {
    flex: 1;
    background: var(--crt-darker);
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

#ecgCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

.screen-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 65, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.graph-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 17, 0, 0.8);
    border: 1px solid var(--panel-border);
    padding: 6px 10px;
    border-radius: 4px;
}

.bpm-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 12px;
}

.bpm-label {
    color: var(--phosphor-green);
}

.bpm-value {
    color: var(--phosphor-amber);
    font-weight: 700;
    text-shadow: var(--glow-amber);
}

.graph-message {
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    padding: 8px;
    text-transform: uppercase;
}

/* Vitals Section */
.vitals-section {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vital-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.card-header {
    background: linear-gradient(180deg, var(--crt-dark) 0%, var(--panel-bg) 100%);
    border-bottom: 1px solid var(--panel-border);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--phosphor-green);
    text-shadow: var(--glow-green);
    text-transform: uppercase;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pixel-heart-small {
    width: 12px;
    height: 12px;
    position: relative;
}

.heart-beat-pixel {
    width: 12px;
    height: 12px;
    background: var(--phosphor-red);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: heartbeat-pulse 1.5s ease-in-out infinite;
}

@keyframes heartbeat-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.pixel-lungs {
    display: flex;
    gap: 2px;
}

.lung-pixel {
    width: 6px;
    height: 10px;
    background: var(--phosphor-blue);
    border-radius: 2px;
    animation: breath-pulse 2s ease-in-out infinite;
}

@keyframes breath-pulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.7); }
}

.pixel-face {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 12px;
    height: 12px;
}

.face-pixel {
    width: 4px;
    height: 4px;
    background: var(--phosphor-amber);
}

.face-pixel.eye {
    border-radius: 50%;
}

.face-pixel.mouth {
    grid-column: 1 / 3;
    width: 8px;
    height: 2px;
    border-radius: 2px;
}

.card-body {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vital-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vital-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
    text-align: center;
}

.value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 900;
    color: var(--phosphor-green);
    text-shadow: var(--glow-green);
}

.unit {
    font-size: 10px;
    color: var(--text-secondary);
}

.mood-text {
    font-size: 14px;
    color: var(--phosphor-amber);
    text-shadow: var(--glow-amber);
}

.vital-bars {
    display: flex;
    gap: 2px;
    height: 20px;
    align-items: flex-end;
}

.bar {
    width: 8px;
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
    transition: all 0.3s ease;
}

.bar[data-level="1"] { height: 4px; }
.bar[data-level="2"] { height: 8px; }
.bar[data-level="3"] { height: 12px; }
.bar[data-level="4"] { height: 16px; }
.bar[data-level="5"] { height: 20px; }

.bar.active {
    background: var(--phosphor-green);
    box-shadow: 0 0 4px var(--phosphor-green);
}

.bpm-card .bar.active {
    background: var(--phosphor-red);
    box-shadow: 0 0 4px var(--phosphor-red);
}

.breath-card .bar.active {
    background: var(--phosphor-blue);
    box-shadow: 0 0 4px var(--phosphor-blue);
}

.mood-indicator {
    display: flex;
    gap: 2px;
    height: 12px;
}

.mood-bar {
    flex: 1;
    height: 100%;
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
}

.mood-bar.good.active {
    background: var(--phosphor-green);
    box-shadow: 0 0 4px var(--phosphor-green);
}

.mood-bar.ok.active {
    background: var(--phosphor-amber);
    box-shadow: 0 0 4px var(--phosphor-amber);
}

.mood-bar.bad.active {
    background: var(--phosphor-red);
    box-shadow: 0 0 4px var(--phosphor-red);
}

.vital-status {
    font-size: 8px;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    padding: 4px 8px;
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
}

.breath-controls {
    margin-top: 8px;
}

.mic-btn {
    width: 100%;
    font-size: 8px;
    min-height: 24px;
}

/* Breath Section extras */
.breath-extra-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.breath-recognition {
    margin-top: 8px;
    font-size: 9px;
    color: var(--text-secondary);
    padding: 6px 8px;
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    text-transform: uppercase;
}

.breath-graph {
    margin-top: 8px;
    background: var(--crt-darker);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 6px;
}

#breathCanvas {
    width: 100%;
    height: 100px;
    display: block;
    background: transparent;
}

/* Footer */
.footer {
    margin-top: 20px;
    padding: 12px 0;
    border-top: 2px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.system-name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--phosphor-green);
}

.footer-commands {
    display: flex;
    gap: 15px;
}

.command {
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Modal */
.pixel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: all 0.3s ease;
}

.pixel-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: linear-gradient(145deg, var(--panel-bg) 0%, var(--crt-darker) 100%);
    border: 3px solid var(--phosphor-red);
    max-width: 600px;
    width: 95%;
    box-shadow: 
        0 0 30px var(--phosphor-red),
        inset 0 0 20px rgba(255, 0, 64, 0.1);
    animation: modal-glitch 0.1s infinite;
}

@keyframes modal-glitch {
    0%, 90% { transform: translate(0); }
    95% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

.modal-header {
    background: linear-gradient(180deg, var(--crt-dark) 0%, var(--panel-bg) 100%);
    border-bottom: 2px solid var(--phosphor-red);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--phosphor-red);
    text-shadow: var(--glow-red);
    text-transform: uppercase;
}

.close-btn {
    padding: 4px 8px;
    font-size: 10px;
    min-width: 24px;
    min-height: 24px;
}

.modal-body {
    padding: 24px 20px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.alert-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.alert-icon-large {
    font-size: 48px;
    color: var(--phosphor-red);
    text-shadow: var(--glow-red);
    animation: pulse-alert 1s infinite;
}

@keyframes pulse-alert {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.alert-text {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--phosphor-red);
    text-shadow: var(--glow-red);
    text-transform: uppercase;
    font-weight: 700;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.3;
}

.modal-footer {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid var(--phosphor-red);
}

.acknowledge-btn {
    font-size: 10px;
    min-width: 100px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr 1.6fr 1fr;
        grid-template-rows: auto 1fr;
        gap: 16px;
    }
    
    .analysis-box { grid-column: 1; grid-row: 1; }
    .graph-section { grid-column: 2; grid-row: 1 / 3; }
    .vitals-section { grid-column: 3; grid-row: 1 / 3; gap: 12px; }
    .combined-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 15px 0;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
    }
    
    .analysis-box,
    .graph-section,
    .vitals-section {
        grid-column: 1;
    }
    
    .vitals-section {
        flex-direction: column;
        gap: 12px;
    }

    .combined-layout { grid-template-columns: 1fr; }
    
    .nav-item {
        width: 60px;
        height: 60px;
    }
    
    .pixel-btn {
        font-size: 9px;
        padding: 6px 10px;
        min-height: 32px;
        min-width: 50px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --phosphor-green: #00ff00;
        --phosphor-red: #ff0000;
        --phosphor-amber: #ffff00;
        --text-secondary: #cccccc;
    }
} 