/* --- GLOBAL & BODY SETUP --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: system-ui;
  background:#222;
  color:#eee;
  display:flex;
  justify-content:center;
  align-items:center;
}

.spacer-5  { height: 5px; }
.spacer-8  { height: 8px; }
.spacer-10 { height: 10px; }
.spacer-15 { height: 15px; }
.spacer-20 { height: 20px; }
.spacer-30 { height: 30px; }
.spacer-40 { height: 40px; }

.icon-nudge-up-pause {
  position: relative;
  top: -2px;
  display: inline-block;
}

.icon-nudge-up-play {
  position: relative;
  top: -1px;
  display: inline-block;
}

/* --- VISUALIZER CONTAINER --- */
#viz-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#viz-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viz-hidden canvas {
  visibility: hidden;
}

.shader-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

#shaderPower {
  font-size: 18px;
  color: #e44; /* subtle red hint for "off" */
}

#shaderPower.active {
  color: #4e4; /* green when ON */
}

/* Image becomes fullscreen background when shaders are OFF */
.background-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.draggable-img {
  position: absolute;
  top: 660px;
  left: 50px;
  width: 436px;
  height: 246px;
  border-radius: 10px;
  border: 2px solid black;
  cursor: grab;
  z-index: 50;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* --- PLAYER CONTAINER (DRAGGABLE FLOATING WINDOW) --- */
.player {
  background: rgba(51, 51, 51, 0.95);
  z-index: 10;
  position: absolute;
  top: 50px;
  left: 50px;

  padding: 20px;
  border-radius: 10px;
  width: 400px;

  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  user-select: none;

  transition: height 0.25s ease, padding 0.25s ease;
}

.player-move:active {
  cursor: grabbing;
}

.player-move:hover {
  background: rgba(255,255,255,0.25);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Shared button style */
.player-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 16px;
  width: 24px;
  height: 24px;
  border: 2px solid black;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
}

.player-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* Move button specifics */
.player-move {
  cursor: grab;
}

.player-move:active {
  cursor: grabbing;
}

.controls-spacer {
  flex: 1;
}

/* --- COLLAPSED STATE --- */
.player.collapsed .control-to-hide-minimized {
  display: none !important;
}

.player.collapsed .keep-displayed-minimized {
  display: block !important;
}

.player.collapsed {
  height: auto;
  padding-bottom: 10px;
  overflow: visible;
}

/* --- CONTROLS ROW (toolbar) --- */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.controls .btn {
  position: relative;
}

.controls .btn img {
  display: block;
}

.controls img {
  width: 24px;
  height: 24px;
  border: 2px solid black;
  border-radius: 4px;
  box-sizing: border-box;
}

.controls .player-toggle {
  margin-left: auto;
  align-self: center;
}

/* --- TOOLTIP STYLES --- */
.tooltip {
  background: #000;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0s;
  position: absolute;
  transform: translateZ(0);
}

.tooltip.visible {
  opacity: 1;
  transition: opacity 0.2s;
}

.controls .tooltip {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
}

/* --- PROGRESS BAR --- */
.progress {
  width:100%;
  height:6px;
  background:#555;
  border-radius:3px;
  cursor:pointer;
}

.progress-fill {
  height:100%;
  width:0%;
  background:#66aaff;
  border-radius:3px;
}

/* --- TIME/META INFO --- */
.time {
  font-size:12px;
  display:flex;
  justify-content:space-between;
  width:100%;
}

.meta {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 2px;
}

/* --- CONTROL ROWS (speed, volume, filters) --- */
.control {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.control label {
  width: 80px;
  text-align: right;
  margin-right: 10px;
}

.control input[type="range"] {
  flex: 1;
}

/* --- EQ BLOCK --- */
.eq {
  display:flex;
  gap:12px;
  justify-content:center;
  width:100%;
  margin-top: 6px;
  margin-bottom: 6px;
}

.eq label { 
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  width:40px;
  font-size:10px;
  color:#ccc;
}

.eq input[type=range] {
  writing-mode: vertical-lr;
  direction: rtl;  
  width: 6px;
  height: 120px;
}

.freq-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size:10px;
  color:#ccc;
  display:flex;
  justify-content:center;
  align-items:center;
  height:40px;
}

/* --- ANALYZER CANVAS --- */
canvas#analyzer {
  background:#111;
  border-radius:4px;
  margin-top: 1px;
}

/* --- SLIDER WRAPPERS --- */
.slider-wrap-h input[type="range"] {
  flex: none;
  width: 300px;
}

.slider-wrap-h {
  position: relative;
  display: inline-block;
}

.slider-wrap-h .tooltip {
  position: absolute;
  left: 100%;
  margin-left: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.slider-wrap-v {
  position: relative;
  display: inline-block;
}

.slider-wrap-v .tooltip {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
}

.slider-wrap {
  position: relative;
  display: inline-block;
}

.slider-wrap .tooltip {
  position: absolute;
  left: 100%;
  margin-left: 6px;
  top: 50%;
  transform: translateY(-50%);
}
