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

/* Base layout */
body {
  font-family: Arial, sans-serif;
  padding: 1rem;
  max-width: 700px;
  margin: auto;
  text-align: center;
  background-color: #f2f2f2;
  color: #000;
}

body.dark {
  background-color: #121212 !important;
  color: #eee !important;
}

body.dark #results p {
  color: #fff !important;
}

body.dark .result-container {
  background-color: #111 !important;
}

body.dark #watch-info {
  background-color: #1e1e1e;
  color: #eee;
}

/* Titres */
h1 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
  color: #333;
}

/* Vidéo + Canvas */
.video-wrapper {
  position: relative;
  width: 80%;
  margin: 0 auto;
  display: block;
  box-sizing: border-box;
}

video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: block;
}

/* Bouton overlay dans la vidéo-wrapper */
.button-overlay {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 2;
}

#start {
  padding: 10px 18px;
  font-size: 16px;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #28a745;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  opacity: 0.9;
}

#start:hover {
  opacity: 1;
}

/* Bloc principal */
#watch-info {
  display: block;
  background-color: #1e1e1e;
  padding: 1.5rem 0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  width: 80%;
  margin: 12px auto;
  transition: all 0.3s ease;
}

/* État centré par défaut tant qu'aucune montre n'est trouvée */
#watch-info.centered {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
}

#watch-info img {
  max-width: 140px;
  border-radius: 6px;
}

/* Résultats */
#results {
  width: 100%;
  text-align: center;
  min-height: 55px;
}

#results p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

#status {
  font-weight: bold;
  color: #00cc66;
  padding-top: 15px;
  text-align: center;
  margin-bottom: 1rem;
}

/* ========================= */
/* = TABLEAU FICHE MONTRE = */
/* ========================= */

.watch-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  table-layout: fixed;
}

.watch-table tr {
  height: 50px;
}

.watch-table td {
  padding: 6px 10px;
  vertical-align: middle;
  color: #eee;
}

.watch-table td:nth-child(2),
.watch-table td:nth-child(3) {
  width: 33%;
}

.watch-table td[rowspan="4"] {
  text-align: center;
  vertical-align: middle;
}

/* Image */
.watch-photo {
  display: block;
  margin: auto;
  max-height: 160px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  background-color: #1e1e1e;
}

/* Selects */
.watch-table select {
  width: 100%;
  height: 38px;
  padding: 0 8px;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid #444;
  background-color: #2a2a2a;
  color: #fff;
  appearance: none;
}

/* Boutons */
.wtb, .wts {
  width: 70%;
  height: 36px;
  font-weight: bold;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  color: #fff;
  margin-top: 4px;
}

.wtb {
  background-color: #007bff;
}

.wts {
  background-color: #dc3545;
}

.wtb:hover {
  background-color: #0056b3; /* plus foncé que #007bff */
}

.wts:hover {
  background-color: #c82333; /* plus foncé que #dc3545 */
}

.wtb:active,
.wts:active {
  transform: scale(0.97);
  box-shadow: none;
}


.watch-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 1rem 0;
}

.watch-mobile .watch-photo {
  max-width: 80%;
  height: auto;
  border-radius: 10px;
  background-color: transparent;
}

.watch-mobile select,
.watch-mobile .wtb,
.watch-mobile .wts {
  width: 90%;
  height: 40px;
  font-size: 0.95rem;
  border-radius: 6px;
  padding: 0 8px;
  border: 1px solid #444;
  background-color: #2a2a2a;
  color: #fff;
  appearance: none;
  text-align: center;
}

.watch-mobile .wtb {
  background-color: #007bff;
  font-weight: bold;
}

.watch-mobile .wts {
  background-color: #dc3545;
  font-weight: bold;
}

/* === FICHE MONTRE (watch-info) === */

.watch-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 1rem;
}

.watch-table tr {
  height: 60px; /* ✅ même hauteur pour toutes les lignes */
}

.watch-table td {
  padding: 8px;
  vertical-align: middle;
  color: #eee;
}

.watch-table td:nth-child(2),
.watch-table td:nth-child(3) {
  width: 33%;
}

.watch-table td[rowspan="3"] {
  text-align: center;
  vertical-align: middle;
  padding-right: 10px;
}

/* Image */
.watch-photo {
  max-height: 160px;
  width: auto;
  display: block;
  margin: auto;
  border-radius: 10px;
  background-color: transparent;
}

/* Selects et boutons alignés */
#watch-info select,
#watch-info .wtb,
#watch-info .wts {
  width: 100%;
  height: 40px;
  font-size: 0.95rem;
  border-radius: 6px;
  padding: 0 8px;
  border: 1px solid #444;
  background-color: #2a2a2a;
  color: #fff;
  appearance: none;
  margin: 0;
  vertical-align: middle;
  line-height: 1.2;
}

#watch-info .wtb,
#watch-info .wts {
  width: 100px;
  font-weight: bold;
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#watch-info .wtb {
  background-color: #007bff;
}

#watch-info .wts {
  background-color: #dc3545;
}

#watch-info .wtb:hover,
#watch-info .wts:hover {
  opacity: 1;
}

/* Responsive mobile */
@media (max-width: 480px) {
  .watch-mobile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 1rem;
  }

  .watch-photo {
    max-width: 60%;
    margin: 0 auto;
    display: block;
  }

  .field-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .field-block label {
    font-size: 0.75rem;
    text-align: left;
    color: #ccc;
  }

  .field-block select {
    height: 30px;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #444;
    background-color: #2a2a2a;
    color: #fff;
  }

  .button-pair {
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .button-pair .wtb,
  .button-pair .wts {
    height: 30px;
    font-size: 0.85rem;
    padding: 0 10px;
    min-width: 100px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }

  .button-pair .wtb {
    background-color: #007bff;
  }

  .button-pair .wts {
    background-color: #dc3545;
  }
}

