/* ===== Variables con modo oscuro ===== */
:root {
  --bg: #fafaf7;
  --bg-alt: #f2f1ec;
  --text: #1a1a1a;
  --text-soft: #6b6b6b;
  --text-muted: #a8a8a3;
  --accent: #c65d3a;
  --accent-soft: #f5e6df;
  --border: #e8e8e3;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-alt: #1a1a1a;
  --text: #f5f5f5;
  --text-soft: #b3b3b3;
  --text-muted: #6b6b6b;
  --accent: #e67e5a;
  --accent-soft: #2a1f1a;
  --border: #2a2a2a;
  --white: #1f1f1f;
  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.brand h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.icon-btn.small {
  width: 32px;
  height: 32px;
}

.icon-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ===== Buscador ===== */
.search-section {
  padding: 24px 0;
  position: relative;
}

.search-box {
  position: relative;
  max-width: 600px;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--shadow);
}

.search-loading {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 100;
  display: none;
}

.search-results.visible {
  display: block;
}

.search-results ul {
  list-style: none;
}

.search-results li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-results li:hover {
  background: var(--bg-alt);
}

.search-results li img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.search-results .title {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results .channel {
  color: var(--text-soft);
  font-size: 13px;
}

/* ===== Main ===== */
.main {
  padding: 24px 0 32px;
  overflow-y: auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-btn {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-soft);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.text-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* ===== Queue ===== */
.queue {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.queue li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
  cursor: pointer;
}

.queue li:hover {
  background: var(--bg-alt);
}

.queue li.playing {
  background: var(--accent-soft);
}

.queue li.playing .title {
  color: var(--accent);
}

.queue li img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-alt);
}

.queue li .info {
  min-width: 0;
}

.queue li .title {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.queue li .channel {
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue li .remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.2s ease;
}

.queue li:hover .remove {
  opacity: 1;
}

.queue li .remove:hover {
  background: var(--white);
  color: var(--accent);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-soft);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  display: none;
}

.empty-state span {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.empty-state.visible {
  display: block;
}

/* ===== Player ===== */
.player {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  bottom: 0;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.thumb-wrap {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-info {
  min-width: 0;
}

.track-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-channel {
  font-size: 12px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: all 0.2s ease;
}

.ctrl-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.ctrl-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}

.play-btn:hover {
  background: var(--accent);
  transform: scale(1.05);
}

/* Progress */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-wrap span {
  font-size: 11px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

/* Volume */
.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  color: var(--text-soft);
}

/* ===== Range inputs ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  flex: 1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--text);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.volume input[type="range"] {
  max-width: 100px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .app {
    padding: 0 20px;
  }

  .header {
    padding: 20px 0;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .player {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 14px 0;
  }

  .now-playing {
    grid-column: 1 / 2;
  }

  .controls {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .progress-wrap {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .volume {
    display: none;
  }

  .queue-actions {
    width: 100%;
    justify-content: space-between;
  }
}


/* Error de búsqueda */
.search-error {
  padding: 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
}

.search-error .hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
} 





















