:root {
  --bg-color: #080808;
  --sidebar-bg: #111111;
  --player-bg: rgba(18, 18, 18, 0.85);
  --accent-color: #FFD700;
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --card-bg: #1c1c1e;
  --card-hover: #2c2c2e;
  --border-radius: 14px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-width: 260px;
  --player-height: 90px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Protection des images (anti-drag et anti-sélection) */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none; /* Désactive le clic droit sur les images de décoration */
}

/* Exception pour les images qui doivent rester interactives si besoin (ex: boutons avec icônes) */
button img, a img {
  pointer-events: auto;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top right, #252525, var(--sidebar-bg));
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* Base Layout */
#app {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 1fr; /* Le lecteur est maintenant flottant */
  height: 100vh;
  overflow: hidden;
}

aside {
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

main {
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transition: padding-bottom 0.4s ease; /* Pour s'adapter à l'ouverture du lecteur */
}

main::-webkit-scrollbar {
  width: 6px;
}

main::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 10px;
}

.logo-container {
  padding: 0 24px;
  margin-bottom: 30px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

nav ul {
  list-style: none;
  padding: 0 10px;
}

nav li {
  margin-bottom: 5px;
}

.nav-link, .sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-weight: 500;
  font-size: 15px;
}
.nav-link i, .sidebar-footer a i {
  width: 20px;
  height: 20px;
}
@keyframes slideUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0% { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: 0.4; transform: scale(1.2); }
}

.nav-link:hover, .sidebar-footer a:hover {
  color: var(--accent-color);
  background-color: var(--nav-hover);
  transform: scale(1.04);
  transform-origin: left center;
}
.nav-link.active {
  color: var(--accent-color);
  background-color: var(--nav-active);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  transform: scale(1.04);
  transform-origin: left center;
}

.nav-section-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 20px 24px 10px;
}

/* Main Content Area */
main {
  grid-column: 2;
  grid-row: 1;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

main::-webkit-scrollbar {
  width: 6px;
}

main::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 10px;
}

/* View Container */
#view-container {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Player Toolbar */
#global-player {
  grid-column: 1 / -1;
  grid-row: 2;
  background-color: var(--player-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

/* Typographic & Util Classes */
.h1 {
  font-size: 64px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
  letter-spacing: -2px;
  background: linear-gradient(to right, #ffffff, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 15px;
}

.h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-color) 15%, var(--accent-color) 85%, transparent 100%);
  opacity: 0.5;
}

.p-text { font-size: 16px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 20px; }

/* Neon Button */
.btn-primary {
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  padding: 12px 32px;
  border-radius: 500px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2), inset 0 0 10px rgba(255, 215, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* Glassmorphism Cards with Glow */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.spotify-card {
  background: transparent;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.spotify-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.spotify-cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 16px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.spotify-cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.spotify-play-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 8px rgba(0,0,0,0.3);
}

.spotify-play-btn:hover {
  transform: translateY(0) scale(1.05) !important;
  background-color: #ffd700;
}

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

.spotify-info {
  display: flex;
  flex-direction: column;
}

.spotify-title {
  color: white;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-subtitle {
  color: #a7a7a7;
  font-size: 14px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Album */
.album-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.album-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.album-modal-content {
  background: linear-gradient(180deg, rgba(40,40,40,1) 0%, rgba(20,20,20,1) 100%);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: 12px;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.05);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.album-modal-overlay.active .album-modal-content {
  transform: scale(1);
}

.album-modal-header {
  display: flex;
  gap: 20px;
  padding: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.album-modal-cover {
  width: 150px;
  height: 150px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.album-modal-details {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.album-modal-type {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: bold;
  color: white;
  margin-bottom: 5px;
}

.album-modal-title {
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin: 0 0 10px 0;
  line-height: 1.2;
}

.album-modal-meta {
  color: #a7a7a7;
  font-size: 14px;
}

.album-modal-tracks {
  padding: 20px 30px;
}

.track-row {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #a7a7a7;
}

.track-row:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.track-row.active {
  color: var(--accent-color);
}

.track-row-num {
  width: 30px;
  font-size: 14px;
}

.track-row-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* -------------------------------------
   JAM PLAYER REPLICATION STYLES
   ------------------------------------- */

.player-bar {
  position: fixed;
  bottom: 0;
  left: 250px;
  width: calc(100% - 250px);
  background-color: var(--player-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  height: var(--player-height);
  transform: translateY(100%); /* Hidden by default */
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-bar.visible {
  transform: translateY(0);
}

.player-toggle-btn {
  position: absolute;
  top: -30px;
  right: 40px;
  width: 40px;
  height: 30px;
  background-color: var(--player-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s;
}

.player-toggle-btn:hover {
  color: var(--accent-color);
}

.current-track {
  width: 30%;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-cover {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background-color: #282828;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.track-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.track-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  text-overflow: ellipsis;
  overflow: hidden;
}

.track-artist {
  font-size: 12px;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  overflow: hidden;
}

.scrolling-text {
  width: max-content;
  animation: scroll-text 8s linear infinite alternate;
}

@keyframes scroll-text {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--scroll-dist, -50px)); }
}

.btn-ctrl {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-ctrl:hover {
  color: var(--text-primary);
}

.btn-ctrl i {
  width: 16px;
  height: 16px;
}

.player-controls {
  flex: 1;
  max-width: 722px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.control-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

.controls-left, .controls-right {
  display: flex;
  gap: 8px;
  width: 60px;
}

.controls-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-play-pause {
  background-color: var(--text-primary);
  color: var(--bg-color);
  width: 32px;
  height: 32px;
  padding: 0;
}

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

.playback-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-container {
  flex: 1;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-bar {
  height: 100%;
  background-color: var(--text-primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-container:hover .progress-bar {
  background-color: var(--accent-color);
}

.volume-controls {
  width: 30%;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.volume-bar-container {
  width: 93px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.volume-bar {
  height: 100%;
  background-color: var(--text-secondary);
  border-radius: 2px;
  width: 50%;
}

.volume-bar-container:hover .volume-bar {
  background-color: var(--accent-color);
}

/* Section / Disc Separator imported from JAM App */
.content-separator {
  padding: 12px 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--accent-color);
  margin: 60px 0 20px 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.content-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-color) 15%, var(--accent-color) 85%, transparent 100%);
  opacity: 0.5;
}

/* JAM Features: Modals & Library */
.jam-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.jam-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.jam-modal-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jam-modal-overlay.active .jam-modal-content {
  transform: translateY(0);
}

.jam-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.jam-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.jam-modal-header button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
}

.jam-modal-header button:hover {
  color: white;
}

.jam-playlist-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  max-height: 200px;
  overflow-y: auto;
}

.jam-playlist-list li {
  padding: 10px 15px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.jam-new-playlist-form {
  display: flex;
  gap: 10px;
}

.jam-new-playlist-form input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px 15px;
  border-radius: 8px;
  color: white;
  outline: none;
}

.jam-new-playlist-form input:focus {
  border-color: var(--accent-color);
}

/* Favorite Button State */
#player-favorite-btn i.liked {
  fill: var(--accent-color);
  color: var(--accent-color);
  stroke: var(--accent-color);
  animation: heart-burst 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heart-burst {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   MOBILE RESPONSIVE (Max-width: 768px)
   ========================================================================== */
.mobile-header {
  display: none;
}
#mobile-overlay {
  display: none;
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
  }
  
  .menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
  }
  
  #app {
    display: block; /* Remove grid */
    padding-top: 55px; /* Space for mobile header */
    height: 100dvh;
    overflow-y: auto;
  }
  
  main {
    padding: 20px;
    height: auto;
    overflow: visible;
    padding-bottom: 120px; /* Space for player */
  }
  
  aside {
    position: fixed;
    top: 0;
    left: -300px;
    width: 260px;
    height: 100%;
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
  }
  
  .menu-open aside {
    left: 0;
  }
  
  .menu-open #mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1500;
    backdrop-filter: blur(5px);
  }
  
  aside .logo-container {
    display: none !important; /* Hide logo in sidebar on mobile since it's in header */
  }
  
  /* Player mobile */
  .player-bar {
    left: 0;
    width: 100%;
    padding: 10px 15px 15px 15px;
    height: auto;
    min-height: var(--player-height);
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
  
  .player-toggle-btn {
    right: 20px;
  }
  
  .player-track-info {
    width: auto;
    max-width: 60%;
  }
  
  .player-controls {
    flex: 1;
    min-width: auto;
    justify-content: flex-end;
  }
  
  .player-volume {
    display: none !important; /* OS handles volume */
  }
  
  .progress-container {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
  }
  
  /* Views */
  .view-home .hero {
    min-height: 400px !important;
    margin: -20px -20px 40px -20px !important;
  }
  
  /* Stacking flex items */
  .view-home > div:nth-child(2),
  .view-bio > div:nth-child(2),
  .view-contact > div > div:first-child {
    flex-direction: column !important;
  }
  
  .view-contact > div {
    flex-direction: column !important;
  }
  
  .view-contact > div > div {
    width: 100% !important;
    flex: none !important;
  }
  
  /* Grid adjustments */
  .jam-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 15px;
  }
  
  .album-card-img {
    height: 140px !important;
  }
}
