/* ============================================
   Melody Music Player — Master Stylesheet
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap");

/* ===== Design Tokens (CSS Custom Properties) ===== */
:root {
  /* Palette */
  --accent: #1db954;
  --accent-hover: #1ed760;
  --accent-glow: rgba(29, 185, 84, 0.35);
  --accent-subtle: rgba(29, 185, 84, 0.12);

  /* Dark theme (default) */
  --bg-body: #000000;
  --bg-surface: #121212;
  --bg-elevated: #1a1a1a;
  --bg-card: #181818;
  --bg-nav: #242424;
  --bg-hover: rgba(255, 255, 255, 0.08);
  --bg-hover-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: rgba(255, 255, 255, 0.55);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-player: 0 -4px 20px rgba(0, 0, 0, 0.6);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-min-width: 220px;

  /* Player */
  --player-height: 90px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ===== Bright Mode Overrides ===== */
body.bright-mode {
  --bg-body: #f5f5f5;
  --bg-surface: #ffffff;
  --bg-elevated: #f0f0f0;
  --bg-card: #ffffff;
  --bg-nav: #e8e8e8;
  --bg-hover: rgba(0, 0, 0, 0.05);
  --bg-hover-strong: rgba(0, 0, 0, 0.1);

  --text-primary: #191414;
  --text-secondary: #535353;
  --text-muted: rgba(0, 0, 0, 0.5);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.1);
  --shadow-player: 0 -2px 12px rgba(0, 0, 0, 0.1);
}

/* ===== Global Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  font-family: "Poppins", "Montserrat", sans-serif;
  font-weight: 400;
  background-color: var(--bg-body);
  color: var(--text-primary);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    background-color var(--transition-slow),
    color var(--transition-slow);
}

.container {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100vw;
}

/* ===== Layout ===== */
main {
  display: flex;
  width: 100%;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

/* ===== Sidebar ===== */
aside {
  background-color: var(--bg-body);
  color: var(--text-primary);
  width: var(--sidebar-width);
  min-width: var(--sidebar-min-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
  overflow: hidden;
  transition: background-color var(--transition-slow);
}

/* --- Sidebar Header Card --- */
.header {
  background-color: var(--bg-surface);
  border-radius: 8px;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  transition: background-color var(--transition-slow);
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform var(--transition-fast);
  cursor: pointer;
}

.logo:hover {
  transform: scale(1.08);
}

.header h2 {
  font-family: sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
  cursor: pointer;
  margin: 0;
  transition: color var(--transition-fast);
}

.header h2:hover {
  color: var(--accent-hover);
}

/* --- Sidebar Nav Links (Home / Search) --- */
.header p {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.header p:hover {
  background-color: var(--accent-subtle);
  color: var(--text-primary);
  transform: translateX(2px);
}

.header p svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Active sidebar link */
aside .header p.active {
  position: relative;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--accent-subtle);
}

aside .header p.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background-color: var(--accent);
  border-radius: 2px;
}

#home-logo,
#searchbar {
  height: 40px;
  background-color: transparent;
  border-radius: 6px;
}

#searchbar:hover {
  border: 1px solid var(--border-subtle);
}

#home-logo {
  margin-bottom: 2px;
}

/* --- Google Translate Widget --- */
#google_translate_element {
  margin: 8px 0;
  text-align: center;
}

.goog-te-combo {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition:
    border var(--transition-fast),
    box-shadow var(--transition-fast);
}

.goog-te-combo:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  outline: none;
}

.goog-te-combo:hover {
  border-color: var(--accent);
}

body.bright-mode .goog-te-combo {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* --- Playlist / Library Section --- */
.playlist {
  background-color: var(--bg-surface);
  border-radius: 8px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 0 8px;
  transition: background-color var(--transition-slow);
}

.playlist > p {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.playlist > p:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

.playlist > p svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --- Song List in Sidebar --- */
.lists {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
}

.lists ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lists li {
  margin: 2px 8px;
}

.lists .li-song {
  width: 100%;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.lists .li-song:hover {
  background-color: var(--bg-hover-strong);
  color: var(--text-primary);
}

/* Currently playing song highlight */
.lists .li-song.playing {
  background-color: var(--accent-subtle);
  color: var(--accent);
}

.lists .li-song img {
  height: 36px;
  width: 36px;
  margin-right: 10px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}

.lists .li-song p {
  font-size: 13px;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* ===== Main Content Area ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  margin: 8px 8px 8px 0;
  border-radius: 8px;
  transition: background-color var(--transition-slow);
}

/* ===== Home Section (loaded via fetch) ===== */
.Home {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: background-color var(--transition-slow);
}

/* ===== Navigation Bar ===== */
.nav {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-nav);
  padding: 10px 20px;
  flex-shrink: 0;
  position: relative;
  transition: background-color var(--transition-slow);
}

.left {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Nav circular buttons */
.left div,
.right div {
  background-color: rgba(0, 0, 0, 0.4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.left div:hover,
.right div:hover {
  background-color: var(--bg-hover-strong);
  transform: scale(1.08);
}

body.bright-mode .left div,
body.bright-mode .right div {
  background-color: rgba(0, 0, 0, 0.08);
}

/* --- Center Search in Nav --- */
.nav .center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

#search-input {
  background-color: var(--bg-hover);
  padding: 10px 44px 10px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  outline: none;
  width: 340px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  color: var(--text-primary);
  transition:
    border var(--transition-fast),
    background-color var(--transition-fast);
}

#search-input:focus {
  border-color: var(--accent);
  background-color: var(--bg-hover-strong);
}

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

#search-btn {
  background-color: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

#search-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.08);
}

#search-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* --- Right Nav Section --- */
.right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.right p {
  background-color: rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 500;
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.right p:hover {
  background-color: var(--text-primary);
  color: var(--bg-body);
  border-color: transparent;
  transform: scale(1.03);
}

.right p:nth-child(2) {
  background-color: var(--accent);
  color: #fff;
  border-color: transparent;
}

.right p:nth-child(2):hover {
  background-color: var(--accent-hover);
  color: #fff;
}

/* Profile circle */
.right .profile {
  background: linear-gradient(135deg, #7b2ff7, #c471ed) !important;
  font-weight: 700;
  font-size: 14px;
  color: #fff !important;
}

/* Bell notification */
.bell {
  position: relative;
}

.notification {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  top: 4px;
  right: 4px;
  border: 1.5px solid var(--bg-body);
  border-radius: 50%;
  padding: 0;
}

/* Login button */
.right #login-btn {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  padding: 8px 16px;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.right #login-btn:hover {
  background-color: var(--text-primary);
  color: var(--bg-body);
  transform: scale(1.03);
}

body.bright-mode .right p {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

body.bright-mode .right p:hover {
  background-color: var(--text-primary);
  color: var(--bg-body);
}

body.bright-mode .right p:nth-child(2) {
  background-color: var(--accent);
  color: #fff;
}

/* --- Hamburger Menu --- */
.hamburger {
  font-size: 22px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  padding: 6px;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
  z-index: 1001;
}

.hamburger:hover {
  background-color: var(--bg-hover);
}

.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.nav-links.show {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  background-color: var(--bg-elevated);
  position: absolute;
  top: 60px;
  right: 10px;
  padding: 8px;
  border-radius: 8px;
  z-index: 1000;
  width: 180px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 14px;
  display: block;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  background-color: var(--bg-hover);
}

/* ===== Music Section & Cards ===== */
.musics {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.musics h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.seemore {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.seemore div {
  padding: 6px 14px;
  background-color: var(--bg-hover);
  border-radius: 50px;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.seemore div:hover {
  background-color: var(--bg-hover-strong);
}

/* --- Music Cards Grid --- */
.musiccards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 0;
}

/* --- Simple Card --- */
.card {
  width: 180px;
  background-color: var(--bg-card);
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
  display: flex;
  flex-direction: column;
}

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

.card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card h5 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .play-button {
  position: absolute;
  right: 20px;
  top: 100px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

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

.card .play-button svg {
  width: 24px;
  height: 24px;
  fill: #000;
  margin: 0;
}

/* ===== SVG Global Defaults ===== */
svg {
  width: 18px;
  height: 18px;
  margin-bottom: -3px;
  fill: currentColor;
  transition: fill var(--transition-fast);
}

/* ===== Bottom Player ===== */
.player {
  width: 100%;
  height: auto;
  min-height: var(--player-height);
  background-color: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-player);
  flex-shrink: 0;
  transition: background-color var(--transition-slow);
}

/* --- Current Song Info --- */
.current-song {
  width: 280px;
  min-width: 160px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.current-song div {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.current-song img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  transition: transform var(--transition-fast);
  cursor: pointer;
}

.current-song img:hover {
  transform: scale(1.05);
}

.current-song p {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.current-song p:hover {
  color: var(--accent);
}

.current-song svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  flex-shrink: 0;
  margin-left: 4px;
}

/* --- Player Panel (Controls + Progress) --- */
.panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 600px;
  padding: 8px 0;
}

/* --- Playback Controls --- */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.controls img {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast),
    filter var(--transition-fast);
}

.controls img:hover {
  opacity: 1;
  transform: scale(1.15);
  filter: brightness(1.2);
}

/* Play/Pause button — hero element */
.controls #play {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  padding: 8px;
  opacity: 1;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.controls #play:hover {
  background: var(--accent-hover);
  transform: scale(1.12);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* Active state for loop/shuffle */
.controls img.active {
  opacity: 1;
  filter: brightness(1.5) drop-shadow(0 0 6px var(--accent));
  transform: scale(1.1);
}

/* Tooltip wrapper */
.tooltip-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-card);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--bg-elevated) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* --- Progress Bar --- */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.progress-bar > p {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
  user-select: none;
}

/* Seek bar */
.bar {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--accent) 0%, #4f4f4f 0%);
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  transition: height var(--transition-fast);
}

.bar:hover {
  height: 6px;
}

.bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-glow);
  transition: transform var(--transition-fast);
}

.bar::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px var(--accent-glow);
}

/* --- Volume Controls --- */
.volume {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 160px;
}

.volume > img,
.volume .tooltip-container img {
  width: 22px;
  height: 22px;
  cursor: pointer;
  opacity: 0.7;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.volume > img:hover,
.volume .tooltip-container img:hover {
  opacity: 1;
  transform: scale(1.12);
}

#volume {
  width: 90px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background-color: #4f4f4f;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  background-color: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 4px var(--accent-glow);
  transition: transform var(--transition-fast);
}

#volume::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

#volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background-color: #fff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* Pulse animation for play button */
#play.playing {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 4px 14px var(--accent-glow);
  }
  50% {
    box-shadow: 0 4px 24px rgba(29, 185, 84, 0.6);
  }
}

/* ===== Bright Mode — Specific Overrides ===== */
body.bright-mode .controls #play {
  background-color: var(--accent);
}

body.bright-mode svg {
  fill: var(--text-primary);
}

body.bright-mode .current-song svg {
  fill: var(--accent);
}

body.bright-mode .controls img {
  filter: invert(0.6);
}

body.bright-mode .controls #play {
  filter: none;
}

body.bright-mode .volume > img,
body.bright-mode .volume .tooltip-container img {
  filter: invert(0.6);
}

body.bright-mode .current-song img {
  filter: none;
}

body.bright-mode .lists .li-song img {
  filter: none;
}

/* ===== Auth Modal ===== */
.auth-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  max-width: 400px;
  width: 90%;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: none;
  border: 1px solid var(--border-subtle);
}

.auth-container.show {
  display: block;
}

.auth-container .close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.auth-container .close-btn:hover {
  color: var(--text-primary);
}

.auth-toggle {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-toggle button {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  font-size: 15px;
}

.auth-toggle button:hover {
  color: var(--accent);
}

.auth-toggle button.active {
  color: var(--accent);
  border-color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form h2 {
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-form input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  outline: none;
  font-weight: 500;
  transition: border var(--transition-fast);
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-form button {
  padding: 12px;
  border-radius: 50px;
  background-color: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.auth-form button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Backdrop */
#auth-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

#auth-backdrop.show {
  display: block;
}

/* ===== Loading Screen ===== */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  text-align: center;
}

.loader i {
  font-size: 3.5rem;
  color: var(--accent);
  animation: spin 1.5s linear infinite;
}

.loader h2 {
  margin-top: 1rem;
  font-size: 1.8rem;
  color: var(--accent);
  font-weight: 600;
}

.dots::after {
  content: "";
  display: inline-block;
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60% {
    content: "...";
  }
  80% {
    content: "....";
  }
  100% {
    content: "";
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== Hidden Utility ===== */
.hidden {
  display: none !important;
}

/* ===== App Title (Auth) ===== */
.app-title {
  margin-bottom: 20px;
  text-align: center;
}

.app-name {
  display: flex;
  align-items: center;
  font-weight: bold;
  justify-content: center;
  margin: 0;
}

.spotify-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.app-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
  padding-top: 4px;
  padding-left: 15px;
}

/* Login button in nav */
.login {
  background-color: var(--text-primary);
  color: var(--bg-body);
  width: 60px;
  height: 36px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

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

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.sidebar-overlay.show-overlay {
  display: block;
  opacity: 1;
}

/* Tablets & small desktops */
@media (max-width: 1024px) {
  .musiccards {
    gap: 12px;
  }

  .card {
    width: 160px;
  }

  #search-input {
    width: 260px;
  }
}

/* Mobile & Small Tablets */
@media (max-width: 768px) {
  main {
    flex-direction: row;
  }

  aside {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100dvh;
    z-index: 100;
    transition: left var(--transition-fast);
    flex-direction: column;
    padding: 12px;
  }

  .player.player-hidden {
    display: none !important;
  }

  aside.show-sidebar {
    left: 0;
  }

  .main-content {
    margin: 0;
    border-radius: 0;
  }

  .nav {
    padding: 8px 12px;
  }

  .nav .left {
    display: none;
  }

  .hamburger {
    display: block;
    margin-right: 8px;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
  }

  .nav .center {
    flex: 1;
    margin-right: 12px;
  }

  #search-input {
    width: 100%;
    font-size: 14px;
  }

  .nav .right p {
    display: none;
  }

  .nav .right .profile {
    margin-left: 12px;
  }

  .musics {
    padding: 16px;
  }

  .musics h1 {
    font-size: 22px;
  }

  .musiccards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .card {
    width: 100%;
  }

  /* Player adjustments */
  .player {
    padding: 0 12px;
  }

  .current-song {
    width: 35%;
  }

  .panel {
    max-width: none;
    flex: 1;
  }

  .volume {
    display: none; /* Hide volume on mobile to save space */
  }
}

/* Small phones */
@media (max-width: 480px) {
  .player {
    padding: 0 8px;
    flex-wrap: wrap;
    height: auto;
    min-height: 80px;
    padding-bottom: 8px;
  }

  .current-song {
    width: 100%;
    order: 1;
    margin-bottom: 4px;
  }

  .panel {
    width: 100%;
    order: 2;
  }

  .musiccards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  #search-input {
    font-size: 12px;
  }

  .musics h1 {
    font-size: 18px;
  }
}

/* ===== Playlist View ===== */
.playlist-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(
    180deg,
    rgba(29, 185, 84, 0.3) 0%,
    var(--bg-surface) 300px
  );
  color: #fff;
}

.playlist-header {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 24px;
}

#playlist-cover {
  width: 200px;
  height: 200px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  object-fit: cover;
}

.playlist-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-type {
  font-size: 14px;
  font-weight: 500;
}

#playlist-title {
  font-size: 48px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.playlist-desc {
  font-size: 14px;
  color: #b3b3b3;
}

.playlist-controls {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.play-btn-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast);
}

.play-btn-large:hover {
  transform: scale(1.05);
  background-color: var(--accent-hover);
}

.playlist-heart {
  color: #b3b3b3;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.playlist-heart:hover {
  color: #fff;
}

.songs-container {
  padding: 0 24px 24px;
}

.songs-list-header {
  display: flex;
  justify-content: space-between;
  color: #b3b3b3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.col-title {
  flex: 1;
}
.col-duration {
  width: 60px;
  text-align: right;
}

.songs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.songs-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.songs-list li:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

body.bright-mode .playlist-view {
  background: linear-gradient(
    180deg,
    rgba(29, 185, 84, 0.15) 0%,
    var(--bg-surface) 300px
  );
  color: #000;
}

body.bright-mode .songs-list-header,
body.bright-mode .playlist-desc,
body.bright-mode .playlist-heart {
  color: #555;
}

body.bright-mode .songs-list li:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Playlist Mobile Adjustments */
@media (max-width: 640px) {
  .playlist-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  #playlist-title {
    font-size: 32px;
  }
}
