/* =================================================================== */
/* PARTIE 1 : STYLE GÉNÉRAL (LES FONDATIONS) */
/* =================================================================== */

/* Définition des variables pour le thème sombre (par défaut) */
:root {
  /* Couleurs */
  --couleur-principale: #1db954;
  --couleur-principale-hover: #1ed760;
  --couleur-fond: #121212;
  --couleur-surface: #1e1e1e;
  --couleur-bordure: rgba(255, 255, 255, 0.1);
  --couleur-accent-transparent: rgba(255, 255, 255, 0.1);
  --couleur-accent-transparent-hover: rgba(255, 255, 255, 0.2);

  /* Typographie */
  --texte-primaire: #ffffff;
  --texte-secondaire: rgba(255, 255, 255, 0.7);
  --police-principale: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Formes et Transitions */
  --radius-bordure: 8px;
  --radius-cercle: 50%;
  --transition-rapide: all 0.3s ease;

  /* Ombres */
  --ombre-legere: 0 4px 8px rgba(0, 0, 0, 0.2);
  --ombre-moyenne: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.light-theme {
  /* Couleurs */
  --couleur-principale: #1db954;
  --couleur-principale-hover: #1aa34a;
  --couleur-fond: #f4f4f9;
  --couleur-surface: #ffffff;
  --couleur-bordure: #e0e0e0;
  --couleur-accent-transparent: rgba(0, 0, 0, 0.05);
  --couleur-accent-transparent-hover: rgba(0, 0, 0, 0.1);

  /* Typographie */
  --texte-primaire: #121212;
  --texte-secondaire: #555555;

  /* Ombres */
  --ombre-legere: 0 4px 8px rgba(0, 0, 0, 0.1);
  --ombre-moyenne: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Styles de base appliqués à toute la page */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--police-principale);
  background-color: var(--couleur-fond);
  color: var(--texte-primaire);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =================================================================== */
/* PARTIE 2 : BANNIÈRE (#beat-banner) */
/* =================================================================== */

#beat .beat-banner {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--ombre-moyenne);
}

#beat .beat-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#beat .beat-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

#beat .beat-banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 30px;
  width: 100%;
  z-index: 2;
  color: #ffffff;
}

#beat .beat-banner-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#beat .beat-banner-subtitle {
  font-size: 1.2rem;
  margin-bottom: 20px;
  max-width: 600px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#beat .beat-banner-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#beat .beat-badge {
  background-color: var(--couleur-principale);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--couleur-principale);
  color: #ffffff;
}

#beat .cart-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: var(--couleur-accent-transparent);
  border: 1px solid transparent;
  border-radius: var(--radius-cercle);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texte-primaire);
  font-size: 20px;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition-rapide);
}

#beat .cart-toggle:hover {
  background-color: var(--couleur-accent-transparent-hover);
  transform: scale(1.05);
}

#beat .cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--couleur-principale);
  color: #ffffff;
  border-radius: var(--radius-cercle);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: var(--ombre-legere);
}

/* =================================================================== */
/* PARTIE 4 : STYLE UNIFIÉ & STRUCTURE DES CARTES (CORRIGÉ)           */
/* =================================================================== */
#beat .albums-grid,
#beat .tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
#beat .btngrille {
  display: flex;
  gap: 5px;
  margin: 5px 0;
}
#beat .track-album,
#beat .track-card {
  background: var(--couleur-surface);
  border-radius: var(--radius-bordure);
  border: 1px solid var(--couleur-bordure);
  padding: 1rem;
  transition: var(--transition-rapide);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#beat .track-album:hover,
#beat .track-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ombre-moyenne);
}
#beat .album-image,
#beat .track-image-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-bordure);
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
#beat .album-image img,
#beat .track-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
#beat .track-album:hover img,
#beat .track-card:hover .track-image {
  transform: scale(1.05);
}
#beat .track-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition-rapide);
}
#beat .track-card:hover .track-overlay {
  opacity: 1;
}

/* =================================================================== */
/* PARTIE 5 : DISPOSITION DES INFOS & ACTIONS (CORRIGÉ)               */
/* =================================================================== */
#beat .track-info,
#beat .list-view-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}
#beat .track-name,
#beat .track-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--texte-primaire);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#beat .artist-name {
  font-size: 0.875rem;
  color: var(--texte-secondaire);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
#beat .artist-name:hover,
#beat .artist-name:hover .artist-name-text {
  color: var(--couleur-principale);
}
#beat .album-genre,
#beat .track-genre {
  font-size: 0.75rem;
  color: var(--couleur-principale);
  font-weight: 500;
  margin-top: 0.5rem;
  text-transform: capitalize;
  position: absolute;
  top: -10px;
  left: 0;
  padding: 5px;
  background-color: white;
  border-radius: 2px;
  display: none;
}
#beat .album-price,
#beat .track-price {
  font-size: 1rem;
  font-weight: 500;
  color: var(--texte-primaire);
}
#beat .album-actions,
#beat .track-actions {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}
#beat .track-info .track-price {
  text-align: right;
  margin: 5px 0;
}
#beat .album-actions {
  margin-top: 1rem;
}
#beat .track-card .track-info {
  margin-bottom: 1rem;
}

/* =================================================================== */
/* PARTIE 6 : VUE LISTE SPÉCIFIQUE (CORRIGÉ)                           */
/* =================================================================== */
#beat .tracks-grid.list-view {
  grid-template-columns: 1fr;
  gap: 1rem;
}
#beat .tracks-grid.list-view .track-card {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}
#beat .tracks-grid.list-view .track-image-container {
  width: 80px;
  height: 80px;
  margin-bottom: 0;
}
#beat .tracks-grid.list-view .list-view-content {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
#beat .tracks-grid.list-view .track-info {
  margin-bottom: 0;
}
#beat .tracks-grid.list-view .track-info .track-price {
  display: none;
}
#beat .tracks-grid.list-view .track-actions {
  gap: 1rem;
}
#beat .tracks-grid.list-view .track-actions .track-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--texte-primaire);
  min-width: 60px;
  text-align: right;
}

/* =================================================================== */
/* PARTIE 7 : BOUTONS D'ACTION (LÉGÈREMENT AJUSTÉ)                     */
/* =================================================================== */
#beat .album-play-btn,
#beat .add-to-cart,
#beat .album-menu-btn,
#beat .play-icon {
  background-color: var(--couleur-accent-transparent);
  color: var(--texte-primaire);
  border: none;
  border-radius: var(--radius-cercle);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-rapide);
  flex-shrink: 0;
}
#beat .album-play-btn:hover,
#beat .add-to-cart:hover,
#beat .album-menu-btn:hover,
#beat .play-icon:hover {
  transform: scale(1.1);
}
#beat .add-to-cart {
  background-color: var(--couleur-principale);
  color: #ffffff;
}
#beat .add-to-cart:hover {
  background-color: var(--couleur-principale-hover);
}
#beat .play-icon {
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  background-color: rgba(29, 185, 84, 0.8);
  color: #ffffff;
}
#beat .play-icon:hover {
  background-color: var(--couleur-principale);
}
#beat .pause-icon,
#beat .pause-icon-i {
  display: none;
}

/* =================================================================== */
/* PARTIE 7 : PANIER - SUPERPOSITION & CONTENEUR PRINCIPAL            */
/* =================================================================== */
#beat .cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}
#beat .cart-overlay.active {
  display: flex;
  opacity: 1;
}
#beat .cart-container {
  background: var(--couleur-surface);
  width: 100%;
  max-width: 550px;
  max-height: 70vh;
  border-radius: var(--radius-bordure);
  border: 1px solid var(--couleur-bordure);
  box-shadow: var(--ombre-moyenne);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
#beat .cart-overlay.active .cart-container {
  transform: scale(1);
}

/* =================================================================== */
/* PARTIE 8 : PANIER - EN-TÊTE & INDICATEUR D'ÉTAPES                  */
/* =================================================================== */
#beat .cart-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--couleur-bordure);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
#beat .cart-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--texte-primaire);
}
#beat .cart-header .close-confirmation {
  background: transparent;
  border: none;
  color: var(--texte-secondaire);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-rapide);
}
#beat .cart-header .close-confirmation:hover {
  color: var(--couleur-destructive);
  transform: rotate(90deg);
}
#beat .step-indicator {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
  position: relative;
}
#beat .step-indicator::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--couleur-bordure);
  z-index: 0;
}
#beat .step {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-cercle);
  background: var(--couleur-surface);
  border: 2px solid var(--couleur-bordure);
  color: var(--texte-secondaire);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  z-index: 1;
  transition: var(--transition-rapide);
}
#beat .step.active {
  background: var(--couleur-principale);
  border-color: var(--couleur-principale);
  color: #ffffff;
}

/* =================================================================== */
/* PARTIE 9 : PANIER - LISTE D'ARTICLES & ÉTAT VIDE (ÉTAPE 1)         */
/* =================================================================== */
#beat .cart-step {
  display: none;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}
#beat .cart-step.active {
  display: flex;
}
#beat .cart-items {
  margin-bottom: 1.5rem;
}
#beat .cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--couleur-accent-transparent);
  border-radius: var(--radius-bordure);
  padding: 1rem;
  margin-bottom: 1rem;
}
#beat .cart-item-cover {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-bordure);
}
#beat .cart-item-info {
  flex-grow: 1;
}
#beat .cart-item-info h4 {
  color: var(--texte-primaire);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
#beat .cart-item-info p {
  color: var(--texte-secondaire);
  font-size: 0.875rem;
}
#beat .cart-item-price {
  color: var(--couleur-principale);
  font-weight: 600;
}
#beat .remove-btn {
  background: transparent;
  border: none;
  color: var(--texte-secondaire);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-cercle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-rapide);
}
#beat .remove-btn:hover {
  background: rgba(var(--couleur-destructive), 0.1);
  color: var(--couleur-destructive);
}
#beat .empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--texte-secondaire);
}
#beat .empty-cart i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
#beat .cart-summary {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--couleur-bordure);
}
#beat .cart-summary p {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--texte-primaire);
  margin-bottom: 1.5rem;
}
#beat .cart-summary span {
  font-weight: 600;
}

/* =================================================================== */
/* PARTIE 10 : PANIER - FORMULAIRES & BOUTONS UNIFIÉS                 */
/* =================================================================== */
#beat .form-group {
  margin-bottom: 1rem;
}
#beat .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--texte-secondaire);
  font-size: 0.9rem;
}
#beat .form-group input[type="text"],
#beat .form-group input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--couleur-accent-transparent);
  border: 1px solid var(--couleur-bordure);
  border-radius: var(--radius-bordure);
  color: var(--texte-primaire);
  font-size: 1rem;
  transition: var(--transition-rapide);
}
#beat .form-group input[type="text"]:focus,
#beat .form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--couleur-principale);
  box-shadow: 0 0 0 2px rgba(var(--couleur-principale), 0.2);
}
#beat .cart-navigation {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
#beat .checkout-btn,
#beat .back-btn,
#beat .next-btn,
#beat .submit-payment {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-bordure);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-rapide);
  border: none;
  flex: 1;
}
#beat .checkout-btn,
#beat .next-btn,
#beat .submit-payment {
  background: var(--couleur-principale);
  color: white;
}
#beat .checkout-btn:hover,
#beat .next-btn:hover,
#beat .submit-payment:hover {
  background: var(--couleur-principale-hover);
}
#beat .back-btn {
  background: var(--couleur-accent-transparent);
  color: var(--texte-primaire);
  border: 1px solid var(--couleur-bordure);
}
#beat .back-btn:hover {
  background: var(--couleur-accent-transparent-hover);
}

/* =================================================================== */
/* PARTIE 11 : PANIER - STYLES SPÉCIFIQUES AUX ÉTAPES 2, 3, 4          */
/* =================================================================== */
#beat .payment-methods label {
  display: flex;
  align-items: center;
  border: 1px solid var(--couleur-bordure);
  border-radius: var(--radius-bordure);
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-rapide);
  margin-bottom: 0.75rem;
}
#beat .payment-methods label:hover {
  border-color: var(--couleur-principale);
  background: var(--couleur-accent-transparent);
}
#beat .payment-methods input[type="radio"] {
  margin-right: 1rem;
  accent-color: var(--couleur-principale);
  width: 18px;
  height: 18px;
}
#beat .payment-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
#beat .payment-icon-wrapper i {
  font-size: 1.5em;
  color: var(--texte-secondaire);
}
#beat .payment-card-icon {
  height: 24px;
}
#beat .card-display {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  color: white;
  border-radius: var(--radius-bordure);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  font-family: "Courier New", monospace;
}
#beat .card-display p {
  margin: 0.5rem 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
#beat #cardDisplayNumber {
  font-size: 1.25rem;
  letter-spacing: 2px;
}
#beat #cardDisplayName {
  text-transform: uppercase;
}
#beat .confirmation-step {
  text-align: center;
  justify-content: center;
  gap: 1rem;
}
#beat .success-icon {
  font-size: 4rem;
  color: var(--couleur-principale);
}
#beat .confirmation-step h4 {
  font-size: 1.75rem;
  color: var(--texte-primaire);
}
#beat .confirmation-step p {
  color: var(--texte-secondaire);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}
#beat .confirmation-step .close-confirmation {
  max-width: 200px;
  margin: 0 auto;
}
