/* SF84 Raw Synth - DIY Industrial Scrap Metal Theme */
:root {
    --bg-dark: #090a0d;
    --card-bg: #121318;
    --border-color: #2b2e38;
    --text-primary: #e2e4e9;
    --text-secondary: #8a8f9d;
    --color-rust: #d35400;
    --color-gold: #ff9d00;
    --color-cyan: #00d2ff;
    --color-green: #39ff14;
    --font-stack: 'Share Tech Mono', 'Space Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-stack);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 40px 20px;
    transition: background 0.3s ease;
}

body.theme-brushed {
    background-color: #1c1d24;
    background-image: 
        linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.4) 100%),
        radial-gradient(circle at 50% 20%, rgba(211, 84, 0, 0.16) 0%, transparent 65%),
        repeating-linear-gradient(90deg, #15161b 0px, #15161b 2px, #22242e 3px, #22242e 5px, #15161b 6px);
    background-blend-mode: normal, screen, normal;
}

body.theme-tread {
    background-color: #17181c;
    background-image:
        linear-gradient(45deg, #0f1013 25%, transparent 25%), 
        linear-gradient(-45deg, #0f1013 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #0f1013 75%), 
        linear-gradient(-45deg, transparent 75%, #0f1013 75%);
    background-size: 32px 32px;
    background-position: 0 0, 0 16px, 16px -16px, -16px 0px;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.95);
    background-blend-mode: normal;
}

body.theme-tread::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(211, 84, 0, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

body.theme-rusted {
    background-color: #15161c;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(92, 45, 18, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(92, 45, 18, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(211, 84, 0, 0.14) 0%, transparent 65%),
        linear-gradient(to right, #090a0c 2px, transparent 2px),
        linear-gradient(to bottom, #090a0c 2px, transparent 2px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 200px 200px, 200px 200px;
    box-shadow: inset 0 0 140px rgba(0,0,0,0.95);
    background-blend-mode: normal;
}

/* Spark/Furnace Glow Background */
.background-radial {
    position: absolute;
    width: 1200px;
    height: 1200px;
    background: radial-gradient(circle, rgba(211, 84, 0, 0.07) 0%, rgba(13, 14, 17, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 720px;
    z-index: 1;
}

/* Stenciled Header */
.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
    color: #f1f2f6;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.15), 2px 2px 0px #111;
    position: relative;
    display: inline-block;
}



.header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Stenciled Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    background: #181920;
    border: 2px solid #2f3240;
    color: var(--text-secondary);
    font-family: var(--font-stack);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 2px 4px rgba(0,0,0,0.3);
}

.tab-btn:hover {
    border-color: #4a4f66;
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--color-rust);
    border-color: var(--color-rust);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(211, 84, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Heavy DIY Metal Plate Casing */
.generator-card {
    background: var(--card-bg);
    border: 3px double #3a3d4d;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), inset 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
}

/* Rusted Metal Side Ribbons */
.generator-card::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    bottom: 20px;
    width: 8px;
    background: linear-gradient(to right, #5c2d12, #301708);
    border-radius: 4px 0 0 4px;
    border-left: 1px solid #7c3f1a;
}

.generator-card::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 20px;
    bottom: 20px;
    width: 8px;
    background: linear-gradient(to left, #5c2d12, #301708);
    border-radius: 0 4px 4px 0;
    border-right: 1px solid #7c3f1a;
}

/* Mechanical Flathead Screws styling */
.screw {
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #888899 20%, #4f515e 60%, #1e1f26 95%);
    border-radius: 50%;
    position: absolute;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.15), 1px 1px 3px rgba(0,0,0,0.7);
    z-index: 10;
}

.screw::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 2px;
    width: 10px;
    height: 2px;
    background: #111116;
}

.screw.tl { top: 10px; left: 10px; }
.screw.tr { top: 10px; right: 10px; }
.screw.bl { bottom: 10px; left: 10px; }
.screw.br { bottom: 10px; right: 10px; }

/* DIY Modules / Panel Sections */
.panel-section {
    position: relative;
    background: #16171d;
    border: 2px solid #282a35;
    border-radius: 8px;
    padding: 24px 20px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
}

.panel-section h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #e2e4e9;
    border-bottom: 1px solid #282a35;
    padding-bottom: 5px;
}

/* Realistic Glass LED Indicator Bulbs */
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #555 10%, #222 70%);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.05);
    border: 1px solid #111;
    position: relative;
    transition: all 0.2s ease;
}

.dot::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 3px;
    height: 3px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
}

.dot.gold { background: radial-gradient(circle, #ffe169 20%, #b87b00 70%); box-shadow: 0 0 12px #ff9d00, inset 0 1px 0 rgba(255,255,255,0.4); }
.dot.cyan { background: radial-gradient(circle, #7eeaff 20%, #0088b8 70%); box-shadow: 0 0 12px #00d2ff, inset 0 1px 0 rgba(255,255,255,0.4); }
.dot.purple { background: radial-gradient(circle, #dca1ff 20%, #631aa8 70%); box-shadow: 0 0 12px #9c27b0, inset 0 1px 0 rgba(255,255,255,0.4); }

/* Control Layouts */
.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-label span {
    font-weight: 700;
    color: #ffffff;
    background: #0f1013;
    padding: 0 6px;
    border-radius: 2px;
    font-size: 0.8rem;
    border: 1px solid #21232c;
}

/* Custom Mechanical Slider Faders */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

input[type="range"]:focus {
    outline: none;
}

/* Groove / Track */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #090a0d;
    border: 1px solid #23252e;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

/* Mechanical Fader Handle */
input[type="range"]::-webkit-slider-thumb {
    height: 22px;
    width: 12px;
    border-radius: 2px;
    background: linear-gradient(to right, #2c2e38, #4e5264 45%, #767b93 50%, #4e5264 55%, #2c2e38);
    border: 1px solid #000000;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
}

/* Indicator strip on fader thumb */
input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(to right, #333 15%, var(--color-rust) 45%, var(--color-rust) 55%, #333 85%);
}

/* Action Section Controls */
.actions-section {
    background: #16171d;
    border: 2px solid #282a35;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.button-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.playback-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

audio {
    width: 100%;
    height: 36px;
    filter: invert(90%) hue-rotate(180deg);
}

/* Status Readout Boxes */
.status-box {
    background: #090a0d;
    border: 2px dashed #21232d;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 5px 0;
    word-break: break-all;
}

.status-box.generating {
    color: var(--color-cyan);
    border-color: var(--color-cyan);
}

.status-box.success {
    color: var(--color-green);
    border-color: var(--color-green);
}

.status-box.error {
    color: #ff3344;
    border-color: #ff3344;
}

/* Heavy Backlit Push-Buttons */
.btn-primary, .btn-secondary, .btn-live, .btn-style {
    background: #1d1f27;
    border: 2px solid #363948;
    color: #e2e4e9;
    border-radius: 4px;
    padding: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-stack);
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 2px 4px rgba(0,0,0,0.3);
}

.btn-primary:hover, .btn-secondary:hover, .btn-live:hover, .btn-style:hover {
    border-color: #4f536b;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 8px rgba(0,0,0,0.4);
}

.btn-primary:active, .btn-secondary:active, .btn-live:active, .btn-style:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    background: #15161b;
}

/* Custom Highlight States */
.btn-primary {
    background: #3a1c0d;
    border-color: var(--color-rust);
    color: #ff8833;
}

.btn-primary:hover {
    background: #502713;
    border-color: #ff8833;
    box-shadow: 0 0 12px rgba(211, 84, 0, 0.3);
}

.btn-live.active {
    background: #0f351d;
    border-color: var(--color-green);
    color: var(--color-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.35);
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.5);
}

/* Preset buttons styling */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 5px;
}

.btn-style.active {
    background: #113545;
    border-color: var(--color-cyan);
    color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Retro CRT CLI Terminal Styling */
.terminal-window {
    background: #020204;
    border: 3px solid #2b2e38;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    margin-bottom: 20px;
}

.terminal-header {
    background: #111216;
    border-bottom: 2px solid #2b2e38;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.t-btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.3);
}

.t-btn.close { background: #ff5f56; }
.t-btn.minimize { background: #ffbd2e; }
.t-btn.maximize { background: #27c93f; }

.terminal-title {
    color: var(--text-secondary);
    font-family: var(--font-stack);
    font-size: 0.8rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-transform: lowercase;
}

.terminal-screen {
    position: relative;
    height: 520px;
    background: #020203;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Share Tech Mono', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.45;
    outline: none;
    border: 1px solid transparent;
}

.terminal-screen:focus {
    border-color: rgba(57, 255, 20, 0.2);
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 4px 100%;
    z-index: 2;
    pointer-events: none;
}

.terminal-body {
    white-space: pre;
    color: #39ff14;
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.65);
}

.terminal-body span.cyan-text {
    color: #00d2ff;
    text-shadow: 0 0 4px rgba(0, 210, 255, 0.65);
}

.terminal-body span.green-text {
    color: #39ff14;
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.65);
}

.terminal-body span.gold-text {
    color: #ff9d00;
    text-shadow: 0 0 4px rgba(255, 157, 0, 0.65);
}

.terminal-body span.white-text {
    color: #ffffff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.65);
}

.terminal-body span.selected-row {
    background: rgba(57, 255, 20, 0.15);
    display: inline-block;
    width: 100%;
}

.terminal-instructions {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.terminal-instructions .key {
    background: #181920;
    border: 1px solid #2f3240;
    padding: 2px 6px;
    border-radius: 3px;
    color: #ffffff;
    font-family: var(--font-stack);
    margin: 0 2px;
}

/* Theme Selector Panel */
.theme-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.theme-selector .label {
    font-family: var(--font-stack);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theme-btn {
    background: #14151a;
    border: 1px solid #282a35;
    color: var(--text-secondary);
    font-family: var(--font-stack);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.theme-btn:hover {
    border-color: #3f4253;
    color: var(--text-primary);
}

.theme-btn.active {
    background: #0f1013;
    border-color: var(--color-rust);
    color: var(--color-rust);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    text-shadow: 0 0 2px rgba(211, 84, 0, 0.3);
}
