/* ====================================
   GIORNI INSIEME APP - Minimale Elegante
   ==================================== */

/* Container principale */
.giorni-app {
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Usa wallpaper personalizzato */
.giorni-app.custom-wallpaper {
  background-image: url('../assets/images/wallpaper.jpg');
  background-size: cover;
  background-position: center;
}

/* Overlay per leggibilità */
.giorni-app::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 0;
}

/* ====================================
   HEADER (back button + title)
   ==================================== */
.app-header {
  position: relative;
  z-index: 10;
  padding: 60px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px; /* NUOVO: per IMG */
}

/* NUOVO: Supporto IMG nel back button */
.back-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1); /* Rende l'icona bianca */
}

/* Opzionale: se usi icona già bianca, rimuovi filter */
.back-button img.no-filter {
  filter: none;
}

.back-button:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.25);
}

.app-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  flex: 1;
  text-align: center;
  margin-right: 40px;
}


/* ====================================
   COUNTER CONTAINER (centro)
   ==================================== */
.counter-container {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================
   MAIN COUNTER (giorni totali)
   ==================================== */
.main-counter {
  text-align: center;
  margin-bottom: 40px;
}

.counter-number {
  font-size: 96px;
  font-weight: 300;
  color: #fff;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: -3px;
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.counter-label {
  font-size: 24px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

/* ====================================
   BREAKDOWN (anni, mesi, giorni, ore)
   ==================================== */
.breakdown-container {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 20px;
  padding: 24px 32px;
  margin-bottom: 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: slideUp 0.6s ease 0.2s backwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.breakdown-item {
  text-align: center;
}

.breakdown-value {
  font-size: 32px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.breakdown-unit {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 6px;
  text-transform: lowercase;
}

/* ====================================
   START DATE (data inizio)
   ==================================== */
.start-date-container {
  text-align: center;
  animation: fadeIn 0.6s ease 0.4s backwards;
}

.start-date-label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.start-date-value {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 390px) {
  .counter-number {
    font-size: 80px;
  }
  
  .counter-label {
    font-size: 20px;
  }
  
  .breakdown-value {
    font-size: 28px;
  }
  
  .breakdown-container {
    padding: 20px 24px;
  }
}

@media (max-width: 375px) {
  .counter-number {
    font-size: 72px;
  }
  
  .counter-label {
    font-size: 18px;
  }
  
  .breakdown-value {
    font-size: 26px;
  }
  
  .breakdown-unit {
    font-size: 13px;
  }
}

/* ====================================
   ANIMAZIONE NUMERI (opzionale)
   ==================================== */
.counter-number.updating {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ====================================
   BACKGROUND SLIDESHOW
   ==================================== */
.giorni-app {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Container per le foto slideshow */
.slideshow-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.slideshow-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
    transform: scale(1.1);
  transition: transform 2s ease-in-out, opacity 2s ease-in-out;
}

.slideshow-image.active {
  opacity: 1;
  z-index: 1;
  transform: scale(1);
}

/* Overlay per leggibilità (importante!) */
.giorni-app::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4); /* Regola opacità 0.3-0.6 */
  backdrop-filter: blur(0px); /* Opzionale: blur leggero */
  -webkit-backdrop-filter: blur(0px);
  z-index: 1;
}

/* Tutto il contenuto sopra lo slideshow */
.app-header,
.counter-container {
  position: relative;
  z-index: 10;
}

