/* ==========================================================
   MiYouTube Music - Base & Theme CSS
   Paleta idéntica a YouTube Music (#030303 / #212121 / #FF0000)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
  --bg-main: #030303;
  --bg-sidebar: #030303;
  --bg-elevated: #212121;
  --bg-card: #121212;
  --bg-card-hover: #1f1f1f;
  --bg-glass: rgba(18, 18, 18, 0.82);
  --bg-player: #212121;

  --ytm-red: #FF0000;
  --ytm-red-hover: #E60000;
  --ytm-red-glow: rgba(255, 0, 0, 0.35);

  --text-primary: #FFFFFF;
  --text-secondary: #AAAAAA;
  --text-muted: #717171;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.25);

  --chip-bg: rgba(255, 255, 255, 0.1);
  --chip-bg-hover: rgba(255, 255, 255, 0.2);
  --chip-bg-active: #FFFFFF;
  --chip-text-active: #030303;

  --header-height: 64px;
  --player-height: 72px;
  --sidebar-width: 240px;
  --transition-smooth: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* Scrollbars estilizados */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Layout Principal */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.top-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  position: relative;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: radial-gradient(circle at center, #FF0000 45%, #181818 46%, #181818 60%, #FF0000 61%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--ytm-red-glow);
}

.brand-logo-icon svg {
  fill: #FFFFFF;
  margin-left: 2px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-title .badge {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Buscador */
.search-container {
  flex: 0 1 540px;
  position: relative;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  height: 42px;
  transition: var(--transition-smooth);
}

.search-bar:focus-within {
  background: #181818;
  border-color: var(--border-focus);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.search-bar svg {
  fill: var(--text-secondary);
  width: 20px;
  height: 20px;
  margin-right: 12px;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
}

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

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: none;
  font-size: 1.1rem;
}

/* Menú Superior Derecho */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cast-btn, .icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.cast-btn:hover, .icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 20px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.login-btn {
  background: #FFFFFF;
  color: #030303;
  border: none;
  border-radius: 18px;
  padding: 7px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.login-btn:hover {
  background: #E5E5E5;
  transform: scale(1.02);
}

/* Área de Contenido */
.main-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 16px 28px 120px 28px;
  scroll-behavior: smooth;
}

/* Barra de Chips de Estado de Ánimo */
.mood-chips-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 24px;
  scrollbar-width: none;
}
.mood-chips-bar::-webkit-scrollbar {
  display: none;
}

.mood-chip {
  background: var(--chip-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mood-chip:hover {
  background: var(--chip-bg-hover);
}

.mood-chip.active {
  background: var(--chip-bg-active);
  color: var(--chip-text-active);
  font-weight: 600;
}

/* Secciones de Contenido */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 16px 0;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 4px;
}

/* Cuadrículas y Carruseles */
.cards-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 195px);
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-snap-type: x mandatory;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* Tarjeta de Música */
.music-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  scroll-snap-align: start;
}

.music-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.card-cover-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #181818;
  margin-bottom: 10px;
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.music-card:hover .card-cover {
  transform: scale(1.04);
}

/* Botón flotante Play en Tarjeta */
.card-play-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  background: var(--ytm-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(6px);
  transition: var(--transition-smooth);
  border: none;
  cursor: pointer;
}

.card-play-btn svg {
  fill: #FFFFFF;
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.music-card:hover .card-play-btn {
  opacity: 1;
  transform: translateY(0);
}

.card-play-btn:hover {
  background: var(--ytm-red-hover);
  transform: scale(1.08) !important;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Quick Picks Grid (Escuchar de nuevo) */
.quick-picks-grid {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 380px);
  gap: 10px 20px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.quick-pick-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.quick-pick-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.quick-pick-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-pick-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Artistas Circulares */
.artist-card {
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.artist-card:hover {
  background: var(--bg-card-hover);
}

.artist-avatar-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.artist-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tarjetas de Mixes con Degradados */
.mix-card {
  border-radius: 8px;
  padding: 20px;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.mix-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.mix-card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.mix-card-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
}

/* Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal-window {
  background: #1F1F1F;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}

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

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

.form-input {
  width: 100%;
  height: 42px;
  background: #121212;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0 12px;
  color: #FFFFFF;
  font-size: 0.95rem;
}

.form-input:focus {
  border-color: var(--ytm-red);
  outline: none;
}

.btn-primary {
  width: 100%;
  height: 44px;
  background: var(--ytm-red);
  color: #FFFFFF;
  border: none;
  border-radius: 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 10px;
}

.btn-primary:hover {
  background: var(--ytm-red-hover);
  box-shadow: 0 0 16px var(--ytm-red-glow);
}
