/* ===========================
   THÈME PAR DÉFAUT (LIGHT)
   =========================== */
:root {
  --bg: #ffffff;
  --text: #000000;
  --card-bg: #f2f2f2;
  --card-border: #FFBE00; /* Ligne 1 */
  --button-bg: #000000;
  --button-text: #ffffff;
}

/* ===========================
   THÈME SOMBRE
   =========================== */
.dark {
  --bg: #111111;
  --text: #f5f5f5;
  --card-bg: #222222;
  --card-border: #FFBE00;
  --button-bg: #f5f5f5;
  --button-text: #000000;
}

/* Transition premium */
* {
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ===========================
   STRUCTURE
   =========================== */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

/* Horloge */
.current-time {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

/* Titre */
h1 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  text-align: center;
  background: #FFBE00;
  color: #000000;
  padding: 10px 16px;
  border-radius: 8px;
  width: 100%;
  max-width: 450px;
}

/* Liste */
.train-list {
  width: 100%;
  max-width: 450px;
}

/* Carte train */
.train {
  background: var(--card-bg);
  border-left: 8px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

/* Temps */
.time {
  font-size: 1.6rem;
  font-weight: 700;
}

/* Destination */
.info {
  font-size: 1rem;
  opacity: 0.7;
  text-align: right;
}

/* Bouton */
button {
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 1rem;
  cursor: pointer;
}

/* Bouton switch */
#theme-toggle {
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 480px) {
  .current-time {
    font-size: 2.6rem;
  }
  h1 {
    font-size: 1.2rem;
  }
  .time {
    font-size: 1.4rem;
  }
}

/* BARRE DU HAUT */
.top-bar {
  width: 100%;
  max-width: 450px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

/* Logo ligne 1 */
.ligne-logo {
  width: 40px;
  height: 40px;
}

/* Bouton thème */
.theme-btn {
  flex: 1;
  margin: 0 10px;
}

/* Bouton info */
/* Bouton info sous forme d'image (sans fond) */
.info-btn {
  width: 34px;
  height: 34px;
  object-fit: contain;
  cursor: pointer;

  /* Supprime tout héritage de style bouton */
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* POPUP */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.popup-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.popup {
  background: var(--bg);
  color: var(--text);
  padding: 20px;
  border-radius: 12px;
  width: 85%;
  max-width: 350px;
  text-align: center;
  transform: translateY(20px);
  transition: transform .3s ease;
}

.popup-overlay.visible .popup {
  transform: translateY(0);
}

.download-btn, .close-btn {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  width: 100%;
}

/* Images de la top-bar (logo ligne 1 + bouton info) */
.top-bar img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  background: none !important;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}

/* Barre d'annonce en bas */
.alert-bar {
  position: fixed;
  bottom: -80px;
  left: 0;
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
  transition: bottom 0.4s ease, background-color 0.3s ease;
  z-index: 9999;
  color: white;
}

.alert-bar.visible {
  bottom: 0;
}

.alert-normal {
  background: #28a745; /* Vert */
}

.alert-warning {
  background: #ff3b30; /* Rouge */
}