/* SangeetSagar Pro Edition
  Optimized for Extreme Grid Density & Mobile Fluidity

*/
:root {
  --bg: #05050a;
  --bg-gradient: radial-gradient(circle at top left, #121225, #05050a);
  --card: rgba(255, 255, 255, 0.04);
  --accent: #1DB954;
  --accent-glow: rgba(29, 185, 84, 0.3);
  --text: #ffffff;
  --text-dim: #9ca3af;
  --hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(10, 10, 15, 0.85);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, sans-serif; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 120px; /* Space for player */
}

/* Header & Search */
header {
  padding: 12px 24px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(90deg, #1DB954, #1ed760);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

 /*.search-wrapper { position: relative; flex: 1; max-width: 500px; }

.search-container {
  display: flex;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  transition: var(--ease);
}

.search-container:focus-within {
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
}

#search {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0 12px;
  outline: none;
  font-size: 0.85rem;
}

.search-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8rem;
}
*/


.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 450px;
}

.search-container {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 6px 4px 16px;
  transition: 0.3s;
}

.search-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

#search {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  font-size: 0.9rem;
}

.search-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}

#suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #12121a;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion-item:hover { background: var(--hover); }
.suggestion-item .s-title { display: block; font-size: 0.9rem; font-weight: 600; }
.suggestion-item .s-artist { font-size: 0.75rem; color: var(--text-dim); }





/* Sections */
.sections {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
}

.section-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* --- PRO GRID: Target 10 Items per Row --- */
main { padding: 20px; max-width: 1600px; margin: 0 auto; }

.song-grid {
  display: grid;
  /* Calculated for ~10 per row on high res screens */
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
}

.song-card {
  background: var(--card);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  position: relative;
}

.song-card:hover {
  background: var(--hover);
  transform: translateY(-4px);
  border-color: var(--border);
}

.song-card.playing {
  border-color: var(--accent);
  background: rgba(29, 185, 84, 0.1);
}

.card-cover {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #1f1f2b, #12121a);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem; /* Smaller icon for density */
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Strict Character Limits */
.card-title, .card-artist {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 auto;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 10ch; /* Limit to 10 characters */
}

.card-artist {
  font-size: 0.65rem;
  color: var(--text-dim);
  max-width: 10ch; /* Limit to 10 characters */
}

/* --- PRO PLAYER --- */
.player {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 1200px;
  background: rgba(15, 15, 20, 0.9);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px 24px;
  z-index: 1000;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.player-inner {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 24px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover { color: var(--accent); transform: scale(1.1); }

 /*.play-btn {
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  font-size: 1rem;
} */

.ctrl-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%; /* Changed to circular */
  width: 40px;        /* Fixed width */
  height: 40px;       /* Fixed height */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s;
}

/* Remove the min-width: 110px rule you had before */
#shuffleBtn, #repeatBtn {
  min-width: 40px; 
}

.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress {
  height: 100%;
  background: var(--accent);
  width: 0%;
  border-radius: 2px;
  position: relative;
}

/* Progress Handle on Hover */
.progress-bar:hover .progress::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -4px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
}


.s-artist {
    margin-left: 12px; /* Adjust this number to make the gap bigger or smaller */
    color: #888;       /* Usually artists look better in a lighter color */
    font-size: 0.9em;
}



/* --- MOBILE OPTIMIZATION --- */

@media (max-width: 768px) {
  body { padding-bottom: 180px; }
  
  .header-top { flex-wrap: wrap; }
  .logo { order: 1; }
  .about-btn { order: 2; }
  .search-wrapper { order: 3; width: 100%; max-width: 100%; }

  .song-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
  }

  .player {
    width: 100%;
    bottom: 0;
    border-radius: 20px 20px 0 0;
    padding: 16px;
  }

  .player-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .player-info { text-align: center; }
  .player-extras { display: none; }
  
  .control-buttons { margin-bottom: 12px !important; }
}

@media (max-width: 480px) {
  .song-grid {
    grid-template-columns: repeat(3, 1fr); /* Force 3 columns on small phones */
  }
  
  .card-title, .card-artist {
    font-size: 0.65rem;
    max-width: 10ch;
  }
}

/* Sidebar Styling */
.about-sidebar {
  position: fixed; top: 0; right: -100%; width: 300px; height: 100%;
  background: #0a0a0f; border-left: 1px solid var(--border);
  padding: 40px 24px; z-index: 2000; transition: 0.4s var(--ease);
}
.about-sidebar.active { right: 0; }
.overlay { 
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); 
  backdrop-filter: blur(4px); z-index: 1500; display: none; 
}
.overlay.active { display: block; }