@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg-dark: #0f0f13;
    --panel-bg: #18181f;
    --border: #2a2a35;
    --primary: #f59e0b; /* Amber/Orange from reference */
    --primary-glow: rgba(245, 158, 11, 0.4);
    --accent: #10b981;  /* Green for success */
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --sidebar-width: 280px;
    --radius: 12px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden; 
}

/* Preloader */
#preloader {
    position: fixed; inset: 0; background: var(--bg-dark); z-index: 9999;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.spinner {
    width: 40px; height: 40px; border: 4px solid #333; border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.badge { background: var(--primary); color: #000; padding: 2px 6px; border-radius: 4px; font-size: 0.6em; vertical-align: text-top; font-weight: bold; }

/* Grid Layout */
.studio-grid { display: flex; height: 100vh; width: 100%; }

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 24px;
    gap: 30px;
    overflow-y: auto;
}
.right-sidebar { border-right: none; border-left: 1px solid var(--border); }

.brand {
    font-size: 1.1rem; font-weight: 700; color: var(--text-main);
    display: flex; align-items: center; gap: 10px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border); letter-spacing: -0.5px;
}

.panel-section h3 {
    font-size: 0.75rem; color: var(--text-muted); margin-bottom: 15px;
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}

/* Tools List */
.tool-list { display: flex; flex-direction: column; gap: 18px; }
.tool-toggle {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.9rem; cursor: pointer; color: var(--text-muted); transition: 0.2s;
}
.tool-toggle:hover { color: var(--text-main); }
.tool-toggle span i { width: 20px; text-align: center; margin-right: 8px; }
.tool-toggle input { display: none; }
.toggle-slider {
    width: 36px; height: 20px; background: #333; border-radius: 20px; position: relative; transition: 0.3s;
}
.toggle-slider::before {
    content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px;
    background: white; border-radius: 50%; transition: 0.3s;
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(16px); }

/* Analysis Stats */
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box {
    background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    padding: 12px; border-radius: 8px; text-align: center;
}
.stat-box label { font-size: 0.7rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.stat-box strong { font-size: 1.1rem; color: var(--primary); font-weight: 700; }

/* Ad Containers */
.ad-sidebar {
    margin-top: auto; background: #000; border: 1px dashed #333;
    border-radius: 8px; height: 300px; display: flex; align-items: center; justify-content: center;
    position: relative;
}
.ad-tag { position: absolute; top: 5px; left: 5px; font-size: 9px; color: #555; background: #111; padding: 2px 4px; }

/* Main Workspace */
.workspace {
    flex-grow: 1; display: flex; flex-direction: column;
    background: var(--bg-dark); overflow-y: auto; padding: 30px; gap: 30px;
}

/* Header */
.studio-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--panel-bg); padding: 20px; border-radius: 16px;
    border: 1px solid var(--border);
}
.track-meta { display: flex; align-items: center; gap: 15px; }
.art-icon {
    width: 50px; height: 50px; background: #222; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    color: var(--text-muted); border: 2px solid var(--border);
}
.art-icon.playing { animation: spin 3s linear infinite; border-color: var(--primary); color: var(--primary); }
.meta-text h1 { font-size: 1rem; margin-bottom: 4px; font-weight: 700; }
.meta-text span { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }

.header-actions { display: flex; gap: 15px; align-items: center; }
.btn-primary {
    background: var(--primary); color: #000; border: none; padding: 10px 20px;
    border-radius: 8px; cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center;
    transition: 0.2s;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 15px var(--primary-glow); }
.btn-ghost { color: var(--text-muted); text-decoration: none; font-size: 1.2rem; }

/* Visualizer */
.vis-container {
    height: 180px; background: #000; border-radius: 16px; border: 1px solid var(--border);
    overflow: hidden; position: relative;
}
canvas { width: 100%; height: 100%; }

.ai-overlay {
    position: absolute; inset: 0; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: rgba(245, 158, 11, 0.05);
}
.hidden { display: none !important; }
.scanning-line {
    position: absolute; width: 100%; height: 2px; background: var(--primary);
    top: 0; animation: scan 2s linear infinite; box-shadow: 0 0 10px var(--primary);
}
.ai-overlay span {
    background: var(--primary); color: #000; padding: 4px 8px; font-size: 0.7rem; font-weight: bold;
    border-radius: 4px; z-index: 10;
}
@keyframes scan { 0% { top: 0%; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* Transport */
.transport-bar { display: flex; justify-content: center; gap: 20px; align-items: center; }
.btn-play {
    width: 65px; height: 65px; border-radius: 50%; background: var(--text-main);
    color: #000; border: none; font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 0 20px rgba(255,255,255,0.2); transition: 0.2s;
}
.btn-play:hover { transform: scale(1.05); }
.btn-control {
    width: 45px; height: 45px; border-radius: 50%; background: transparent;
    border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
}

/* FX Rack */
.fx-rack { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.fx-module {
    background: var(--panel-bg); border: 1px solid var(--border);
    border-radius: 16px; padding: 20px;
}
.mod-head {
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}

.slider-group { margin-bottom: 20px; }
.label-row { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 8px; color: var(--text-muted); }
.val { color: var(--primary); font-weight: 700; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; background: #2a2a35; border-radius: 3px; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 16px; width: 16px; margin-top: -5px;
    border-radius: 50%; background: #fff; cursor: pointer;
}

.toggles-row { display: flex; gap: 15px; }
.check-box { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; color: var(--text-muted); }
.check-box input { accent-color: var(--primary); }

/* Export Dock */
.export-dock {
    background: var(--panel-bg); border: 1px solid var(--border);
    border-radius: 16px; padding: 24px; display: flex; justify-content: space-between; align-items: center;
}
.export-status { flex-grow: 1; margin-right: 20px; }
#statusText { font-size: 0.9rem; color: var(--text-muted); }
#progressContainer { height: 6px; background: #333; margin-top: 8px; border-radius: 3px; overflow: hidden; }
#progressBar { height: 100%; width: 0%; background: var(--primary); transition: width 0.2s; }
.export-buttons { display: flex; gap: 10px; }
.btn-export { padding: 12px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.btn-export.secondary { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-export.secondary:hover { color: #fff; border-color: #fff; }
.btn-export.primary { background: var(--primary); border: none; color: #000; }
.btn-export.primary:hover { filter: brightness(1.1); box-shadow: 0 0 10px var(--primary-glow); }

/* Presets */
.preset-list { display: flex; flex-direction: column; gap: 10px; }
.btn-preset {
    padding: 12px; text-align: left; background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 8px; cursor: pointer; font-size: 0.9rem; transition: 0.2s;
}
.btn-preset:hover, .btn-preset.active { background: rgba(245, 158, 11, 0.1); border-color: var(--primary); color: #fff; }

.footer-legal { margin-top: auto; text-align: center; font-size: 0.75rem; color: #555; }
.legal-links { margin-top: 5px; }
.legal-links a { color: #666; text-decoration: none; margin: 0 5px; }

/* Mobile */
@media (max-width: 1024px) {
    .studio-grid { flex-direction: column; height: auto; overflow: visible; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 20px; }
    .workspace { overflow: visible; padding: 20px; }
    .ad-sidebar { display: none; } 
    .export-dock { flex-direction: column; gap: 15px; text-align: center; }
    .export-buttons { width: 100%; justify-content: center; }
}