/* ============================= */
/* THEME VARIABLES               */
/* ============================= */


:root {
  --bg: #ffffff;
  --text-primary: #111;
  --text-secondary: #666;
  --card-bg: #fff;
  --card-shadow: rgba(0, 0, 0, 0.08);
  --accent: #ffcc00;
  --overlay-bg: rgba(255, 255, 255, 0.9);
  --mini-player-bg: rgba(255, 255, 255, 0.85);
  --input-bg: #f4f5f7;
  --border-color: #eee;
  --toast-bg: #222;
  --toast-text: #fff;
  --dialog-bg: #fff;
  --dialog-text: #111;
  --player-btn-bg: #111;
  --player-btn-color: #fff;
}
 
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --text-primary: #e0e0e0;
    --text-secondary: #bbb;
    --card-bg: #1e1e1e;
    --card-shadow: rgba(0, 0, 0, 0.6);
    --accent: #ffcc00;
    --overlay-bg: rgba(40, 40, 40, 0.85);
    --mini-player-bg: rgba(40, 40, 40, 0.85);
    --input-bg: #2a2a2a;
    --border-color: #444;
    --toast-bg: #333;
    --toast-text: #fff;
    --dialog-bg: #1e1e1e;
    --dialog-text: #e0e0e0;
    --player-btn-bg: #ffcc00;
    --player-btn-color: #1e1e1e;
  }
}
 
[data-theme="dark"] {
  --bg: #121212;
  --text-primary: #e0e0e0;
  --text-secondary: #bbb;
  --card-bg: #1e1e1e;
  --card-shadow: rgba(0, 0, 0, 0.6);
  --accent: #ffcc00;
  --overlay-bg: rgba(40, 40, 40, 0.85);
  --mini-player-bg: rgba(40, 40, 40, 0.85);
  --input-bg: #2a2a2a;
  --border-color: #444;
  --toast-bg: #333;
  --toast-text: #fff;
  --dialog-bg: #1e1e1e;
  --dialog-text: #e0e0e0;
  --player-btn-bg: #ffcc00;
  --player-btn-color: #1e1e1e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  accent-color: var(--accent);
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* Prevents accidental bounce scrolling */
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 13.33px;
  background: var(--bg);
  display: flex;
  justify-content: center; 
  height: 100%;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* RESPONSIVE APP SHELL */
.app-shell {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  flex-grow: 8;
  background: var(--bg);
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

#authTitle{ 
  color: var(--text-primary);
}

/* HEADER */
.top-header {
  padding: 30px 20px 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 74px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.back-btn {
  font-size: 26px;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.back-btn:active {
  transform: scale(0.9);
}
.top-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.search-icon {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

/* SCREENS */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  height: calc(100% - 75px);
  padding: 0 20px 200px 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.screen.active {
  display: block;
  animation: fadeIn 0.3s forwards;
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Floating Mini-Player */
.mini-player {
  position: absolute;
  bottom: -85px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: 90%;
  max-width: 450px;
  background: var(--mini-player-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px var(--card-shadow);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 99;
  cursor: pointer;
  overflow: hidden;
}
.mini-player.active {
  bottom: 85px !important;
  transform: translateX(-50%) translateY(0);
}
.mini-player img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-right: 12px;
  object-fit: cover;
}
.mini-info {
  flex: 1;
  overflow: hidden;
}
.mini-controls button {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}
.mini-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--text-primary);
  width: 0%;
  transition: width 0.1s linear;
}

/* Player Progress Scrubber */
.progress-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-bottom: 10px;
}
.progress-container span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 40px;
}
.progress-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--input-bg);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
}
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* TABS */
.tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  border-bottom: 1px solid transparent;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* SECTIONS */
.section {
  margin-bottom: 30px;
}
.section h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 15px auto;
  justify-content: center;
}

/* HORIZONTAL CARDS */
.horizontal-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
}
.horizontal-scroll::-webkit-scrollbar {
  display: none;
}
.music-card {
  min-width: 160px;
  height: 180px;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.9) 100%
  );
  padding: 20px 12px 12px 12px;
  color: white;
}
.card-overlay h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.card-stats {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: #ddd;
}
.card-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* SONG LIST & AUTO FLUID GRID FOR DESKTOP */
.song-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.song-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.song-item img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
}
.song-item-info {
  flex: 1;
  overflow: hidden;
}

/* TRUNCATION LOGIC (Handles 1-2 line ellipsis globally) */
.song-item h4,
.mini-info h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.song-item p,
.mini-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.grid-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.2;
  margin-top: 4px;
}

.song-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  aspect-ratio: 1/1;
  font-size: 20px;
  color: var(--text-secondary);
}

/* FLUID GRID LIST */
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.grid-card {
  cursor: pointer;
  transition: transform 0.2s ease;
  border-radius: 15px;
}
.grid-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  margin-bottom: 4px;
  object-fit: cover;
  box-shadow: 0 6px 18px var(--card-shadow);
}
.grid-card span {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
}

/* SEARCH */
.search-wrapper {
  margin-bottom: 20px;
}
.search-wrapper input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 20px;
  border: none;
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  outline: none;
}

/* PLAYER */
.player-screen.active {
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 20px 20px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.player-header button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: rgb(255, 255, 255);
  text-shadow: rgba(0, 0, 0, 0.3) 0px 2px 10px;
}
.player-body {
  text-align: center;
  padding: 10px 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.player-cover {
  width: 280px;
  height: 280px;
  border-radius: 36px;
  margin-bottom: 30px;
  object-fit: cover;
  box-shadow: 0 15px 40px var(--card-shadow);
}
.player-info-wrapper {
  width: 100%;
}
.player-body h3 {
  margin: 0 0 5px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.player-body p {
  margin: 0 0 30px 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
}
.player-controls button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 24px;
}
.player-controls .play-btn-circle {
  width: 64px;
  height: 64px;
  background: var(--player-btn-bg);
  color: var(--player-btn-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 20px var(--card-shadow);
}
.player-bottom-action {
  margin-top: auto;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* FLOATING BOTTOM NAV */
.bottom-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  max-width: 400px;
  min-height: 56px;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
  border-radius: 40px;
  box-shadow: 0 10px 30px var(--card-shadow);
  z-index: 100;
}
.bottom-nav a {
  color: var(--text-secondary);
  font-size: 24px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.bottom-nav a.active {
  color: var(--text-primary);
}

.loader {
  text-align: center;
  padding: 20px;
  display: none;
  font-size: 14px;
  color: var(--text-secondary);
}

/* AUTH & PROFILE */


.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--text-secondary);
}
.auth-separator:not(:empty)::before { margin-right: 15px; }
.auth-separator:not(:empty)::after { margin-left: 15px; } 
 

.enter-sections:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.enter-sections button {
  width: 100% !important;
  text-align: center !important;
  justify-content: center !important;
}
.separator {
  color: var(--text-secondary);
  width: 100%;
  text-align: center;
  padding: 15px 0;
}
.enter-sections:empty + .separator {
  display: none !important;
}

.XaID_IframesContainer {
  z-index: 9000 !important;
}

.small-btn {
  background: var(--input-bg);
  color: var(--text-primary);
  border: none;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  float: right;
  cursor: pointer;
}

.auth-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 40px;
  max-width: 400px;
  margin: 0 auto;
}
.auth-container input {
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}
.primary-btn {
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  padding: 16px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 2px solid var(--text-primary);
}
.primary-btn.outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}
.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.overlay-sheet {
  position: absolute;
  bottom: -100%;
  left: 0;
  width: 100%;
  background: var(--dialog-bg);
  color: var(--dialog-text);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -10px 40px var(--card-shadow);
  transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1006;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.overlay-sheet.active {
  bottom: 0;
}
.sheet-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.context-options {
  display: flex;
  flex-direction: column;
  padding: 10px 0 30px 0;
}
.context-options button {
  background: none;
  border: none;
  padding: 16px 20px;
  text-align: left;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* Hiding scrollbars for cleaner queue overlay */
#queueList::-webkit-scrollbar {
  display: none;
}

.toast-container {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: 90%;
}
.toast {
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 14px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* CUSTOM DIALOG */
.dialog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dialog-overlay.active {
  display: flex;
  opacity: 1;
}
.dialog-box {
  background: var(--dialog-bg);
  color: var(--dialog-text);
  width: 85%;
  max-width: 320px;
  border-radius: 28px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.dialog-overlay.active .dialog-box {
  transform: scale(1);
}
.full-width-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 20px;
  outline: none;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.dialog-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  border: none;
  cursor: pointer;
}
.btn-cancel {
  background: var(--input-bg);
  color: var(--text-primary);
}
.btn-confirm {
  background: var(--text-primary);
  color: var(--bg);
}

/* Genre Pills */
.genre-scroll,
.library-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 5px;
}
.genre-scroll::-webkit-scrollbar,
.library-tabs::-webkit-scrollbar {
  display: none;
}
.genre-pill {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.genre-pill.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* UI Fixes */
.player-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: hidden;
}
.player-screen::before {
  content: "";
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--player-bg-img, none);
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.5);
  transform: scale(1.2);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.player-screen.has-bg::before {
  opacity: 1;
}
.player-screen .player-header,
.player-screen .player-body h3,
.player-screen .player-body p,
.player-screen .player-controls button {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
button {
  border: none;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  border-radius: 8px;
}

.music-card:active,
.grid-card:active,
.song-item:active {
  transform: scale(0.97);
  opacity: 0.7;
  transition: transform 0.1s, opacity 0.1s; /* Faster response down */
}
.play-btn-circle:active {
  transform: scale(0.9);
  box-shadow: 0 4px 10px var(--card-shadow);
}
.primary-btn.icon-only {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  aspect-ratio: 1/1;
  max-width: 56px;
}

.library-header {
  position: sticky;
  top: -20px;
  background: var(--bg);
  z-index: 10;
  padding: 20px 0 10px 0;
  margin-top: -20px;
}
.library-search {
  position: relative;
  margin-bottom: 15px;
} 
.library-search input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

/* Upgraded Context Menu Styling */
.context-options button {
  background: transparent;
  border: none;
  padding: 14px 20px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border-radius: 14px;
  margin: 2px 10px;
  transition: background 0.2s ease, transform 0.1s ease;
}
 

@media (hover: hover) {
  .context-options button:hover {
    background: var(--input-bg);
  }
}

.context-options button:active {
  background: var(--input-bg);
  transform: scale(0.98);
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--input-bg) 25%,
    var(--border-color) 50%,
    var(--input-bg) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite linear;
  border-radius: 14px;
}
@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.skeleton-card {
  width: 160px;
  height: 180px;
  border-radius: 24px;
}
.skeleton-song {
  width: 100%;
  height: 60px;
  border-radius: 14px;
  margin-bottom: 12px;
}
.skeleton-grid {
  width: 140px;
  height: 140px;
  border-radius: 20px;
}

/* Reusable Empty State Component */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  animation: fadeIn 0.4s ease;
}
 
.empty-state h3 {
  color: var(--text-primary);
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}
.empty-state p {
  font-size: 14px;
  margin: 0 0 20px 0;
  max-width: 250px;
}

/* ============================= */
/* ASIDE MENU (SIDEBAR)          */
/* ============================= */
.aside-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.aside-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.aside-menu {
  position: absolute;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100dvh;
  background: var(--card-bg);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 1002;
  transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}
.aside-menu.active {
  left: 0;
}

.aside-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 20px 20px;
  border-bottom: 1px solid var(--border-color);
}
.aside-header h2 {
  margin: 0;
  font-size: 20px;
}

.aside-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.aside-content a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}
 

/* Update library search icon */
.library-search i[class^="ri-"] {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-secondary);
}

/* Update context menu icons */
.context-options button i[class^="ri-"] {
  font-size: 20px;
  color: var(--text-secondary);
}

.context-options button[style*="color:#ff4d4d"] i[class^="ri-"] {
  color: #ff4d4d;
}

/* Update empty state icons */
.empty-state i[class^="ri-"] {
  font-size: 72px;
  margin-bottom: 16px;
  opacity: 0.3;
  color: var(--text-primary);
}

/* Update sidebar menu icons */
.aside-content a i[class^="ri-"] {
  font-size: 22px;
  color: var(--text-secondary);
}

/* Update interaction state buttons */
.btn-like i[class^="ri-"],
.btn-save i[class^="ri-"] {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    color 0.2s ease;
}

.btn-like:active i[class^="ri-"],
.btn-save:active i[class^="ri-"] {
  transform: scale(1.3);
}

/* Song Item image clickable separation */
.song-item {
  position: relative;
}
.song-item img {
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Playlist Edit Modal Textarea Fix */
textarea.full-width-input {
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
}

/* Screen Song View specific tweaks */
#screen-song-view .profile-header {
  padding: 20px 0;
}

/* Professional About Cards */
.about-card {
  background: var(--input-bg);
  border-radius: 20px;
  padding: 24px;
  margin-top: 10px;
}
.about-card h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: var(--text-primary);
}
.about-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.about-stat-row:last-child {
  border-bottom: none;
}
.about-stat-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}
.about-stat-value {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}
.about-bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-top: 15px;
}

/* TABLET & DESKTOP (PC) RESPONSIVE UPGRADES */
@media (hover: hover) {
  .music-card:hover,
  .grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--card-shadow);
  }
  .song-item:hover {
    background: var(--input-bg);
    border-radius: 14px;
    padding: 4px;
    margin: -4px;
  }
  .bottom-nav a:hover {
    color: var(--accent);
  }
}

@media (min-width: 768px) {
  /* 1. App Shell Setup for Sidebar & Push Effect */
  .app-shell:not(:has(.player-screen.active)) {
    padding-left: 80px;
    transition: padding-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  /* 2. Transform Bottom Nav to Fixed Left Column Menu */
  .bottom-nav {
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px;
    max-width: 80px;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    transform: none;
    border-radius: 0;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1005; /* Keep above the sliding aside menu */
  }

  .bottom-nav a {
    flex: none;
    padding: 20px 0;
  }

  /* 3. Aside Menu Adjustments */
  .aside-menu {
    z-index: 1004; /* Slides from underneath the left nav */
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .aside-menu.active {
    left: 80px; /* Opens right next to the left nav */
  }

  /* 4. The Push Effect: Shift main content when aside menu opens */
  .app-shell:has(.aside-menu.active) {
    padding-left: 360px; /* 80px (nav) + 280px (aside) */
  }

  /* 5. Adjust Overlay to only cover the pushed content */
  .aside-overlay {
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    left: 80px;
  }
  .app-shell:has(.aside-menu.active) .aside-overlay {
    left: 360px;
  }

  /* 6. Clean up padding and layouts meant for mobile */
  .screen {
    padding: 0 40px 40px 40px; /* Removed 120px mobile bottom padding */
  }
  .top-header {
    padding: 30px 40px 10px 40px;
  }
  .song-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    column-gap: 30px;
  }

  /* 7. Player layout upgrades */
  .player-body {
    flex-direction: row;
    max-width: 900px;
    margin: 0 auto;
    gap: 60px;
    justify-content: center;
  }
  .player-cover {
    width: 320px;
    height: 320px;
    margin-bottom: 0;
  }
  .player-info-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 450px;
  }
  .player-bottom-action {
    margin-top: 40px;
  }

  /* 8. Fix Mini-Player positioning to center in remaining space */
  .mini-player {
    left: calc(50% + 40px); /* Center offset by 80px nav */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
      left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  .mini-player.active {
    bottom: 30px !important; /* Lowered since there is no bottom nav */
  }
  .app-shell:has(.aside-menu.active) .mini-player {
    left: calc(
      50% + 180px
    ); /* Shift right to stay centered when menu is pushed */
  }
}

/* Tier Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  margin-top: 5px;
}
.badge.premium {
  background: var(--accent);
  color: #111;
}
.badge.plus {
  background: #3498db;
  color: #fff;
}

/* Input groups for settings */
.input-group {
  margin-bottom: 15px;
  text-align: left;
}
.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
}
.input-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* ============================= */
/* AUTHENTICATION UI ENHANCEMENTS*/
/* ============================= */
.auth-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
  margin-bottom: 30px;
  animation: fadeIn 0.4s ease;
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  width: 70px;
  height: 70px;
  margin-bottom: 25px;
  aspect-ratio: 1/1;
  color: var(--accent);
  background: var(--input-bg);
  padding: 16px;
  border-radius: 50%; 
  box-shadow: 0 10px 25px var(--card-shadow);
}
.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 8px;
  font-weight: 500;
}
.auth-container input {
  width: 100%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 10px transparent;
}
.auth-container input:focus {
  border-color: var(--text-primary);
  box-shadow: 0 4px 15px var(--card-shadow);
  transform: translateY(-2px);
}
.auth-switch {
  padding: 10px;
  border-radius: 12px;
  transition: background 0.2s;
}
@media (hover: hover) {
  .auth-switch:hover {
    background: var(--input-bg);
  }
}

/* ============================= */
/* PROFILE & SETTINGS UI         */
/* ============================= */
.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px 10px;
  text-align: center;
  box-shadow: 0 8px 20px var(--card-shadow);
  transition: transform 0.2s ease;
}
.stat-box:active {
  transform: scale(0.95);
}
.stat-box h3 {
  margin: 0 0 5px 0;
  font-size: 26px;
  color: var(--text-primary);
  font-weight: 700;
}
.stat-box p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.settings-list {
  background: var(--card-bg);
  border-radius: 28px;
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px var(--card-shadow);
}
.settings-list .input-group:last-child {
  margin-bottom: 0;
}
.settings-list label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.settings-list input {
  transition: all 0.2s ease;
}
.settings-list input:focus {
  border-color: var(--text-primary);
}

/* Container to handle the banner overlap */
.profile-container {
  position: relative;
  width: 100%;
  padding-bottom: 30px;
}

/* Premium Banner Background */
.profile-banner {
  width: calc(100% + 40px); /* Accounts for the 20px screen padding */
  margin-left: -20px;
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Gradient overlay to make text readable */
.profile-banner::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 30px 0; 
}

/* Adjusted Header to overlap the banner */
#screen-profile .profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row; /* Switch to row for a cleaner top-bar look */
  text-align: left;
  padding: 0 0 30px 0;
  margin-top: -40px; /* Pulls avatar up into the banner */
  position: relative;
  z-index: 2;
}

/* Upgraded Avatar with ring and shadow */
.profile-avatar {
  width: 90px;
  height: 90px;
  background: var(--input-bg);
  border-radius: 50%;
  margin: 0;
  border: 4px solid var(--bg);
  box-shadow: 0 8px 20px var(--card-shadow);
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
  margin-left: 16px;
}

.profile-name {
  margin: 0 0 4px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Stats Grid Layout */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Enhanced Stat Box */
.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px 10px;
  text-align: center;
  box-shadow: 0 4px 15px var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--card-shadow);
  }
}

.outline-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
}

/* =========================================
   LISTING INTERACTION SEPARATORS
========================================= */

.artwork-trigger {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: inherit;
  transition: transform 0.15s ease; /* Smooth scaling for taps */
}

.artwork-trigger::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4)
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="%23ffffff"><path d="M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61l-247.89 148.4A35.5 35.5 0 01133 440z"/></svg>')
    no-repeat center center;
  background-size: 30px 30px;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
}

.artwork-trigger:active {
  transform: scale(0.94);
}

.artwork-trigger:active::after {
  opacity: 1;
}

@media (hover: hover) {
  .artwork-trigger:hover::after {
    opacity: 1;
  }
}
.details-trigger {
  padding: 15px;
  cursor: pointer;
  flex: 1;
  transition: opacity 0.15s ease;
}

.details-trigger:active {
  opacity: 0.5;
}

@media (hover: hover) {
  .details-trigger:hover h4,
  .details-trigger:hover p,
  .details-trigger:hover .item-title {
    color: var(--accent);
  }
}
