/* =====================================================
   Gemini DJ Live - Radio Wave Visualization Theme
   Pure Frontend Version
   ===================================================== */

:root {
  /* Color palette - Cyberpunk/Neon */
  --bg-dark: #0a0a1a;
  --bg-gradient-1: #1a0a2e;
  --bg-gradient-2: #16213e;
  --bg-card: #1a1a2e;
  --accent-primary: #00f5ff;
  --accent-secondary: #ff00ff;
  --accent-tertiary: #ffcc00;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.5);
  --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5);
  --border: rgba(255, 255, 255, 0.1);
  --success: #00ff88;
  --warning: #ffcc00;
  --error: #ff4444;

  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;
}

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

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

.container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* =====================================================
   Background Animation
   ===================================================== */

.background-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      var(--bg-dark) 0%,
      var(--bg-gradient-1) 50%,
      var(--bg-gradient-2) 100%);
  z-index: -1;
  animation: gradientFlow 20s ease infinite;
  background-size: 400% 400%;
}

@keyframes gradientFlow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* =====================================================
   Settings Button
   ===================================================== */

.settings-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--accent-primary);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
}

.settings-btn:hover {
  background: rgba(0, 245, 255, 0.2);
  transform: rotate(90deg);
}

/* =====================================================
   Main Content Layout
   ===================================================== */

.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--spacing-xl);
  gap: var(--spacing-lg);
}

/* =====================================================
   Visual Area - Vinyl Style
   ===================================================== */

.visual-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xl);
}

.vinyl-container {
  position: relative;
  width: 300px;
  height: 300px;
}

.vinyl-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(0, 245, 255, 0.3) 0%,
      rgba(255, 0, 255, 0.2) 50%,
      transparent 70%);
  animation: pulseGlow 3s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulseGlow {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

.vinyl-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent-primary);
  box-shadow: var(--glow-cyan), inset 0 0 30px rgba(0, 245, 255, 0.2);
  z-index: 1;
  animation: vinylSpin 20s linear infinite;
}

.vinyl-frame.playing {
  animation: vinylSpin 4s linear infinite;
}

@keyframes vinylSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.visual-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vinyl-frame.playing .visual-image {
  animation: vinylSpinReverse 8s linear infinite;
}

@keyframes vinylSpinReverse {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

.vinyl-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(circle,
      var(--bg-dark) 30%,
      transparent 70%);
  border: 2px solid var(--accent-secondary);
}

.vinyl-spin-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-tertiary);
  box-shadow: 0 0 10px var(--accent-tertiary);
  z-index: 2;
}

/* =====================================================
   Status Area - Clock and Style
   ===================================================== */

.status-area {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-width: 280px;
}

.clock-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.clock {
  font-family: 'Orbitron', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-shadow: var(--glow-cyan);
  letter-spacing: 2px;
}

.clock-icon {
  font-size: 2rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.style-display {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: 12px;
  padding: var(--spacing-md);
}

/* Alias for redesigned Now Playing */
.now-playing-display {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: 12px;
  padding: var(--spacing-md);
}

.style-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Track name - main display */
.track-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--spacing-sm);
  line-height: 1.3;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Requester info */
.track-requester {
  font-size: 0.8rem;
  color: var(--accent-tertiary);
  margin-top: 4px;
  opacity: 0.9;
}

.track-requester.hidden {
  display: none;
}

/* Original user request content */
.track-request {
  font-size: 0.75rem;
  color: var(--accent-secondary);
  margin-top: 2px;
  font-style: italic;
  opacity: 0.85;
}

.track-request.hidden {
  display: none;
}

/* Style subtitle */
.style-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-sm);
  line-height: 1.4;
  opacity: 0.8;
}

.dj-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(255, 0, 255, 0.1);
  border: 1px solid rgba(255, 0, 255, 0.3);
  border-radius: 12px;
  animation: djGlow 1s ease-in-out infinite;
}

.dj-status.hidden {
  display: none;
}

@keyframes djGlow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
  }

  50% {
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
  }
}

.dj-icon {
  font-size: 1.5rem;
  animation: micPulse 0.5s ease-in-out infinite;
}

@keyframes micPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

.dj-text {
  color: var(--accent-secondary);
  font-weight: 500;
}

/* =====================================================
   Quick Controls
   ===================================================== */

.quick-controls {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--border);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: rgba(0, 245, 255, 0.2);
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.control-btn.active {
  background: rgba(0, 245, 255, 0.3);
  border-color: var(--accent-primary);
}

/* =====================================================
   Waveform Visualization
   ===================================================== */

.waveform-container {
  width: 100%;
  max-width: 800px;
  height: 80px;
  position: relative;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* =====================================================
   Chat Overlay
   ===================================================== */

.chat-overlay {
  position: absolute;
  bottom: var(--spacing-lg);
  left: var(--spacing-lg);
  width: 400px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(0, 245, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chat-icon {
  font-size: 1rem;
}

.yt-status {
  margin-left: auto;
  color: var(--error);
  font-size: 0.75rem;
}

.yt-status.connected {
  color: var(--success);
}

.chat-messages {
  padding: var(--spacing-sm);
  max-height: 120px;
  min-height: 60px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  flex: 1;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 255, 0.3);
  border-radius: 2px;
}

.chat-message {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-message.is-request {
  background: rgba(255, 204, 0, 0.1);
  border-left: 3px solid var(--accent-tertiary);
}

.chat-message.is-dj {
  background: rgba(255, 0, 255, 0.1);
  border-left: 3px solid var(--accent-secondary);
}

.chat-author {
  font-weight: 500;
  color: var(--accent-primary);
  white-space: nowrap;
}

.chat-message.is-dj .chat-author {
  color: var(--accent-secondary);
}

.chat-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  word-break: break-word;
}

/* YouTube Status Container */
.yt-status-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.yt-status-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.yt-status.connected+.yt-status-text {
  color: var(--success);
}

/* Direct Chat Input */
.chat-input-container {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input:focus {
  border-color: var(--accent-primary);
  background: rgba(0, 245, 255, 0.08);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: var(--bg-dark);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.5);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

/* =====================================================
   Modal Styles
   ===================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.25rem;
  color: var(--accent-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: var(--error);
  color: var(--error);
}

.modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border);
}

.settings-section {
  margin-bottom: var(--spacing-lg);
}

.settings-section h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-group small a {
  color: var(--accent-primary);
  text-decoration: none;
}

.form-group small a:hover {
  text-decoration: underline;
}

.style-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.preset-btn {
  padding: 10px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(0, 245, 255, 0.1);
}

.preset-btn.active {
  border-color: var(--accent-primary);
  background: rgba(0, 245, 255, 0.2);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-dark);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 245, 255, 0.3);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

.btn.secondary:hover {
  background: rgba(0, 245, 255, 0.1);
}

.form-row {
  display: flex;
  gap: var(--spacing-md);
}

.form-group.half {
  flex: 1;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
  .visual-area {
    flex-direction: column;
  }

  .vinyl-container {
    width: 200px;
    height: 200px;
  }

  .clock {
    font-size: 2rem;
  }

  .chat-overlay {
    width: calc(100% - var(--spacing-lg) * 2);
    left: var(--spacing-lg);
    right: var(--spacing-lg);
  }

  .style-presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   Placeholder Image
   ===================================================== */

.visual-image[src=""],
.visual-image:not([src]) {
  background: linear-gradient(135deg,
      var(--bg-gradient-1),
      var(--bg-gradient-2));
}

/* =====================================================
   OBS Mode Styles
   ===================================================== */

/* Hidden elements */
.settings-btn.hidden {
  display: none !important;
}

/* OBS mode body class - additional adjustments if needed */
body.obs-mode .settings-btn {
  display: none !important;
}

/* Optional: hide chat input in OBS mode if you want YouTube-only */
/* body.obs-mode .chat-input-container {
  display: none;
} */