/*
  Thème Deefy - Style inspiré de Spotify
  Version 3.0 - Une approche plus raffinée
*/

/* 
 * =================================
 * PALETTE DE COULEURS & VARIABLES
 * =================================
 * Inspiré par Spotify pour une cohérence visuelle.
 */
:root {
  /* Couleurs de base */
  --deefy-bg: #121212;          /* Noir profond pour le fond */
  --deefy-surface: #181818;      /* Gris foncé pour les cartes et surfaces */
  --deefy-elevated: #242424;     /* Gris pour les éléments surélevés (survol) */
  --deefy-border: #2a2a2a;       /* Gris pour les bordures subtiles */
  
  /* Couleurs de texte */
  --deefy-text-primary: #ffffff; /* Blanc pour le texte principal */
  --deefy-text-secondary: #b3b3b3;/* Gris clair pour le texte secondaire */
  
  /* Couleur d'accentuation */
  --deefy-accent: #1DB954;       /* Vert Spotify iconique */
  --deefy-accent-hover: #1ED760; /* Vert plus vif pour le survol */

  /* Ombres & Rayons */
  --deefy-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --deefy-radius: 12px;
  --deefy-radius-pill: 500px;

  /* Police */
  --deefy-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Boîte universelle pour que le padding n'entraîne pas de débordements */
*, *::before, *::after { box-sizing: border-box; }

/* 
 * =================================
 * STYLES GLOBAUX
 * =================================
 */
html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--deefy-bg);
  color: var(--deefy-text-secondary);
  font-family: var(--deefy-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Utiliser flex mais laisser les enfants s'étirer pour que le padding soit pleinement visible */
  display: flex;
  flex-direction: column;
  align-items: stretch; /* au lieu de center, sinon les blocs ne prennent pas toute la largeur */
  min-height: 100vh;
  padding: 2rem;
  box-sizing: border-box;
}

/* S'assurer que le padding des conteneurs n'entraîne pas de débordement */
*, *::before, *::after { box-sizing: border-box; }

main, .container, .content {
  width: 100%;
  max-width: 1100px;
  padding: 2rem;
  margin-inline: auto; /* centrer le contenu dans le body étiré */
  margin-block: 1rem;              /* marge verticale autour des blocs principaux */
  border: 1px solid var(--deefy-border); /* bordure subtile autour des conteneurs */
  border-radius: var(--deefy-radius);
  background-color: var(--deefy-surface); /* légère surface sombre pour mieux délimiter */
}

/* 
 * =================================
 * TYPOGRAPHIE
 * =================================
 */
/* Titre principal "Deefy" */
.app-title {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  text-align: center;
  color: var(--deefy-accent);
  padding: 32px 16px;
  line-height: 1;
  text-shadow: 0 0 80px rgba(29, 185, 84, 0.3);
}

/* Titres de page (h1) */
h1 {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--deefy-accent);
  text-align: center;
  margin: 32px 0 24px;
  padding-bottom: 0.75rem;                 /* espace interne pour la bordure */
  border-bottom: 2px solid var(--deefy-border); /* bordure sous le h1 */
}

/* Sous-titres (h2, h3, h4) */
h2, h3, h4 {
  color: var(--deefy-text-primary);
  font-weight: 600;
  margin: 24px 0 16px;
}
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { color: var(--deefy-text-secondary); }

a {
  color: var(--deefy-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--deefy-text-primary); }

hr {
  border: none;
  height: 1px;
  background-color: var(--deefy-border);
  margin: 48px 0;
}

/* 
 * =================================
 * COMPOSANTS D'INTERFACE
 * =================================
 */

/* Bouton générique pour <a> et <button> */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 12px 24px;
  font-weight: 700;
  border-radius: var(--deefy-radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease, background-color .2s ease, color .2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-accent {
  background-color: var(--deefy-accent);
  color: #000;
}
.btn-accent:hover { background-color: var(--deefy-accent-hover); transform: translateY(-1px); }

/* Boutons principaux */
button, input[type="submit"], input[type="button"] {
  cursor: pointer;
  background-color: var(--deefy-accent);
  color: #000000;
  border: none;
  border-radius: var(--deefy-radius-pill);
  padding: 14px 32px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
  background-color: var(--deefy-accent-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Liens de navigation (style "bouton fantôme") */
h2 p a {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--deefy-border);
  color: var(--deefy-text-secondary);
  border-radius: var(--deefy-radius-pill);
  padding: 8px 16px;
  margin: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
}

h2 p a:hover {
  color: var(--deefy-text-primary);
  border-color: var(--deefy-text-secondary);
  background-color: var(--deefy-elevated);
}

/* En-tête de playlist (flex) */
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--deefy-border);
}

.playlist-title {
  margin: 0;
  color: var(--deefy-text-primary);
}

.playlist-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.playlist-meta {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--deefy-text-secondary);
}
.playlist-meta .playlist-count::after {
  content: '•';
  margin-left: .75rem;
  opacity: .6;
}

/* Carte de playlist (vue liste) */
.playlist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background-color: var(--deefy-surface);
  border: 2px solid var(--deefy-accent); /* encadrement vert sur cartes de playlist */
  border-radius: var(--deefy-radius);
  padding: 1rem 1.25rem;
  margin: .75rem 0;
}
.playlist-card:hover { border-color: var(--deefy-accent-hover); }
.playlist-card .playlist-title { font-size: 1.25rem; }

/* Lien englobant la carte de playlist pour rendre toute la carte cliquable */
.playlist-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.playlist-card-link:hover { text-decoration: none; }

/* Encadrement vert pour la vue playlist détaillée */
.playlist {
  border: 2px solid var(--deefy-accent); /* encadrement vert */
  border-radius: var(--deefy-radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  background-color: var(--deefy-surface);
}
.playlist:hover { border-color: var(--deefy-accent-hover); }

/* Cartes pour les pistes audio */
div:has(> audio) {
  background-color: var(--deefy-surface);
  border: 1px solid var(--deefy-border); /* bordure toujours visible */
  border-radius: var(--deefy-radius);
  padding: 20px;
  margin: 24px 0; /* un peu plus d'air entre les cartes */
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

div:has(> audio):hover {
  background-color: var(--deefy-elevated);
  border-color: var(--deefy-text-secondary); /* accentue légèrement au survol */
}

/* Lecteur audio */
audio {
  display: block;
  width: 100%;
  margin-top: 16px;
}

/* Formulaires */
label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"] {
  display: block;
  width: 100%;
  max-width: 500px;
  padding: 14px;
  color: var(--deefy-text-primary);
  background-color: var(--deefy-surface);
  border: 1px solid var(--deefy-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="file"]:focus {
  border-color: var(--deefy-accent);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.25);
}

/* Bouton de l'input[type=file] */
input[type="file"]::file-selector-button {
  margin-right: 16px;
  border: none;
  background-color: var(--deefy-text-secondary);
  color: var(--deefy-bg);
  padding: 8px 16px;
  border-radius: var(--deefy-radius-pill);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

input[type="file"]:hover::file-selector-button {
  background-color: var(--deefy-text-primary);
}

/* 
 * =================================
 * CLASSES UTILITAIRES
 * =================================
 */
.center { text-align: center; }
.muted { color: var(--deefy-text-secondary); }

/* 
 * =================================
 * RESPONSIVITÉ
 * =================================
 */
@media (max-width: 768px) {
  main, .container, .content {
    padding: 0 16px 32px;
  }

  .app-title {
    font-size: 4.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }
}



