/* ==========================================
           CSS BASE E LAYOUT
           ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Usiamo flexbox per centrare perfettamente la splash page a tutto schermo */
body {
  background-color: #f4f7f6;
  color: #333;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ==========================================
           STILE DELLA CARD (Splash Page)
           ========================================== */
.splash-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 100%;
  animation: fadeIn 0.5s ease-in-out;
}

.splash-card h1 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 24px;
}
.splash-card p {
  color: #7f8c8d;
  margin-bottom: 30px;
  font-size: 14px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #34495e;
  font-size: 14px;
}
.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #bdc3c7;
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s;
}
.form-group input:focus {
  border-color: #3498db;
}

.btn-primario {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 14px 20px;
  width: 100%;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}
.btn-primario:hover {
  background-color: #2980b9;
}

.errore {
  color: #e74c3c;
  margin-top: 15px;
  font-size: 14px;
  display: none;
  font-weight: 500;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
           STILI PER LA SCELTA DELL'AVATAR (Vista 2)
           ========================================== */
.etichette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.etichetta-card {
  cursor: pointer;
  border: 2px solid #ecf0f1;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  transition: all 0.2s ease;
}

/* Nascondiamo il pallino del radio button */
.etichetta-card input[type="radio"] {
  display: none;
}

.etichetta-card img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 8px;
}

.etichetta-card span {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #7f8c8d;
}

/* Effetto quando l'avatar viene selezionato */
.etichetta-card input[type="radio"]:checked + img + span {
  color: #3498db;
}
.etichetta-card:has(input[type="radio"]:checked) {
  border-color: #3498db;
  background-color: #ebf5fb;
  transform: scale(1.05);
}

/* ==========================================
           STILI PER LA GRIGLIA PERCORSI (Vista 3)
           ========================================== */
.header-spazio {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.profilo-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-weight: 600;
  color: #2c3e50;
}

.profilo-mini img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.btn-logout {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.3s;
}

.btn-logout:hover {
  background: #c0392b;
}

.percorsi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.card-percorso {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

.card-percorso:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.card-percorso img.copertina {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-bottom: 4px solid #3498db;
}

.card-percorso .info {
  padding: 20px;
}
.card-percorso h3 {
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 18px;
}
.card-percorso p {
  color: #7f8c8d;
  font-size: 14px;
  line-height: 1.4;
}

.badge-completato {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #2ecc71;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ==========================================
           STILI PER L'ESPANSIONE DEL PERCORSO (Vista 4)
           ========================================== */
.percorso-espanso {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  margin: 0 auto 40px auto;
  max-width: 1000px;
  overflow: hidden;
  position: relative;
  animation: slideDown 0.4s ease-out;
}

.percorso-espanso .hero {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-bottom: 5px solid #3498db;
}

.percorso-espanso .contenuto {
  padding: 30px;
}

.percorso-espanso h2 {
  color: #2c3e50;
  font-size: 28px;
  margin-bottom: 10px;
}
.percorso-espanso .descrizione {
  color: #7f8c8d;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.btn-nascondi {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.3s;
  backdrop-filter: blur(5px);
}
.btn-nascondi:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* --- La Linea Verticale (Timeline) --- */
.timeline {
  margin-top: 20px;
  padding-left: 20px;
  border-left: 4px solid #ecf0f1; /* La linea verticale */
}

.milestone-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 30px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.milestone-item:hover {
  opacity: 0.8;
}

/* I "nodi" sulla linea */
.milestone-item::before {
  content: "";
  position: absolute;
  left: -12px; /* Centra il nodo sulla linea di 4px */
  top: 0;
  width: 20px;
  height: 20px;
  background: #3498db;
  border-radius: 50%;
  box-shadow: 0 0 0 4px white;
  transition: transform 0.2s;
}

.milestone-item:hover::before {
  transform: scale(1.3);
}

/* Colore verde se completata */
.milestone-item.completata::before {
  background: #2ecc71;
}

.milestone-item h4 {
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 5px;
}
.milestone-item p {
  color: #7f8c8d;
  font-size: 14px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
           STILI PER LA MILESTONE E ATTIVITÀ (Vista 5)
           ========================================== */
.milestone-espansa {
  margin-top: 40px;
  background: #fdfdfd;
  border: 1px solid #ecf0f1;
  border-radius: 12px;
  overflow: hidden;
  animation: fadeIn 0.4s ease-in-out;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.milestone-espansa .milestone-hero {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 4px solid #2ecc71; /* Colore diverso per distinguere dalla copertina del percorso */
}

.milestone-contenuto {
  padding: 25px;
}

.milestone-contenuto h3 {
  color: #2c3e50;
  font-size: 24px;
  margin-bottom: 10px;
}
.milestone-contenuto p.descrizione-tappa {
  color: #7f8c8d;
  font-size: 15px;
  margin-bottom: 25px;
  line-height: 1.5;
}
.milestone-contenuto h4 {
  color: #34495e;
  margin-bottom: 15px;
  font-size: 18px;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 5px;
  display: inline-block;
}

/* --- Lista Attività --- */
.attivita-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attivita-item {
  display: flex;
  align-items: center;
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e0e6ed;
  cursor: pointer;
  transition: all 0.2s ease;
}

.attivita-item:hover {
  border-color: #3498db;
  background: #f4f9fd;
  transform: translateX(
    5px
  ); /* Piccolo scatto a destra al passaggio del mouse */
}

.attivita-item.completata {
  border-left: 5px solid #2ecc71;
}

.attivita-icona {
  width: 45px;
  height: 45px;
  object-fit: contain;
  margin-right: 20px;
}

.attivita-info h5 {
  color: #2c3e50;
  font-size: 16px;
  margin: 0;
}

/* Un piccolo badge testuale per indicare che è completata */
.attivita-info .testo-completata {
  font-size: 12px;
  color: #2ecc71;
  font-weight: bold;
  display: block;
  margin-top: 4px;
}

/* ==========================================
           STILI PER IL DETTAGLIO ATTIVITÀ (Vista 6)
           ========================================== */
.attivita-box {
  margin-top: 30px;
  background: white;
  border: 2px solid #3498db;
  border-radius: 12px;
  padding: 30px;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.1);
}

.attivita-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #f4f7f6;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.attivita-header h4 {
  font-size: 22px;
  color: #2c3e50;
}

.badge-tipo {
  background: #e8f4fd;
  color: #3498db;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.attivita-box .istruzioni {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  background: #fdfefe;
  padding: 15px;
  border-left: 4px solid #bdc3c7;
  margin-bottom: 30px;
}

.area-interazione {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px dashed #ced4da;
}

.btn-completato-stato {
  background-color: #2ecc71;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-completato-stato:hover {
  background-color: #27ae60;
}
.btn-completato-stato:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}
