/* =========================================================
   APP LAYOUT
========================================================= */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

body[data-dashboard-sidebar-externalized="true"] .sidebar {
  display: none;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100%;
  overflow-y: auto;
  background: var(--ui-panel);
  border-right: 2px solid var(--ui-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.24);
}

.sidebar-section h3 {
  margin: 0 0 12px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1px solid var(--ui-border);
  padding-bottom: 6px;
}

.sidebar-section {
  width: 100%;
}

.upload-btn {
  background: var(--accent);
  color: black;
  padding: 8px 12px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}

.upload-btn:hover { background: #fff; }

.sidebar-footer {
  margin-top: auto;
}

/* =========================================================
   MAIN CONTENT
========================================================= */

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 20px;
  gap: 16px;
}

/* =========================================================
   VISUALIZER CONTAINER
========================================================= */

#visualizer-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #111 0%, #000 100%);
  position: relative;
  min-height: 0;
  padding: 20px;
}

#visualizer-container canvas {
  width: 100%;
  height: 100%;
}

/* =========================================================
   UPLOAD BUTTON
========================================================= */

input[type="file"] { display: none; }

/* =========================================================
   VISUAL SETTINGS
========================================================= */

.visual-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}

.visual-settings label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.3;
}

/* =========================================================
   SELECT / DROPDOWNS
========================================================= */

select {
  background: var(--ui-panel);
  color: var(--accent);
  border: 1px solid var(--ui-border);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

select:hover {
  border-color: var(--accent);
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.15);
}

/* =========================================================
   RANGE SLIDERS
========================================================= */

input[type="range"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* =========================================================
   CUSTOM DROPDOWNS
========================================================= */

.custom-select-wrapper {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-selected {
  background: var(--ui-panel);
  color: var(--accent);
  border: 1px solid var(--ui-border);
  padding: 8px 32px 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 1000;
}

.custom-select-selected::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--accent);
}

.custom-select-selected:hover {
  border-color: var(--accent);
}

.custom-select-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ui-panel);
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  z-index: 1001;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 2px;
}

.custom-select-options.open {
  display: block;
}

.custom-select-option {
  padding: 8px 12px;
  color: var(--ui-text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.custom-select-option:hover {
  background: rgba(255,255,255,0.08);
}

.custom-select-option.active {
  color: var(--accent);
  font-weight: bold;
}

.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

/* =========================================================
   PLAYBACK CONTROLS (main area - below canvas)
========================================================= */

.playback-controls-main {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  flex-shrink: 0;
}

.control-btn,
.volume-toggle-btn {
  background: var(--accent);
  color: black;
  border: none;
  padding: 8px 20px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 12px;
  transition: all 0.2s;
}

.control-btn:hover,
.volume-toggle-btn:hover {
  background: #fff;
  transform: scale(1.05);
}

.control-btn:disabled,
.volume-toggle-btn:disabled {
  background: #666;
  color: #333;
  cursor: not-allowed;
  transform: scale(1);
}

.time-display-main {
  font-size: 12px;
  color: var(--accent);
  min-width: 100px;
  text-align: center;
}

/* =========================================================
   VOLUME GROUP (toggle button + panel wrapper)
========================================================= */

.volume-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

.volume-toggle-btn {
  padding: 8px 14px;
  font-size: 16px;
  min-width: 40px;
}

/* =========================================================
   VOLUME PANEL (collapsible, above toggle button)
========================================================= */

/* =========================================================
   VOLUME PANEL (collapsible, above toggle button)
========================================================= */

.volume-panel-main {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--ui-panel);
  border: 2px solid var(--ui-border);
  border-radius: 8px;
  padding: 10px 14px;
  z-index: 50;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 255, 65, 0.08);
  min-width: auto;
}

.volume-panel-main.visible {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: volumePanelIn 0.2s ease-out;
}

@keyframes volumePanelIn {
  from { 
    opacity: 0; 
    transform: translateY(6px) scale(0.95);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

/* Horizontal range slider */
.volume-slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-slider-container input[type="range"] {
  width: 140px;
  height: 6px;
  accent-color: var(--accent);
  cursor: pointer;
}

#volumeValueDisplay {
  font-size: 12px;
  color: var(--accent);
  text-align: center;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* Mute button */
.mute-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--ui-border);
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.mute-btn:hover {
  background: var(--accent);
  color: black;
}

.mute-btn.muted {
  opacity: 0.5;
}

/* =========================================================
   STATUS TEXT & PROGRESS BAR
========================================================= */

.status-text {
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  word-break: break-all;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #333;
  border: 1px solid #555;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}
