/* ==========================================================================
   YOUTUBE MUSIC JUKEBOX - MODERN GLASSMORPHIC DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #050507;
  --bg-surface: #0f1015;
  --bg-card: rgba(22, 23, 29, 0.7);
  --bg-card-hover: rgba(30, 32, 40, 0.85);
  --bg-elevated: #1a1b22;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 0, 51, 0.5);

  --accent-red: #FF0033;
  --accent-red-glow: rgba(255, 0, 51, 0.35);
  --accent-gradient: linear-gradient(135deg, #FF0033 0%, #FF3366 100%);
  --accent-purple: #8B5CF6;
  --accent-green: #10B981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);

  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px var(--accent-red-glow);

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient dynamic background lighting */
body::before {
  content: '';
  position: fixed;
  top: -15vw;
  left: -10vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(255, 0, 51, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

body::after {
  content: '';
  position: fixed;
  bottom: -15vw;
  right: -10vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}

/* Typography Headings */
h1, h2, h3, h4, h5, .brand-font {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   APP CONTAINER & LAYOUT
   ========================================================================== */

.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 20px 80px;
}

.host-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 32px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Card Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 0, 51, 0.15);
  color: #FF4D6D;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.host-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.host-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.host-pill-btn.connected {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9CA3AF;
  display: inline-block;
}

.host-pill-btn.connected .status-pulse-dot {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* ==========================================================================
   NOW PLAYING CARD (HERO)
   ========================================================================== */

.now-playing-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(25, 27, 34, 0.85) 0%, rgba(15, 16, 21, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.now-playing-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.25);
  opacity: 0.6;
  z-index: 0;
  transform: scale(1.15);
  transition: background-image 0.5s ease;
}

.now-playing-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 20px;
  align-items: center;
}

.song-art-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.song-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-green);
  margin-bottom: 6px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.song-details {
  flex: 1;
  min-width: 0;
}

.song-title {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.song-artist {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.song-requester {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.song-requester span {
  color: #E5E7EB;
  font-weight: 600;
}

/* Sound Wave Equalizer */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  margin-left: auto;
}

.equalizer-bar {
  width: 3.5px;
  background: var(--accent-red);
  border-radius: 3px;
  animation: equalize 1s infinite ease-in-out;
}

.equalizer-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.equalizer-bar:nth-child(2) { height: 95%; animation-delay: 0.3s; }
.equalizer-bar:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.equalizer-bar:nth-child(4) { height: 80%; animation-delay: 0.4s; }

@keyframes equalize {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

/* Idle state banner */
.idle-banner {
  text-align: center;
  padding: 30px 20px;
}

.idle-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--text-secondary);
}

.idle-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.idle-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   REQUEST / INPUT FORM
   ========================================================================== */

.request-card {
  padding: 24px;
  margin-bottom: 28px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title svg {
  color: var(--accent-red);
  width: 20px;
  height: 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-field {
  width: 100%;
  background: rgba(10, 11, 15, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.15);
  background: rgba(15, 16, 22, 0.95);
}

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

.btn-primary {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-normal);
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 0, 51, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Instant Search Results Dropdown */
.search-results-box {
  margin-top: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: none;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-thumb {
  width: 52px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.search-info {
  flex: 1;
  min-width: 0;
}

.search-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-artist {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.search-add-btn {
  background: rgba(255, 0, 51, 0.15);
  color: #FF3366;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.search-item:hover .search-add-btn {
  background: var(--accent-red);
  color: #fff;
}

/* ==========================================================================
   QUEUE LIST
   ========================================================================== */

.queue-section {
  margin-bottom: 30px;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.queue-badge {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.queue-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.12);
}

.queue-pos {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.queue-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.queue-info {
  flex: 1;
  min-width: 0;
}

.queue-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.queue-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-requester {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.queue-requester strong {
  color: #D1D5DB;
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.delete-btn:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.12);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL / POPUP
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: translateY(20px) scale(0.96);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.qr-wrapper {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 16px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qr-url-text {
  font-family: monospace;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   HOST PLAYER SPECIAL STYLING
   ========================================================================== */

.host-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  flex: 1;
}

@media (max-width: 1024px) {
  .host-grid {
    grid-template-columns: 1fr;
  }
}

.host-player-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 30px;
  position: relative;
  overflow: hidden;
}

.host-art-container {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.host-art-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.host-song-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-song-artist {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.host-requester-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: #E5E7EB;
  margin-bottom: 28px;
}

.host-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}

.host-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: white;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.host-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

.host-ctrl-btn.play-btn {
  width: 68px;
  height: 68px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow);
}

.host-ctrl-btn.play-btn:hover {
  transform: scale(1.1);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 18px;
  border-radius: var(--radius-full);
}

.volume-slider {
  accent-color: var(--accent-red);
  cursor: pointer;
  width: 110px;
}

/* YouTube Video iframe container */
#yt-player-container {
  width: 100%;
  max-width: 480px;
  height: 270px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  display: block;
}
