/* ============================================
   Dark Mode Professional Mixer Theme
   Clean, modern, inspired by digital consoles (X32, etc.)
   ============================================ */

:root {
    --bg: #0f0f0f;
    --panel: #1a1a1a;
    --panel2: #242424;
    --border: #333;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #00c853;      /* Pro green */
    --accent2: #ffab00;     /* Warning / Behringer-ish */
    --fader-green: #00e676;
    --danger: #ff5252;
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: #64b5f6; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin-top: 0; color: #fff; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
nav {
    background: #111;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
nav .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}
nav .brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: -.5px;
}
nav .nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}
nav .nav-links a {
    color: var(--text);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
}
nav .nav-links a:hover { background: #222; }
nav .nav-links .active { color: var(--accent); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    text-decoration: none;
}
.btn:hover { background: #444; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #000; font-weight: 700; }
.btn-primary:hover { background: #00e676; }
.btn-danger { background: var(--danger); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-remove {
    background: transparent;
    color: #ff5252;
    border: 1px solid #ff5252;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forms & Inputs */
input, select, textarea {
    background: #222;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}
input[type="number"], input[type="text"] { width: 100%; }
.small-input { width: 70px; padding: 4px 8px; font-size: 0.85rem; }

/* Mixer Console */
.mixer-console {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 20px 10px;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 520px;
    scrollbar-width: thin;
}
.mixer-console::-webkit-scrollbar { height: 6px; }
.mixer-console::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.channel-strip {
    min-width: 168px;
    max-width: 168px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow);
    position: relative;
    flex-shrink: 0;
}

.strip-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.ch-number input {
    width: 42px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 2px;
}
.ch-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.color-select {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
}

/* Fader */
.fader-pan-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
}
.fader-group, .pan-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mini-label {
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.fader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.fader {
    width: 26px;
    height: 170px;
    -webkit-appearance: slider-vertical;
    writing-mode: bt-lr;
    direction: rtl;
    accent-color: var(--fader-green);
    background: #111;
    border-radius: 999px;
    border: 1px solid #333;
}
.fader-value {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    min-width: 52px;
}
.fader-db { color: var(--fader-green); }

/* Pan */
.pan-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
}
.pan-slider {
    width: 100%;
    accent-color: #64b5f6;
}
.pan-value {
    font-size: 0.8rem;
    margin-top: 2px;
}
.pan-pos { font-weight: 700; }
.pan-label { color: var(--text-muted); font-size: 0.7rem; }

/* Mute/Solo */
.mute-solo {
    display: flex;
    gap: 6px;
    justify-content: center;
}
.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 4px 0;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #2a2a2a;
    border: 1px solid #444;
    cursor: pointer;
    user-select: none;
}
.toggle-btn.active, .toggle-btn:has(input:checked) {
    background: var(--danger);
    color: white;
    border-color: #c62828;
}
.toggle-btn.solo.active, .toggle-btn.solo:has(input:checked) {
    background: #ffab00;
    color: #000;
    border-color: #ff8f00;
}
.toggle-btn input { display: none; }

/* Preamp */
.preamp-section {
    background: #111;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}
.pre-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.pre-row.checkboxes {
    gap: 12px;
    font-size: 0.75rem;
}

/* Processor Sections (Gate, Comp, EQ) - OLD styles removed, new styles below */

/* Read-only view */
.read-only-processors {
    font-size: 0.75rem;
    background: #111;
    padding: 8px;
    border-radius: 4px;
}
.proc-summary { margin: 3px 0; }

/* Cards & Lists */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.set-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.set-card .meta { color: var(--text-muted); font-size: 0.85rem; }
.set-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table th { background: #1f1f1f; font-weight: 600; font-size: 0.85rem; }
.admin-table tr:hover { background: #1a1a1a; }

/* Flash messages */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
}
.flash.success { background: #1b3a1b; border: 1px solid #2e7d32; color: #a5d6a7; }
.flash.error { background: #3a1b1b; border: 1px solid #c62828; color: #ef9a9a; }

/* Responsive */
@media (max-width: 768px) {
    .mixer-console { padding: 10px 4px; }
    .channel-strip { min-width: 148px; }
    .fader { height: 140px; }
}

/* Print styles for text export */
@media print {
    nav, .btn, .actions, details { display: none !important; }
    .channel-strip { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
}

/* ============================================
   New Channel Strip Header Layout
   ============================================ */
.strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.ch-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ch-number {
    flex-shrink: 0;
}

.ch-number input {
    width: 44px;
    text-align: center;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 4px 2px;
    background: #111;
    border-color: var(--accent);
}

.ch-name {
    flex: 1;
    min-width: 60px;
    font-weight: 600;
    font-size: 0.95rem;
    background: #1a1a1a;
}

.ch-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.color-select {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    font-size: 0.7rem;
    font-weight: 700;
    text-shadow: 0 0 2px #000;
}

/* ============================================
   Processor Sections (Gate, Comp, EQ)
   ============================================ */
.processor {
    background: #111;
    border-radius: 4px;
    border: 1px solid #333;
    margin-top: 6px;
    overflow: hidden;
}

.processor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    user-select: none;
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border-bottom: 1px solid transparent;
    transition: background 0.1s, border-color 0.1s;
}

.processor-header:hover {
    background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
}

.processor-header:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.processor-header .status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: #333;
    color: var(--text-muted);
}

.processor-header .status.on {
    background: var(--accent);
    color: #000;
}

.processor-header .expand-icon {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.processor[open] .processor-header .expand-icon,
.processor.expanded .processor-header .expand-icon {
    transform: rotate(180deg);
}

.processor-body {
    padding: 10px 12px;
    font-size: 0.75rem;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

.processor-body.collapsed {
    display: none;
}

/* Ensure proc-body shows when processor is open/enabled */
.processor[open] .proc-body,
.processor.expanded .proc-body {
    display: block;
}

/* Proc toggle checkbox */
.proc-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

.proc-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* Proc grid for Gate/Comp */
.proc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
}

.proc-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.proc-grid label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.proc-grid input,
.proc-grid select {
    padding: 4px 8px;
    font-size: 0.8rem;
    background: #222;
}

/* ============================================
   EQ Section - Full Parametric with Graph
   ============================================ */
.eq-graph {
    background: #0a0a0a;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #222;
    position: relative;
}

.eq-canvas {
    width: 100%;
    height: 100px;
    display: block;
    background: linear-gradient(180deg, #0d0d0d 0%, #111 100%);
    border-radius: 3px;
}

.eq-bands {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eq-band {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 8px 10px;
    transition: border-color 0.15s;
}

.eq-band:hover {
    border-color: #3a3a3a;
}

.eq-band-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.eq-band-header strong {
    font-size: 0.75rem;
    color: #90caf9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eq-band-header select {
    flex: 1;
    max-width: 110px;
    padding: 3px 8px;
    font-size: 0.7rem;
    background: #222;
    border-color: #333;
}

.eq-band-header input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.eq-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.eq-param {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eq-param label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eq-param input {
    padding: 5px 8px;
    font-size: 0.8rem;
    background: #222;
    border-color: #333;
}

/* Make channel strip wider to accommodate EQ graph */
.channel-strip {
    min-width: 200px;
    max-width: 200px;
}

/* Responsive: wider strips on larger screens */
@media (min-width: 1200px) {
    .channel-strip {
        min-width: 220px;
        max-width: 220px;
    }
}

@media (max-width: 768px) {
    .channel-strip {
        min-width: 180px;
        max-width: 180px;
    }
    .eq-controls {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .eq-param input {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
}

/* Channel Actions (bottom of strip) */
.channel-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #222;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #333;
    color: var(--text);
    transform: translateY(-1px);
}

.action-btn.delete:hover {
    background: #3d1a1a;
    color: var(--danger);
}

.action-btn.share:hover {
    background: #1a2a3d;
    color: #64b5f6;
}

.action-btn.duplicate:hover {
    background: #1a3d2a;
    color: var(--accent);
}
