/*
  style.css
  Feuille de style principale du site SNT
  - Thème sombre et clair avec glassmorphism
  - Responsive design
  - Effets modernes sur les boutons et cartes
*/

/* --- Style général et fond spatial --- */
body, body.light-theme {
  /* Image de fond spatiale pour tous les thèmes */
  background: url("https://img.freepik.com/vecteurs-libre/explorez-beaute-espace-nocturne-pour-evenements-plein-air_1017-43425.jpg?semt=ais_hybrid") no-repeat center center fixed !important;
  background-size: cover !important;
  text-align: center;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  color: #eaf6ff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Spécifique à Collection.html */
body.collection {
  color: #5e81c7;
}

/* --- Effet glassmorphism sur les cartes, titres, etc. --- */
.planet-card, .card, h1, .planet-container, .info, .infonom, .proba {
  /* Fond semi-transparent, flou et ombre */
  background: rgba(20, 30, 60, 0.65);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
}

.planet-card, .card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.planet-card:hover, .card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 16px 40px 0 rgba(31, 38, 135, 0.45);
}

.planet-card img, .planet-img img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* --- Titres et textes principaux --- */
h1 {
  color: #7ecbff;
  text-align: center;
  margin-top: 40px;
  font-family: 'Orbitron', 'Consolas', Arial, sans-serif;
  font-weight: 700;
  background: rgba(20, 30, 60, 0.75);
  border: none;
  padding: 20px 40px;
  border-radius: 16px;
  margin-right: auto;
  margin-left: auto;
  max-width: 700px;
  letter-spacing: 2px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  display: block;
}

/* Spécifique à index.html */
h1.index {
  color: #4229ff;
  margin-top: 20px;
  padding: 10px 20px;
}
h2 {
  color: #b3e0ff;
  text-align: center;
  margin-top: 30px;
  font-family: 'Segoe UI', 'Sitka Text', Arial, sans-serif;
  font-weight: 400;
  background: rgba(20, 30, 60, 0.55);
  border-radius: 12px;
  padding: 10px 20px;
  display: inline-block;
}
ul {
  list-style-type: none;
  padding: 0;
  width: 100%;
  align-items: center;
  justify-content: center;
}
p {
  color: #7ecbff;
  font-family: 'Segoe UI', 'Sitka Text', Arial, sans-serif;
  font-size: 1.15em;
  font-weight: 500;
}
li {
  background: rgba(30, 40, 80, 0.7);
  border: 1px solid #26a7cb68;
  margin: 10px;
  padding: 14px;
  border-radius: 8px;
  color: #b3e0ff;
  font-size: 1.1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
img {
  border-radius: 36px;
  border: 4px solid #7ecbff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* --- Boutons modernes avec animation --- */
.btn, .spin-btn, .collec, .back {
  margin: 20px 10px 20px 10px;
  padding: 12px 28px;
  font-size: 1.1em;
  background: linear-gradient(90deg, #3a8dde 0%, #7ecbff 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  outline: none;
  letter-spacing: 1px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.btn:hover, .spin-btn:hover, .collec:hover, .back:hover {
  background: linear-gradient(90deg, #7ecbff 0%, #3a8dde 100%);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.collec {
  background: rgb(55, 137, 225);
  font-size: 20px;
}
.collec:hover {
  background: rgb(20, 86, 156);
}

.back {
  float: left;
  margin-top: 20px;
  margin-left: 20px;
  background: linear-gradient(90deg, #1e3c72 0%, #2a5298 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 1.1em;
  padding: 10px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.back:hover {
  background: linear-gradient(90deg, #2a5298 0%, #1e3c72 100%);
}

/* --- Grille responsive pour la collection de planètes --- */
.planet-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 30px;
  justify-items: center;
  align-items: stretch;
}

.planet-card, .card {
  width: 320px;
  min-height: 340px;
  margin: 30px 10px;
  padding: 28px 18px 18px 18px;
  border-radius: 18px;
  border: none;
  background: rgba(20, 30, 60, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.planet-img {
  width: 170px;
  height: 170px;
  background: rgb(0, 0, 0) url("https://i.postimg.cc/T3B9Dh3v/carte-point-d-interogation.png") center/contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin: 0 auto 18px auto;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.planet-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.info, .infonom, .proba {
  margin-top: 12px;
  padding: 12px;
  font-size: 1.1em;
  color: #b3e0ff;
  width: 100%;
  border-radius: 8px;
  font-family: 'Segoe UI', 'Consolas', Arial, sans-serif;
  font-weight: 500;
  background: rgba(30, 40, 80, 0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.infonom {
  font-size: 1.3em;
  font-weight: 700;
  background: rgba(30, 40, 80, 0.85);
}
.proba {
  font-size: 1.1em;
  font-weight: 600;
  background: rgba(30, 40, 80, 0.85);
}

/* --- Responsive pour les titres, cartes et images --- */
@media (max-width: 1100px) {
  .planet-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .planet-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    align-items: stretch;
  }
  h1 {
    margin-left: 10px;
    margin-right: 10px;
    font-size: 1.3em;
    padding: 10px 5px;
  }
  .planet-card, .card {
    width: 95vw;
    min-width: unset;
    margin: 18px 0;
    padding: 18px 5px;
  }
  .planet-container {
    gap: 12px;
  }
}
@media (max-width: 600px) {
  h1 {
    font-size: 1.1em;
    padding: 8px 2px;
  }
  .planet-card, .card {
    width: 98vw;
    margin: 10px 0;
    padding: 10px 2px;
  }
  .planet-img {
    width: 120px;
    height: 120px;
  }
}

/* --- Description de la Terre limitée à 3 lignes --- */
.terre-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  min-height: 3.6em;
  color: #23272f !important;
}

/* --- Bouton de changement de thème en haut à droite --- */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 32px;
  z-index: 1000;
  background: linear-gradient(90deg, #d3deea 0%, #b7c7d9 100%);
  color: #3a5c7e;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.6em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  background: linear-gradient(90deg, #b7c7d9 0%, #d3deea 100%);
  color: #4e6a8a;
  transform: scale(1.08) rotate(15deg);
}

/* --- Thème clair : bleu-gris doux --- */
body.light-theme {
  background: #b7c7d9 !important;
  color: #23272f !important;
}
body.light-theme h1, body.light-theme h2, body.light-theme .planet-card, body.light-theme .card, body.light-theme .info, body.light-theme .infonom, body.light-theme .proba, body.light-theme .planet-container {
  background: rgba(200, 215, 230, 0.97) !important;
  color: #23272f !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  border: 1.5px solid #a0b3c9;
}
body.light-theme h1 {
  color: #3a5c7e !important;
}
body.light-theme h2 {
  color: #4e6a8a !important;
}
body.light-theme li {
  background: #d3deea !important;
  color: #23272f !important;
  border: 1px solid #a0b3c9;
}
body.light-theme p {
  color: #3a5c7e !important;
}
body.light-theme img {
  border: 4px solid #4e6a8a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.light-theme .btn, body.light-theme .spin-btn, body.light-theme .collec, body.light-theme .back {
  background: linear-gradient(90deg, #d3deea 0%, #b7c7d9 100%) !important;
  color: #23272f !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.light-theme .btn:hover, body.light-theme .spin-btn:hover, body.light-theme .collec:hover, body.light-theme .back:hover {
  background: linear-gradient(90deg, #b7c7d9 0%, #d3deea 100%) !important;
  color: #3a5c7e !important;
}
body.light-theme .planet-img {
  background: #d3deea url("https://i.postimg.cc/T3B9Dh3v/carte-point-d-interogation.png") center/contain no-repeat !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.light-theme .terre-desc {
  color: #23272f !important;
}
