/*
 * X1 Radio — Visualizer Styles
 * CH3 4-panel layout, DIMENSION.EXE panel, vortex player, raccoon panel
 */

/* ===== CH3 4-PANEL BACKGROUND ===== */
.ch3-bg {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  background: var(--bg-black);
}

.ch3-bg.visible {
  display: grid;
  grid-template-columns: 65% 35%;
  grid-template-rows: 1fr;
}

.ch3-panel-left {
  position: relative;
  border-right: 3px double var(--border-panel);
}

.ch3-panel-right {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
}

.ch3-panel {
  position: relative;
  overflow: hidden;
  background: var(--bg-black);
}

.ch3-panel canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ch3-panel-right .ch3-panel:not(:last-child) {
  border-bottom: 3px double var(--border-panel);
}

.ch3-panel-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-family: var(--font-dos);
  font-size: 10px;
  color: var(--border-panel);
  z-index: 10;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Mobile: stack panels */
@media (max-width: 767px) {
  .ch3-bg.visible {
    grid-template-columns: 1fr;
    grid-template-rows: 50% 25% 25%;
  }
  .ch3-panel-left {
    border-right: none;
    border-bottom: 3px double var(--border-panel);
  }
  .ch3-panel-right {
    display: contents;
  }
  .ch3-panel-right .ch3-panel {
    border-bottom: 3px double var(--border-panel);
  }
  .ch3-panel-right .ch3-panel:last-child {
    border-bottom: none;
  }
}

/* ===== DIMENSION.EXE PANEL (CH3 controls) ===== */
.dimension-panel {
  display: none;
  position: fixed;
  top: 87px;
  right: 20px;
  background: rgba(0, 0, 128, 0.5);
  backdrop-filter: blur(10px);
  padding: 0;
  border: 3px double var(--dos-border);
  width: 280px;
  font-family: var(--font-dos);
  z-index: 100;
}

.dimension-panel.open {
  display: flex;
  flex-direction: column;
}

.dimension-panel .dos-titlebar {
  padding: 3px 10px;
  font-size: 12px;
}

.dimension-panel .dos-content {
  padding: 12px 16px;
}

.dimension-panel .control-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.dimension-panel .control-row:last-child {
  margin-bottom: 0;
}

.dimension-panel .control-label {
  font-size: 11px;
  color: var(--neon-green);
  width: 100px;
  flex-shrink: 0;
}

.dimension-panel.locked .dos-content {
  position: relative;
}

/* Dimension panel wallet lock — compact variant */
.dimension-lock-message {
  color: var(--text-dim);
  font-size: 10px;
  margin-bottom: 8px;
}

.dimension-wallet-btn {
  background: var(--dos-navy);
  color: var(--text-primary);
  border: 1px solid var(--dos-border);
  padding: 6px 12px;
  font-family: var(--font-dos);
  font-size: 11px;
  cursor: pointer;
}

/* Vortex MP4 player (hidden, absolute positioned) */
.vortex-mp4-player {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-black);
  object-fit: contain;
}

/* Popup paragraph indent */
.popup-indent {
  margin-left: 1em;
  margin-top: 0.3em;
}

.dimension-panel .wallet-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 20, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.dimension-panel:not(.locked) .wallet-lock-overlay {
  display: none;
}

/* ===== VORTEX PANEL (CH3 video player) ===== */
.vortex-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 128, 0.85);
  backdrop-filter: blur(10px);
  border: 3px double var(--dos-border);
  font-family: var(--font-dos);
  z-index: 100;
  width: 800px;
  min-width: 400px;
  max-width: calc(100vw - 40px);
  resize: both;
  overflow: hidden;
  cursor: default;
}

.vortex-panel.visible {
  display: block;
}

.vortex-panel.dragging {
  transform: none;
  cursor: move;
}

.vortex-panel .dos-titlebar {
  padding: 3px 10px;
  font-size: 12px;
  cursor: move;
  user-select: none;
}

.vortex-video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: var(--bg-black);
}

.vortex-video-container iframe,
.vortex-video-container #vortexPlayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Invisible overlay to block YouTube's play button */
.vortex-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
  background: transparent;
}

/* Logo overlay shown between YouTube videos */
.vortex-logo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  background: var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.vortex-logo-overlay img {
  max-width: 30%;
  max-height: 30%;
  opacity: 0.7;
}

.vortex-info {
  padding: 8px 10px;
  background: var(--dos-navy);
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8;
}

.vortex-panel:hover .vortex-info {
  display: block;
}

.vortex-title {
  color: var(--neon-green);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.vortex-progress {
  height: 4px;
  background: var(--dos-navy-dark);
  border-radius: 2px;
  overflow: hidden;
}

.vortex-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  width: 0%;
  transition: width 0.5s linear;
}

.vortex-time {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Vortex panel mobile */
@media (max-width: 767px) {
  .vortex-panel {
    top: 44px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    transform: none !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
    z-index: 150;
    resize: none !important;
  }

  .vortex-panel .vortex-video-container {
    padding-top: 56.25%; /* Keep 16:9 aspect */
  }

  .vortex-panel .vortex-info {
    padding: 6px 10px;
  }

  .vortex-panel .vortex-title {
    font-size: 11px;
  }

  .vortex-panel:not(.visible) {
    display: none !important;
  }
}

/* ===== RACCOON LOOP PANEL ===== */
.raccoon-panel {
  display: none;
  position: fixed;
  bottom: 45px;
  left: 20px;
  background: rgba(0, 0, 128, 0.85);
  backdrop-filter: blur(10px);
  border: 3px double var(--dos-border);
  font-family: var(--font-dos);
  z-index: 100;
  overflow: hidden;
}

.raccoon-panel.visible {
  display: block;
}

.raccoon-panel.dragging {
  cursor: move;
}

.raccoon-panel .dos-titlebar {
  padding: 2px 8px;
  font-size: 10px;
  cursor: move;
  user-select: none;
}

.raccoon-panel .resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 60%, var(--dos-border) 60%);
}

.raccoon-panel video {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  background: var(--bg-black);
}

/* Raccoon panel mobile - smaller */
@media (max-width: 767px) {
  .raccoon-panel {
    bottom: 60px !important;
    right: 10px !important;
    z-index: 90;
  }

  .raccoon-panel video {
    width: 100px !important;
    height: 100px !important;
  }

  .raccoon-panel .resize-handle {
    display: none;
  }
}
