/* ============================================================================
   LAYOUT & LIVE UI COMPONENTS (layout.css)
   Bridges modular design tokens to the class names used by
   music_base.html / music_player.html / music_login.html / player.js
   ============================================================================ */

.hidden { display: none !important; }
.text-muted { color: var(--text-muted) !important; }
.text-emerald { color: #10b981 !important; }
.text-danger { color: #ef4444 !important; }
.small { font-size: 0.85rem !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body {
  background-color: var(--bg-primary, var(--bg-dark, #080809)) !important;
  color: var(--text-main, #f4f4f5) !important;
  padding-bottom: 150px;
  font-family: var(--font-main), 'Yekan Bakh', Tahoma, sans-serif !important;
}

.ambient-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(255, 255, 255, 0.05), transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 10%, rgba(161, 161, 170, 0.06), transparent 55%);
}

.main-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 88px 20px 40px;
}

.section-container {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header.space-between {
  justify-content: space-between;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 12px;
  font-size: 0.95rem;
}

/* ========== DYNAMIC ISLAND ========== */
.dynamic-island-capsule {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: min(300px, calc(100vw - 28px));
  min-height: 48px;
  background: rgba(16, 16, 20, 0.94);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transition: width 0.35s var(--ease-spring), border-radius 0.35s var(--ease-spring);
}

/* When wrapped with Friends orb, positioning moves to the cluster */
.island-top-cluster .dynamic-island-capsule {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  z-index: auto;
}

.dynamic-island-capsule.expanded {
  width: min(360px, calc(100vw - 24px));
  border-radius: 24px;
}

.island-pill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.island-pill-left,
.island-pill-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.island-logo-disc {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 50%;
}

.island-logo-disc.spinning {
  animation: spinDisc 3s linear infinite;
}

@keyframes spinDisc {
  to { transform: rotate(360deg); }
}

.island-brand-name {
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.user-pill-avatar-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  max-width: 110px;
}

.user-pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.user-pill-name {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.island-chevron {
  color: var(--text-muted);
  font-size: 0.72rem;
  transition: transform 0.25s ease;
}

.island-chevron.open {
  transform: rotate(180deg);
}

.island-menu-drawer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease-spring), opacity 0.25s ease, padding 0.25s ease;
  padding: 0 10px;
}

.dynamic-island-capsule.expanded .island-menu-drawer {
  max-height: 320px;
  opacity: 1;
  padding: 0 10px 12px;
}

.island-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.island-menu-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.island-menu-btn i {
  font-size: 0.95rem;
  color: #a1a1aa;
}

.island-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ========== SEARCH ========== */
.player-top-bar {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-box-container {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.search-box-container.with-actions .search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 14px;
}

.search-box-container .search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 4px;
  direction: rtl;
}

.btn-search-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #000;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-search-label { white-space: nowrap; }

.btn-recognize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-recognize:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.btn-recognize.is-listening {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  animation: recognize-btn-pulse 1.2s ease-in-out infinite;
}

.btn-recognize:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-recognize-label { white-space: nowrap; }

.recognize-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(16, 16, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e4e4e7;
  font-size: 0.86rem;
  font-weight: 700;
  width: fit-content;
  max-width: 100%;
}

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

.recognize-status i {
  color: #ffffff;
}

.recognize-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  animation: recognize-dot-pulse 1.4s ease-out infinite;
}

@keyframes recognize-btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes recognize-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.search-typeahead-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(16, 16, 20, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-main);
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.typeahead-header {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.typeahead-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

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

.typeahead-left-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.typeahead-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

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

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

.typeahead-action-badge {
  color: var(--text-muted);
}

/* ========== GENRE PILLS ========== */
.genre-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.genre-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.genre-pill:hover,
.genre-pill.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

/* ========== MUSIC GRID / TRACK CARDS (JS class names) ========== */
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.track-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px;
  position: relative;
  transition: transform 0.25s var(--ease-spring), border-color 0.2s ease, background 0.2s ease;
}

.track-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.track-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  margin-bottom: 10px;
  background: #1a1a1f;
}

.track-card-title {
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-card-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.btn-card-play {
  position: absolute;
  left: 20px;
  bottom: 58px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #000;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

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

.btn-card-add-playlist {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.track-card:hover .btn-card-add-playlist {
  opacity: 1;
}

.track-skeleton {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.skeleton-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #16161a, #222228, #16161a);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-bottom: 10px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.skeleton-title { width: 80%; }
.skeleton-meta { width: 55%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== PLAYLISTS ========== */
.playlists-grid,
.public-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.public-playlists-grouped {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.public-playlist-category-block {
  width: 100%;
}

.public-playlist-category-head {
  margin-bottom: 12px;
}

.public-playlist-category-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #e4e4e7);
  margin: 0 0 4px;
}

.public-playlist-category-sub {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(228, 228, 231, 0.55);
}

.public-playlists-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.playlist-card,
.public-playlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.playlist-card:hover,
.public-playlist-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.playlist-card-shared {
  border-color: rgba(228, 228, 231, 0.22);
}

.playlist-shared-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  color: rgba(228, 228, 231, 0.55);
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  justify-content: flex-end;
}

.playlist-shared-meta i {
  opacity: 0.7;
}

.create-new-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  cursor: pointer;
  text-align: center;
  gap: 8px;
}

.playlist-create-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.1rem;
}

.btn-create-playlist-trigger,
.btn-back-to-playlists,
.btn-follow {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.public-playlist-cover,
.public-playlist-cover-fallback {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.public-playlist-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.public-playlist-meta {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.public-playlist-play-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px;
  background: #fff;
  color: #000;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.playlist-selection-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.playlist-selection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.playlist-selection-item:hover,
.playlist-selection-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-hero-primary {
  background: #fff;
  color: #000;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* ========== ARTIST PAGE ========== */
.artist-card-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.artist-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.album-hero-cover {
  width: 112px;
  height: 112px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.album-hero-artist {
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
}

.album-hero-artist:hover {
  color: var(--text-main, #e4e4e7);
  text-decoration: underline;
}

.search-catalog {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}

.search-cat-block .section-header {
  margin-bottom: 12px;
}

.search-cat-block .section-title {
  font-size: 1.15rem;
}

.search-h-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.search-h-scroll::-webkit-scrollbar {
  height: 6px;
}

.search-entity-card {
  flex: 0 0 148px;
  scroll-snap-align: start;
  cursor: pointer;
  text-align: center;
}

.search-entity-card .entity-cover {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  display: block;
}

.search-entity-card.is-artist .entity-cover {
  border-radius: 50%;
}

.search-entity-card .entity-title {
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-entity-card .entity-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-entity-card.is-collab .entity-cover,
.search-entity-card.is-collab .search-entity-cover {
  border-radius: 14px;
}

.search-entity-card.is-collab.is-active {
  outline: 2px solid rgba(228, 228, 231, 0.55);
  outline-offset: 2px;
}

.collab-all-cover {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #a1a1aa);
  font-size: 1.6rem;
}

.album-profile-cover {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
}

.search-results-root {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.search-category {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #f4f4f5);
}

.search-category-header i {
  color: var(--text-muted, #a1a1aa);
}

.search-category-grid.music-grid {
  margin: 0;
}

.search-entity-card .track-card-cover,
.search-entity-card img.track-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.search-entity-card.is-artist .track-card-cover-wrapper,
.search-entity-card.is-artist .track-card-cover {
  border-radius: 50%;
}

.search-entity-card.is-album .track-card-cover {
  border-radius: 14px;
}

.album-hero-cover {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
}

.album-hero-artist {
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
}

.album-hero-artist:hover {
  color: var(--text-main, #e4e4e7);
  text-decoration: underline;
}

.search-categorized-root {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 8px;
}

.search-cat-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-cat-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #e4e4e7);
}

.search-cat-heading i {
  color: var(--text-muted, #a1a1aa);
}

.search-entity-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
}

.search-entity-card {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: center;
  color: inherit;
}

.search-entity-card:hover .search-entity-cover {
  transform: scale(1.03);
}

.search-entity-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: transform 0.2s ease;
  background: rgba(255, 255, 255, 0.04);
}

.search-entity-card.is-artist .search-entity-cover {
  border-radius: 50%;
}

.search-entity-title {
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.search-entity-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted, #a1a1aa);
}

.artist-badge {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.artist-name {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 10px;
}

/* ========== MODALS ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.glass-modal-card {
  position: relative;
  width: min(480px, 100%);
  background: rgba(18, 18, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(20px);
}

.btn-modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(20, 20, 24, 0.92);
  color: #fff;
  cursor: pointer;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
}


.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-artist,
.modal-header-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-cover-large {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 8px auto 16px;
}

.modal-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-tag.highlight {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.form-group label,
.login-form label,
.login-page label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f4f4f5 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group label i,
.login-form label i {
  color: #a1a1aa;
}

.form-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff !important;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-input::placeholder {
  color: #a1a1aa;
  opacity: 1;
}

.spotify-lyrics-container,
.lyrics-card {
  width: min(520px, 100%);
  max-height: min(80vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(12, 12, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
}

.lyrics-bg-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.35);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

.spotify-lyrics-header,
.spotify-lyrics-body {
  position: relative;
  z-index: 1;
}

.spotify-lyrics-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 10px;
}

.lyrics-header-cover {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
}

.lyrics-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lyrics-header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lyrics-offset-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  flex-wrap: wrap;
}

.lyrics-offset-controls.hidden {
  display: none !important;
}

.lyrics-offset-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #a1a1aa;
}

.lyrics-offset-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lyrics-offset-btn {
  min-width: 38px;
  height: 32px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.lyrics-offset-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
}

.lyrics-offset-btn:active {
  transform: scale(0.94);
}

.lyrics-offset-value {
  min-width: 52px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #e4e4e7;
  font-variant-numeric: tabular-nums;
}

.lyrics-offset-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(228, 228, 231, 0.12);
  color: #e4e4e7;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lyrics-offset-save:hover {
  background: rgba(228, 228, 231, 0.2);
  border-color: rgba(255, 255, 255, 0.34);
}

@media (max-width: 480px) {
  .lyrics-offset-controls {
    gap: 8px;
    padding: 8px;
  }

  .lyrics-offset-btn {
    min-width: 34px;
    height: 30px;
    padding: 0 7px;
    font-size: 0.72rem;
  }
}

.spotify-lyrics-body {
  padding: 10px 18px 24px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
}

.lyrics-line,
.spotify-lyric-line {
  padding: 10px 8px;
  margin: 2px 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.75;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.22s ease, transform 0.22s ease, background 0.22s ease, font-weight 0.22s ease, opacity 0.22s ease;
}

.lyrics-line:hover,
.spotify-lyric-line:hover {
  color: rgba(255, 255, 255, 0.7);
}

.lyrics-line.active,
.spotify-lyric-line.active {
  color: #ffffff !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  transform: scale(1.03);
  background: rgba(255, 255, 255, 0.08);
}

.lyrics-line.passed,
.spotify-lyric-line.passed {
  color: rgba(255, 255, 255, 0.28);
  font-weight: 500;
}

/* ========== PROFILE ========== */
.profile-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(8, 8, 9, 0.96);
  overflow-y: auto;
}

.profile-page-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.profile-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.profile-page-back {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.profile-page-avatar-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.profile-page-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-section-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.profile-edit-name-row {
  display: flex;
  gap: 8px;
}

.profile-name-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #fff;
  padding: 10px 12px;
  font-family: inherit;
}

.btn-save-name {
  width: 42px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #000;
  cursor: pointer;
}

.profile-creds-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-cred-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
}

.cred-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.cred-value {
  font-weight: 700;
  direction: ltr;
  display: inline-block;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  position: relative;
}

.theme-card.active,
.theme-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-preview {
  height: 54px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.theme-preview-dark { background: linear-gradient(135deg, #080809, #27272a); }
.theme-preview-neon { background: linear-gradient(135deg, #0a0a12, #3f3f55); }
.theme-preview-warm { background: linear-gradient(135deg, #14100c, #3a2a1c); }

.theme-card-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.theme-active-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  place-items: center;
  font-size: 0.7rem;
}

.theme-card.active .theme-active-badge {
  display: grid;
}

.followed-artists-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ========== DESKTOP PLAYER CONTROLS ========== */
.music-player-bar .btn-ctrl,
#player-bar .btn-ctrl {
  background: transparent;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: color 0.18s ease, transform 0.18s ease;
}

.music-player-bar .btn-ctrl:hover,
.music-player-bar .btn-ctrl.active {
  color: #ffffff;
}

.music-player-bar .btn-play {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffffff !important;
  color: #000000 !important;
}

.music-player-bar .progress-bar,
.music-player-bar .volume-bar,
.mfp-volume-slider {
  accent-color: #ffffff;
  cursor: pointer;
}

.music-player-bar .progress-bar {
  flex: 1;
  height: 4px;
}

.music-player-bar .volume-bar {
  width: 70px;
}

.music-player-bar .time-label {
  font-size: 0.7rem;
  color: #a1a1aa;
  min-width: 32px;
}

.btn-like-heart,
.btn-close-player {
  background: transparent;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
}

.btn-close-player {
  position: absolute;
  top: -10px;
  right: 8px;
  left: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  z-index: 30;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.repeat-badge {
  position: absolute;
  font-size: 0.55rem;
  font-weight: 800;
  top: 0;
  right: 0;
  left: auto;
}

.btn-repeat-wrapper {
  position: relative;
}

.track-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========== MOBILE FULLSCREEN PLAYER (base tokens — detailed styles in player.css) ========== */
.mobile-fullscreen-player.hidden {
  display: none !important;
}

.mfp-volume-row[hidden] {
  display: none !important;
}

.mfp-repeat-badge {
  font-size: 0.55rem;
  font-weight: 800;
}

/* ========== EQUALIZER / VISUALIZER ========== */
.equalizer-modal-card {
  max-width: 520px;
}

.eq-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 16px 0;
}

.custom-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.custom-checkbox-input {
  accent-color: #fff;
}

.eq-preset-select-hidden {
  display: none;
}

.custom-dropdown-container {
  position: relative;
}

.custom-dropdown-trigger {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: rgba(18, 18, 22, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  z-index: 10;
}

.custom-dropdown-option {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-dropdown-option:hover,
.custom-dropdown-option.active {
  background: rgba(255, 255, 255, 0.08);
}

.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.eq-band input[type="range"] {
  writing-mode: bt-lr;
  appearance: slider-vertical;
  width: 18px;
  height: 120px;
  accent-color: #fff;
}

.eq-band span {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.visualizer-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14000;
  background: #080809;
}

.btn-visualizer-close {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.visualizer-overlay-info {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  text-align: right;
}

.visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ========== LOGIN ========== */
.login-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 88px 20px 48px;
}

.login-brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-title {
  font-size: 1.8rem;
  font-weight: 900;
}

.login-brand-subtitle {
  color: var(--text-muted);
  line-height: 1.7;
}

.glass-login-card,
.login-card {
  background: rgba(20, 20, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 12px;
  padding: 10px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-header {
  margin-bottom: 16px;
}

.login-header h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0 12px;
}

.form-input-wrapper .form-input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 12px 0;
}

.form-input-icon,
.form-input-toggle {
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.btn-submit-login,
.btn-google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.btn-submit-login {
  background: #fff;
  color: #000;
  border: none;
}

.btn-google-login {
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #111113 !important;
  margin-top: 8px;
  font-size: 0.95rem;
}

.btn-google-login svg {
  flex-shrink: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.login-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.flash-messages-container {
  margin-bottom: 14px;
}

.flash-alert {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.flash-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-danger,
.flash-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ========== PWA TOAST ========== */
.pwa-install-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(18, 18, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  max-width: 92vw;
}

.pwa-install-btn {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.pwa-dismiss-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
}

/* SEO footer block used inline in music_player.html */
#seo-content-section .glass-modal-card {
  width: 100%;
  max-width: none;
}

/* ========== CRITICAL CONTRAST / FONT HARDENING ========== */
html, body {
  background-color: #080809 !important;
  color: #f4f4f5 !important;
  font-family: 'Yekan Bakh', Tahoma, sans-serif !important;
}

.login-page,
.login-card,
.glass-login-card,
.login-form,
.form-group,
.main-container {
  color: #f4f4f5 !important;
}

.login-brand-title,
.login-header h2,
.section-title,
.island-brand-name,
.user-pill-name {
  color: #ffffff !important;
}

.login-brand-subtitle,
.login-header p,
.text-muted {
  color: #a1a1aa !important;
}

.login-page label,
.login-form label,
.form-group label {
  color: #f4f4f5 !important;
}

.btn-google-login {
  background: #ffffff !important;
  border: 1px solid #ffffff !important;
  color: #111113 !important;
}

.auth-tab-btn {
  color: #a1a1aa !important;
}

.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
}

.dynamic-island-capsule {
  background: rgba(16, 16, 20, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.island-menu-btn {
  color: #f4f4f5 !important;
}

.genre-pill {
  color: #d4d4d8 !important;
}

.genre-pill.active,
.btn-search-action {
  color: inherit;
}

.btn-search-action {
  background: #ffffff !important;
  color: #000000 !important;
}
