/* ============================================
   IMPORTS & POLICES
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@100..900&family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #af0000;
  --color-primary-dark: #9b0000;
  --color-dark: #333;
  --color-light: #f5f5f5;
  --color-white: #fff;
  --color-gray: #666;
  --color-border: #ddd;
  --color-success: #4CAF50;
  --color-info: #2196F3;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 0 10px rgba(0, 0, 0, 0.1);
  --transition: 0.3s ease;
  --border-radius: 5px;
  --border-radius-lg: 10px;
}

body {
  margin: 0;
  font-family: 'Geologica', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--color-dark);
  line-height: 1.6;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
header {
  background-color: var(--color-light);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  position: sticky;
  top: 0;
  animation: slideDown 0.75s ease-in-out;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

nav ul li {
  margin: 0 10px;
}

nav a {
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: var(--border-radius);
  transition: all var(--transition);
  color: var(--color-dark);
  display: block;
}

nav a:hover {
  background-color: var(--color-border);
  transform: translateY(-2px);
}

nav .active a {
  background-color: #555;
  color: var(--color-white);
}

.bg-body-tertiary {
  background-color: var(--color-light) !important;
}

/* Bouton retour */
.retour {
  text-align: center;
  margin: 17px 0;
}

.retour a {
  text-decoration: none;
  color: var(--color-dark);
  font-size: 16px;
  font-weight: bold;
  padding: 10px 15px;
  border-radius: var(--border-radius);
  transition: all var(--transition);
  display: inline-block;
}

.retour a:hover {
  background-color: var(--color-border);
}

/* ============================================
   PAGE D'ACCUEIL
   ============================================ */
#titre_accueil {
  font-size: clamp(32px, 5vw, 50px);
  text-align: center;
  padding: 15px;
  font-weight: 700;
}

.home {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 20px 0;
}

.left-right {
  padding: 0 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
}

.left {
  flex: 1;
  max-width: 600px;
  animation: slideInLeft 1.5s ease;
}

.left span {
  color: var(--color-primary);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.left h1 {
  margin: 20px 0;
  font-size: clamp(28px, 4vw, 35px);
  font-weight: 700;
  line-height: 1.2;
}

.left p {
  font-size: 15px;
  margin-bottom: 20px;
  color: var(--color-gray);
}

.bouton-accueil {
  margin: 30px 0;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.bouton-accueil a {
  padding: 12px 30px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: all var(--transition);
  display: inline-block;
}

.bouton-accueil a:first-child {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background-color: transparent;
}

.bouton-accueil a:first-child:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.bouton-accueil a:last-child {
  background-color: var(--color-primary);
  color: var(--color-white);
  border: 2px solid var(--color-primary);
}

.bouton-accueil a:last-child:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(175, 0, 0, 0.3);
}

/* ============================================
   SLIDER / CAROUSEL
   ============================================ */
#slider {
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  margin: 0 auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

#slider figure {
  position: relative;
  width: 500%;
  margin: 0;
  padding: 0;
  font-size: 0;
  left: 0;
  animation: 25s slidy infinite;
}

#slider figure img {
  width: 20%;
  height: auto;
  display: inline-block;
}

@keyframes slidy {
  0%, 17% { left: 0%; }
  22%, 37% { left: -100%; }
  42%, 57% { left: -200%; }
  62%, 77% { left: -300%; }
  82%, 94% { left: -400%; }
}

#playlist {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

#playlist img {
  width: 100%;
  max-width: 800px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

/* Contrôles carousel */
.carousel-control-next,
.carousel-control-prev {
  opacity: 0;
}

/* ============================================
   CATALOGUE / LISTING
   ============================================ */
#catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding: 30px 10%;
  max-width: 1400px;
  margin: 0 auto;
}

.item {
  background-color: var(--color-light);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.item:hover {
  background-color: var(--color-dark);
  color: var(--color-white);
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition);
}

.item:hover img {
  transform: scale(1.05);
}

#image_album {
  position: relative;
  overflow: hidden;
}

.fa-solid.fa-circle-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-white);
  font-size: 60px;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.item:hover .fa-solid.fa-circle-play {
  opacity: 0.9;
}

.text_titre {
  text-align: center;
  font-size: 1.3em;
  font-weight: 700;
  margin: 15px 10px 10px;
  color: inherit;
}

.text_album {
  font-size: 1em;
  margin: 0 15px 15px;
  color: inherit;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text_item {
  font-size: 0.9em;
  margin: 0 15px 15px;
  color: inherit;
}

#card_text {
  margin: 10px;
  text-align: center;
}

/* ============================================
   RECHERCHE
   ============================================ */
.container_recherche {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

#intro_recherche {
  text-align: center;
  color: var(--color-primary);
  font-size: clamp(24px, 4vw, 32px);
  margin-bottom: 30px;
  font-weight: 700;
}

.conteneur_recherche {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.recherche_input {
  padding: 12px 20px;
  width: 100%;
  max-width: 500px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  outline: none;
  font-size: 16px;
  transition: border-color var(--transition);
}

.recherche_input:focus {
  border-color: var(--color-primary);
}

.bouton_recherche {
  padding: 12px 30px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition);
}

.bouton_recherche:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(175, 0, 0, 0.3);
}

.resultat-recherche {
  background-color: #f2f2f2;
  color: var(--color-gray);
  padding: 20px;
  border: 2px solid var(--color-dark);
  border-radius: var(--border-radius-lg);
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition);
  margin: 20px 0;
}

.resultat-recherche:hover {
  transform: scale(1.02);
}

/* ============================================
   GESTION / ADMIN
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-weight: 700;
  color: var(--color-dark);
}

/* Boutons de gestion */
.boutons_container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.retour_admin {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.retour_admin a,
.bouton_gestion a,
.bouton_retour a,
.bouton_gestion2 a,
.bouton_gestion0 a,
.bouton_retour_rep a,
.bouton_retour_rep_supp a,
.bouton_retour_rep_modif a {
  display: inline-block;
  padding: 12px 25px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition);
  font-size: 16px;
}

.bouton_gestion a,
.bouton_retour a,
.bouton_retour_rep a,
.bouton_retour_rep_supp a,
.bouton_retour_rep_modif a,
.retour_admin a {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.bouton_gestion a:hover,
.bouton_retour a:hover,
.retour_admin a:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(175, 0, 0, 0.3);
}

.bouton_gestion2 a {
  background-color: var(--color-success);
  color: var(--color-white);
}

.bouton_gestion2 a:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

.bouton_gestion0 a {
  background-color: var(--color-info);
  color: var(--color-white);
}

.bouton_gestion0 a:hover {
  background-color: #0D47A1;
  transform: translateY(-2px);
}

.bouton_retour_rep_supp,
.bouton_retour_rep_modif {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: var(--color-white);
  box-shadow: var(--shadow-md);
  border-radius: var(--border-radius);
  overflow: hidden;
}

thead {
  font-weight: bold;
}

th,
td {
  border: 1px solid #dee2e6;
  padding: 12px;
  text-align: center;
}

th {
  background-color: #343a40;
  color: var(--color-white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background-color: #f8f9fa;
}

tr:hover {
  background-color: #e9ecef;
}

#image_gestion img {
  width: 150px;
  height: auto;
  border-radius: var(--border-radius);
}

/* Liens dans les tableaux */
table a {
  text-decoration: none;
  color: #007bff;
  font-weight: 500;
  transition: color var(--transition);
}

table a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* ============================================
   FORMULAIRES
   ============================================ */
form {
  max-width: 500px;
  margin: 30px auto;
  padding: 30px;
  background-color: #f9f9f9;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-dark);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition);
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--color-primary);
}

form input[type="submit"],
form button[type="submit"] {
  width: 100%;
  padding: 14px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition);
}

form input[type="submit"]:hover,
form button[type="submit"]:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(175, 0, 0, 0.3);
}

/* ============================================
   MESSAGES DE RÉPONSE
   ============================================ */
.rep {
  text-align: center;
  margin: 30px 0;
}

.rep h2 {
  color: var(--color-info);
  font-size: 24px;
  font-weight: 700;
}

.rep_supp {
  text-align: center;
  margin: 30px 0;
  color: var(--color-primary);
  font-size: 24px;
  font-weight: 700;
}

.rep_modif {
  text-align: center;
  margin: 30px 0;
  color: var(--color-success);
  font-size: 24px;
  font-weight: 700;
}

.ajout_et_tout p {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background-color: var(--color-light);
  padding: 20px 0;
  margin-top: auto;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideDown {
  from {
    transform: translateY(-100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-600px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media screen and (max-width: 768px) {
  header {
    padding: 15px 5%;
  }

  .left-right {
    flex-direction: column;
    padding: 5%;
    gap: 30px;
  }

  .left {
    width: 100%;
    max-width: 100%;
  }

  #catalogue {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 5%;
  }

  .bouton-accueil {
    flex-direction: column;
    width: 100%;
  }

  .bouton-accueil a {
    width: 100%;
    text-align: center;
  }

  #slider {
    max-width: 100%;
  }

  .boutons_container {
    flex-direction: column;
    align-items: center;
  }

  .boutons_container > * {
    width: 100%;
    max-width: 300px;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 8px 4px;
  }

  form {
    padding: 20px;
  }
}

@media screen and (max-width: 481px) {
  main {
    margin-top: 80px;
  }

  #titre_accueil {
    font-size: 28px;
  }

  .left h1 {
    font-size: 24px;
  }

  #catalogue {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .item {
    max-width: 100%;
  }
}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */
@media screen and (min-width: 769px) {
  header {
    padding: 0 10%;
    height: 90px;
    display: flex;
    align-items: center;
  }

  .navbar-expand-sm .navbar-nav {
    flex-direction: row;
  }

  .navbar-expand-sm .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }

  .navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
  }

  .navbar-toggler {
    display: none;
  }

  .me-auto {
    margin-right: auto !important;
  }

  .mb-sm-0 {
    margin-bottom: 0 !important;
  }
}

/* ============================================
   UTILITAIRES
   ============================================ */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.p-20 {
  padding: 20px;
}