:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-amber: #f59e0b;
    --accent-right: #ef4444; /* Red for Right */
    --accent-left: #3b82f6;  /* Blue for Left */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --surface: #020617;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--surface);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 90%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

/* Header */
.calc-header { margin-bottom: 40px; }
.nav-top { margin-bottom: 20px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-amber);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 14px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
}
.back-link:hover { transform: translateX(-4px); background: rgba(245, 158, 11, 0.1); }

.hero-title { font-size: 3rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.hero-subtitle { color: var(--text-secondary); margin-top: 10px; font-size: 1.1rem; }

/* Grid Layout */
.grid-layout { display: grid; grid-template-columns: 360px 1fr; gap: 30px; margin-bottom: 30px; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
}

/* Controls */
.control-section { margin-bottom: 30px; }
.section-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-amber); margin-bottom: 15px; font-weight: 700; }

.ear-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ear-btn {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.ear-btn.active { border-color: currentColor; background: rgba(255,255,255,0.05); }
#btn-right.active { color: var(--accent-right); }
#btn-left.active { color: var(--accent-left); }
.ear-symbol { font-size: 1.5rem; font-weight: 900; }

.freq-input-grid { display: grid; gap: 12px; }
.freq-input-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.freq-label { font-size: 0.9rem; color: var(--text-secondary); min-width: 60px; }
.dB-input-wrapper { flex-grow: 1; display: flex; align-items: center; gap: 10px; }
.dB-input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-weight: 600;
}

/* Options */
.option-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(244, 63, 94, 0.2);
    background: rgba(244, 63, 94, 0.05);
    color: #f43f5e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.action-btn:hover { background: rgba(244, 63, 94, 0.1); }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: #fff; transition: .4s; }
input:checked + .slider { background-color: var(--accent-amber); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

/* Chart Area */
.display-column { display: flex; flex-direction: column; gap: 30px; }
.chart-panel { position: relative; padding: 20px; min-height: 400px; }
.chart-container { position: relative; height: 400px; width: 100%; }
.chart-legend { display: flex; justify-content: center; gap: 30px; margin-top: 15px; font-size: 0.85rem; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.red { background: var(--accent-right); box-shadow: 0 0 8px var(--accent-right); }
.legend-dot.blue { background: var(--accent-left); box-shadow: 0 0 8px var(--accent-left); }

/* Results */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.result-card { display: flex; flex-direction: column; justify-content: center; min-height: 140px; }
.mini-title { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-amber); margin-bottom: 12px; }

.pta-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.pta-item { display: flex; flex-direction: column; }
.pta-label { font-size: 0.75rem; color: var(--text-secondary); }
.pta-value { font-size: 1.5rem; font-weight: 800; color: #fff; }
#status-desc { font-weight: 700; color: var(--accent-amber); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem; }

.impairment-value { font-size: 2.5rem; font-weight: 900; color: #fff; line-height: 1; margin-bottom: 8px; }
.impairment-desc { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 10px; }
.monaural-split { display: flex; gap: 15px; font-size: 0.85rem; font-weight: 600; }
#mon-r { color: var(--accent-right); }
#mon-l { color: var(--accent-left); }

/* Methodology */
.methodology-details h3 { font-size: 1.5rem; margin-bottom: 25px; }
.methods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.method-card { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); padding: 20px; border-radius: 16px; }
.method-card h5 { margin: 0 0 10px; color: var(--accent-amber); font-size: 1rem; }
.method-card p { margin: 0 0 8px; font-weight: 600; font-size: 0.95rem; }
.method-card small { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.4; }

@media (max-width: 900px) {
    .grid-layout { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr; }
}
