/* style.css - Professional VExUS Academy Theme */

:root {
    --bg: #050505;
    --panel: #121212;
    --accent: #00f2ff;
    --secondary: #ff00ff; /* CVP Color */
    --text: #e0e0e0;
    --text-muted: #888;
    --danger: #ff4444;
    --warning: #ffcc00;
    --success: #00ff44;
    --border: #333;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* --- Navigation Bar --- */
.main-nav {
    background: var(--panel);
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
}

.logo {
    font-weight: bold;
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-item {
    padding: 0 25px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.nav-item:hover {
    color: #fff;
}

.nav-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(0, 242, 255, 0.05);
}

/* --- Tab & Scroll Management --- */
#tab-container {
    flex: 1;
    position: relative;
    overflow: hidden; /* Contains the children */
    display: flex;
}

.tab-content {
    display: none;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Enables vertical scrolling for each section */
    -webkit-overflow-scrolling: touch;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* --- Simulator Layout Responsiveness --- */
.app-layout {
    display: flex;
    flex-direction: row; /* Horizontal on Desktop */
    min-height: 100%; 
}

.sidebar {
    width: 320px;
    background: var(--panel);
    padding: 20px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    overflow-y: auto;
}

.viewport { 
    flex: 1; 
    padding: 10px; 
    display: grid; 
    grid-template-columns: 1fr 300px; /* Main waveforms | PVC Column */
    grid-template-rows: repeat(4, 1fr); /* 4 equal height rows */
    gap: 10px; 
    height: calc(100vh - 60px); /* Adjust based on Nav height */
    background: #000;
}

/* --- Graph Containers & Canvas --- */
.graph-container { 
    background: #000; 
    position: relative; 
    border-radius: 4px;
    border: 1px solid #1a1a1a;
    overflow: hidden;
}

/* ECG spans full width */
.graph-container:nth-child(4) { 
    grid-column: 1 / span 2; 
}

canvas { 
    display: block; 
    width: 100%; 
    height: 100%; 
}

/* --- Labels & Tags --- */
.label-box { 
    position: absolute; 
    top: 5px; 
    left: 10px; 
    z-index: 100; 
    pointer-events: none;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 4px;
}

.organ-name { 
    display: block;
    color: var(--accent); 
    font-weight: bold; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
}

.organ-status { 
    display: block;
    color: #aaa; 
    font-size: 0.7rem; 
}

/* --- Controls --- */
.control-group { 
    background: #1a1a1a; 
    padding: 12px; 
    border-radius: 6px; 
    border: 1px solid #222;
}

label { 
    font-size: 0.75rem; 
    display: block; 
    margin-bottom: 8px;
    color: #bbb;
}

.val { 
    color: var(--accent); 
    font-weight: bold; 
    float: right; 
    font-family: 'Courier New', monospace;
}

input[type="range"] { 
    width: 100%; 
    accent-color: var(--accent);
    cursor: pointer; 
}

#vexus-score { 
    font-size: 1.4rem; 
    text-align: center; 
    padding: 20px; 
    background: #000; 
    border: 2px solid var(--accent); 
    margin-top: auto; 
    color: var(--accent); 
    border-radius: 8px;
    font-weight: bold;
}

/* --- Educational Content (Theory & Technique) --- */
.educational-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    line-height: 1.6;
}

h1 { color: #fff; font-size: 2.2rem; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
h2 { color: var(--accent); margin-top: 40px; font-size: 1.5rem; }
h3 { color: var(--secondary); margin-top: 25px; }

ul { padding-left: 20px; }
li { margin-bottom: 10px; color: #ccc; }

.warning-box {
    background: rgba(255, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 4px;
}

.technique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 30px;
    width: 100%;
    max-width: 1200px; /* Centers content on wide screens */
    margin: 0 auto;
    box-sizing: border-box;
}

.tech-card {
    background: var(--panel);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: fit-content; /* Allows cards to grow based on text */
}

/* Ensure images within cards fit well */
.tech-card img {
    max-width: 100%;
    height: auto;
    margin-top: 15px;
    border-radius: 4px;
}

/* Preset Buttons */
.preset-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 10px;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: var(--accent);
    color: #000;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* --- Mobile Responsiveness & Orientation --- */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column; /* Vertical on Mobile */
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        box-sizing: border-box;
    }

    .viewport {
        grid-template-columns: 1fr; /* Single column on mobile portrait */
        grid-template-rows: auto;
        height: auto;
    }

    .pvc-span {
        grid-row: auto;
        grid-column: 1;
        height: 250px;
    }
}

/* --- Landscape Suggestion Overlay --- */
#orientation-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg);
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

@media (max-width: 900px) and (orientation: portrait) {
    #orientation-overlay {
        display: flex; /* Only shows on small portrait screens */
    }
}