/* === style.css === */
:root {
  --bg-black: #000000;
  --bg-base: #121212;
  --bg-highlight: #1a1a1a;
  --text-main: #FFFFFF;
  --text-dim: #b3b3b3;
  --accent: #1DB954;
  --heart: #7d5fff;
  --player-height: 90px;
  --sidebar-width: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-black);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  overflow: hidden;
  height: 100vh;
}

#visualizer-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.2;
}

.app-container { display: flex; height: 100vh; width: 100%; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: #000;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.logo { font-size: 1.4rem; font-weight: 900; color: var(--accent); padding: 0 12px; }

.nav-menu, .playlist-list { list-style: none; }
.nav-menu li, .playlist-item {
  padding: 12px;
  border-radius: 4px;
  color: var(--text-dim);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-menu li:hover, .nav-menu li.active, .playlist-item:hover {
  color: #fff;
  background: var(--bg-highlight);
}

.sidebar-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding: 0 12px;
}

/* Content Area */
.content-area {
  flex: 1;
  background: linear-gradient(to bottom, #222 0%, #121212 40%, #121212 100%);
  overflow-y: auto;
  padding: 24px;
  padding-bottom: 120px;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.5s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Shelves */
.shelf { margin-bottom: 40px; }
.shelf h2 { font-size: 1.5rem; margin-bottom: 16px; font-weight: 800; }

.shelf-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.shelf-scroll::-webkit-scrollbar { display: none; }

/* Cards */
.music-card {
  min-width: 180px;
  max-width: 180px;
  background: #181818;
  padding: 16px;
  border-radius: 8px;
  transition: background 0.3s;
  cursor: pointer;
}
.music-card:hover { background: #282828; }

.card-art {
  width: 100%;
  aspect-ratio: 1;
  background: #333;
  border-radius: 4px;
  margin-bottom: 12px;
  background-size: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.card-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-artist { color: var(--text-dim); font-size: 0.8rem; }

/* Player Bar */
.player-bar {
  position: fixed;
  bottom: 0; left: 0; width: 100%; height: var(--player-height);
  background: #181818;
  border-top: 1px solid #282828;
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
}

.now-playing { width: 30%; display: flex; align-items: center; gap: 12px; }
.track-art { width: 56px; height: 56px; border-radius: 4px; background: #333; background-size: cover; }
.track-info { overflow: hidden; }
.track-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 0.75rem; color: var(--text-dim); }

.heart-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #fff; transition: 0.2s; }
.heart-btn.active { color: var(--accent); transform: scale(1.1); }

.player-controls { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.main-controls { display: flex; align-items: center; gap: 24px; }
.main-controls button { background: none; border: none; color: var(--text-dim); font-size: 1.2rem; cursor: pointer; }
.main-controls button:hover { color: #fff; }

.play-btn {
  background: #fff !important; color: #000 !important;
  width: 32px; height: 32px; border-radius: 50% !important;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem !important;
}

.progress-container { width: 100%; max-width: 500px; display: flex; align-items: center; gap: 8px; font-size: 0.7rem; color: var(--text-dim); }
.progress-bar { flex: 1; height: 4px; background: #4f4f4f; border-radius: 2px; cursor: pointer; }
.progress-fill { height: 100%; background: #fff; width: 0%; border-radius: 2px; }

.extra-controls { width: 30%; display: flex; justify-content: flex-end; }
.extra-controls button { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #fff; opacity: 0.8; }

/* Language */
.lang-switch { margin-top: auto; padding: 12px; }
#lang-btn { background: #282828; color: #fff; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; width: 100%; }

body.ltr { direction: ltr; text-align: left; }
body.ltr .nav-menu li, body.ltr .playlist-item { flex-direction: row; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; bottom: var(--player-height); left: 0; width: 100%; height: auto;
    flex-direction: row; padding: 8px; background: #000; border-top: 1px solid #282828;
  }
  .sidebar .logo, .sidebar-section, .lang-switch { display: none; }
  .nav-menu { width: 100%; justify-content: space-around; display: flex; }
  .nav-menu li { flex-direction: column; font-size: 0.65rem; padding: 4px; gap: 4px; }
  
  .content-area { padding-bottom: 180px; }
  .now-playing { width: 70%; }
  .player-controls { display: none; }
}