:root {
  /* premium palette: deep navy + charcoal, gold accent, soft neutrals */
  --sonix-accent: #D4AF37; /* gold */
  --sonix-accent-2: #9DD3C7; /* soft teal highlight */
  --sonix-bg: #05060a; /* near-black */
  --sonix-surface: #0d1114; /* deep surface */
  --sonix-muted: #9aa5b1;
  --sonix-white: #F6F7F9;
  --player-height: 96px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--sonix-bg);
  color: var(--sonix-white);
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow-x: hidden; /* prevent horizontal scroll */
}

body::-webkit-scrollbar {
  display: none;
}

.container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - var(--player-height));
  gap: 0;
}

/* utility hidden class - prefer adding/removing this instead of inline styles */
.hidden { display: none !important; }

/* keep main content from overlapping player on very small screens */
.main-content { padding-bottom: 10px; }

/* Sidebar Styles */
.sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 70%);
  padding: 24px 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 214, 200, 0.3);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 224, 213, 0.5);
}

.logo {
  color: var(--sonix-accent);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logo i {
  font-size: 32px;
}

.nav-menu {
  list-style: none;
  margin-bottom: 24px;
}

.nav-item {
  margin-bottom: 12px;
}

.nav-link {
  color: var(--sonix-grey);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.3s;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--sonix-white);
  background: rgba(255,255,255,0.03);
  transform: translateX(4px);
}

.nav-link.active {
  color: var(--sonix-accent);
  background: linear-gradient(90deg, rgba(212,175,55,0.06), transparent 60%);
  border-left: 3px solid var(--sonix-accent);
}

.nav-link i {
  font-size: 16px;
  width: 24px;
}

.sidebar-playlists {
  border-top: 1px solid rgba(255, 231, 223, 0.1);
  margin-top: 24px;
  padding-top: 16px;
}

.sidebar-playlists h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--sonix-grey);
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

#user-playlists-list {
  list-style: none;
}

#user-playlists-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#user-playlists-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--sonix-grey);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s;
  flex: 1;
}

#user-playlists-list li a:hover {
  color: var(--sonix-white);
  background: rgba(255, 234, 226, 0.1);
}

#user-playlists-list li .delete-playlist {
  background: none;
  border: none;
  color: var(--sonix-grey);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  font-size: 12px;
  padding: 4px;
}

#user-playlists-list li:hover .delete-playlist {
  opacity: 1;
  color: var(--sonix-orange);
}

/* Main Content Styles */
.main-content {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--sonix-dark) 100%);
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(184, 184, 184, 0.3);
  border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 201, 201, 0.5);
}

.search-bar-container {
  margin-bottom: 32px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.02);
  padding: 12px 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.03);
  transition: all 0.3s;
}

.search-bar:focus-within {
  border-color: var(--sonix-orange);
  background: rgba(207, 207, 206, 0.05);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--sonix-white);
  font-size: 14px;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--sonix-grey);
}

.search-bar i {
  color: var(--sonix-grey);
  font-size: 16px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--sonix-white);
  text-transform: capitalize;
}

/* Song Grid */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

/* Album Grid */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

.playlist-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 16px;
  border-radius: 12px;
  transition: all 0.28s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.playlist-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 245, 241, 0.1) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.playlist-card:hover {
  border-color: var(--sonix-orange);
  background: linear-gradient(
    135deg,
    rgba(195, 195, 195, 0.15) 0%,
    transparent 100%
  );
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(255, 107, 53, 0.15);
}

.card-image-container {
  position: relative;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.playlist-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}

.playlist-card:hover .card-overlay {
  opacity: 1;
}

.card-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease;
  font-size: 14px;
  background: linear-gradient(135deg, var(--sonix-accent), rgba(212,175,55,0.8));
  color: var(--sonix-white);
}

.card-button:hover {
  transform: scale(1.08);
}

.card-like-button {
  background: var(--sonix-orange);
  color: var(--sonix-white);
}

.card-like-button.liked {
  background: var(--sonix-orange);
  color: var(--sonix-white);
}

.card-playlist-button {
  background: var(--sonix-orange);
}

.card-info {
  position: relative;
  z-index: 2;
}

.playlist-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--sonix-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-card p {
  font-size: 13px;
  color: var(--sonix-grey);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--sonix-grey);
}

.empty-state i {
  font-size: 64px;
  color: var(--sonix-orange);
  opacity: 0.3;
  margin-bottom: 20px;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 10px;
}

/* Player Styles */
.player {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-top: 1px solid rgba(255,255,255,0.03);
  padding: 14px 20px;
  height: var(--player-height);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 24px;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.track-image {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.track-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12px;
  color: var(--sonix-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-button {
  color: var(--sonix-white);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.7;
  transition: all 0.2s;
}

.control-button:hover {
  opacity: 1;
  color: var(--sonix-orange);
  transform: scale(1.1);
}

.control-button.play {
  font-size: 32px;
}

.progress-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time {
  font-size: 12px;
  color: var(--sonix-grey);
  min-width: 40px;
}

.progress {
  flex: 1;
  height: 5px;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.progress:hover {
  height: 7px;
  background: rgba(255, 107, 53, 0.2);
}

.progress-filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--sonix-orange);
  border-radius: 3px;
  width: 0%;
}

.volume-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.volume-slider {
  width: 100px;
  height: 5px;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}

.volume-filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--sonix-orange);
  border-radius: 3px;
  width: 70%;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.modal.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content {
  background-color: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 28px;
  max-width: 620px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(2,6,23,0.85);
  animation: slideUp 0.28s;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 53, 0.3);
  border-radius: 3px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--sonix-white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--sonix-grey);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--sonix-orange);
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 107, 53, 0.05);
  border: 2px solid rgba(255, 107, 53, 0.2);
  border-radius: 8px;
  color: var(--sonix-white);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 20px;
  transition: all 0.3s;
}

.modal-input:focus {
  outline: none;
  border-color: var(--sonix-orange);
  background: rgba(255, 107, 53, 0.1);
}

.modal-input::placeholder {
  color: var(--sonix-grey);
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 107, 53, 0.05);
  border: 1px solid rgba(255, 107, 53, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.playlist-item:hover {
  background: rgba(255, 107, 53, 0.1);
  border-color: var(--sonix-orange);
}

.playlist-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  color: var(--sonix-white);
  font-size: 14px;
  font-weight: 500;
}

.playlist-item-actions {
  display: flex;
  gap: 8px;
}

.modal-button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-button-primary {
  background: var(--sonix-orange);
  color: var(--sonix-white);
}

.modal-button-primary:hover {
  background: #ff8a52;
  transform: translateX(2px);
}

.modal-button-secondary {
  background: rgba(255, 107, 53, 0.1);
  color: var(--sonix-orange);
  border: 1px solid var(--sonix-orange);
}

.modal-button-secondary:hover {
  background: rgba(255, 107, 53, 0.2);
}

.modal-button-danger {
  background: rgba(255, 0, 0, 0.1);
  color: #ff4444;
  border: 1px solid #ff4444;
  padding: 8px 12px;
  font-size: 12px;
}

.modal-button-danger:hover {
  background: rgba(255, 0, 0, 0.2);
}

.modal-button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* Hamburger Button Styles */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--sonix-dark);
  border: 2px solid var(--sonix-grey);
  color: var(--sonix-white);
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
}

.hamburger-btn:hover {
  background: var(--sonix-grey);
  color: var(--sonix-dark);
}

.sidebar.mobile-open {
  display: block !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  z-index: 1000;
  background-color: #1a1a1a;
  box-shadow: 6px 0 30px rgba(0,0,0,0.6);
  transition: all ease-in-out 0.5s;
}

/* focus styles for accessibility */
:focus {
  outline: 2px solid rgba(29,185,84,0.3);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 220px 1fr;
  }

  .playlist-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .player {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 12px 16px;
  }

  .volume-controls {
    display: none;
  }

  .main-content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }

  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .playlist-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .player {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 12px 16px;
  }

  .now-playing {
    gap: 10px;
  }

  .track-image {
    width: 48px;
    height: 48px;
  }

  .control-buttons {
    gap: 16px;
  }

  .control-button.play {
    font-size: 28px;
  }

  .main-content {
    padding: 16px;
  }

  .search-bar {
    padding: 10px 16px;
  }

  .section-title {
    font-size: 22px;
  }

  .modal-content {
    padding: 24px;
    width: 95%;
  }
}

@media (max-width: 480px) {
  .playlist-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .playlist-card {
    padding: 12px;
  }

  .playlist-card h4 {
    font-size: 13px;
  }

  .playlist-card p {
    font-size: 11px;
  }

  .card-image-container {
    margin-bottom: 10px;
  }

  .control-button {
    font-size: 14px;
  }

  .control-button.play {
    font-size: 24px;
  }
}
