/* Reset et base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f7fa;
  color: #222;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#app {
  flex: 1;
  overflow-y: auto;
  padding: 1.5em 1.5em 5em 1.5em; /* bottom padding pour menu */
}

/* Gestion des vues */
.view {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: none; /* cache */
}

.view.active {
  display: block; /* affiche */
  opacity: 1;
  transform: translateY(0);
}

/* Titres */
h1 {
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 0.5em;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h2 {
  border-bottom: 2px solid #ddd;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
  font-weight: 600;
  color: #333;
}

/* Listes */
ul {
  padding-left: 1.2em;
  margin: 0;
}

li {
  margin-bottom: 0.5em;
  line-height: 1.4;
}

/* Menu bottom simple et discret */
#menu-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #ccc;
  display: flex;
  justify-content: space-around;
  padding: 0.8em 0;
  box-shadow: 0 -1px 5px rgba(0,0,0,0.05);
  z-index: 100;
}

#menu-bottom button {
  background: none;
  border: none;
  color: #666;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3em 1em;
  transition: color 0.3s ease;
  font-weight: 600;
}

#menu-bottom button.active {
  color: #0078d4;
  border-bottom: 3px solid #0078d4;
  font-weight: 700;
}

/* Style spectacles sur programmation */
.jour {
  margin-bottom: 2.5em;
}

.jour h2 {
  border-color: #0078d4;
  color: #0078d4;
}

.spectacle {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1em 1.2em;
  margin-bottom: 1em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: apparition 0.4s ease forwards;
}

.spectacle:hover {
  box-shadow: 0 6px 15px rgba(0,120,212,0.3);
}

.spectacle strong {
  color: #0078d4;
  min-width: 50px;
  display: inline-block;
  font-weight: 700;
}

.spectacle em {
  font-style: normal;
  font-weight: 700;
  color: #333;
}

.spectacle div.details {
  margin-top: 0.4em;
  font-size: 0.9em;
  color: #555;
  line-height: 1.3;
}

/* Animation apparition */
@keyframes apparition {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Favoris étoile */
.fav-star {
  background: none;
  border: none;
  font-size: 1.4em;
  color: #ffa500;
  cursor: pointer;
  margin-right: 0.6em;
  user-select: none;
  line-height: 1;
  vertical-align: middle;
  transition: transform 0.15s ease;
}

.fav-star:hover {
  transform: scale(1.2);
}

/* Bouton retirer favoris */
.btn-retirer {
  background-color: #e74c3c;
  border: none;
  color: white;
  padding: 0.3em 0.8em;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.btn-retirer:hover {
  background-color: #c0392b;
}

/* Loader */
#loader-programme {
  display: none;
  text-align: center;
  margin: 2em 0;
  font-weight: 600;
  color: #0078d4;
  font-size: 1.1em;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid #0078d4;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.5em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Bouton détails */
.btn-details {
  background-color: transparent;
  border: none;
  color: #0078d4;
  font-size: 0.95rem;
  user-select: none;
  transition: color 0.2s ease;
}

.btn-details:hover {
  color: #005a9e;
}

/* Détails spectacle : image à gauche, texte à droite */
.details-spectacle {
  display: flex;
  gap: 1em;
  margin-top: 0.6em;
  align-items: flex-start;
}

.details-spectacle img {
  max-width: 150px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  height: auto;
}

.details-spectacle p {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.4;
  flex-grow: 1;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .spectacle {
    padding: 0.8em 1em;
  }

  #filtrage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em;
  }

  #filtrage input {
    grid-column: 1 / -1;
  }

  #menu-bottom button {
    font-size: 0.9rem;
    padding: 0.5em;
  }

  /* Ajustement image détail pour mobile */
  .details-spectacle {
    flex-direction: column;
    gap: 0.5em;
  }

  .details-spectacle img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
  }
}
