/* ==========================================================================
   ANIMATION STYLESHEET - SWITCH LUCE E GAS
   Slider Revolution Particles Recreation & Micro-interactions
   ========================================================================== */

@keyframes floatCard {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(0.5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(88, 176, 156, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(88, 176, 156, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(88, 176, 156, 0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pulse-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-teal);
  animation: pulseGlow 2s infinite;
}

/* ==========================================================================
   APP CONSUMI DYNAMIC MOVEMENTS & MICRO-INTERACTIONS
   ========================================================================== */

/* 1. Sfondo Fluido Energetico in Movimento */
@keyframes energyBackgroundPan {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 2. Fluttuazione 3D Realistica dello Smartphone */
@keyframes phoneFloatSmooth {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(0.4deg);
  }
  50% {
    transform: translateY(-16px) rotate(-0.3deg);
  }
  75% {
    transform: translateY(-8px) rotate(0.2deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

/* 3. Pulsazione e Respiro dell'Aura Neon */
@keyframes neonAuraBreath {
  0% {
    opacity: 0.45;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.12);
  }
  100% {
    opacity: 0.45;
    transform: scale(0.95);
  }
}

/* 4. Movimento Organico degli Orbi di Luce Ambientale */
@keyframes orbFloatA {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -40px) scale(1.15);
  }
  66% {
    transform: translate(-25px, 20px) scale(0.9);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes orbFloatB {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-35px, 35px) scale(1.2);
  }
  66% {
    transform: translate(25px, -25px) scale(0.92);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

/* 5. Animazione Equalizzatore / Barre Consumi Live */
@keyframes barLiveHeight1 {
  0%, 100% { height: 35px; filter: brightness(1); }
  50% { height: 42px; filter: brightness(1.25); }
}
@keyframes barLiveHeight2 {
  0%, 100% { height: 48px; filter: brightness(1); }
  50% { height: 38px; filter: brightness(1.2); }
}
@keyframes barLiveHeight3 {
  0%, 100% { height: 30px; filter: brightness(1); }
  50% { height: 44px; filter: brightness(1.3); }
}
@keyframes barLiveHeight4 {
  0%, 100% { height: 55px; filter: brightness(1); }
  50% { height: 48px; filter: brightness(1.2); }
}
@keyframes barLiveHeight5 {
  0%, 100% { height: 42px; filter: brightness(1); }
  50% { height: 50px; filter: brightness(1.25); }
}
@keyframes barLiveHeight6 {
  0%, 100% { height: 25px; filter: brightness(1); }
  50% { height: 32px; filter: brightness(1.3); }
}
@keyframes barLiveHeight7 {
  0%, 100% { height: 28px; filter: brightness(1); }
  50% { height: 36px; filter: brightness(1.25); }
}

/* 6. Fluttuazione Floating Badge Satellite */
@keyframes floatingSatelliteLeft {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  50% {
    transform: translateY(-10px) translateX(4px);
  }
}

@keyframes floatingSatelliteRight {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  50% {
    transform: translateY(10px) translateX(-4px);
  }
}

/* 7. Shimmer Sweep Luminoso */
@keyframes glassShimmerSweep {
  0% {
    transform: translateX(-150%) skewX(-25deg);
  }
  100% {
    transform: translateX(250%) skewX(-25deg);
  }
}

/* 8. Scanline Radar Telemetria su Schermo Smartphone */
@keyframes scanlineSweep {
  0% {
    top: -5%;
    opacity: 0;
  }
  15% {
    opacity: 0.85;
  }
  85% {
    opacity: 0.85;
  }
  100% {
    top: 105%;
    opacity: 0;
  }
}

/* 9. Oscillazione Dinamica Icona Notifiche */
@keyframes bellSwing {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(0deg); }
}

/* 10. Fluttuazione Badge Store con Riflesso Shimmer */
@keyframes storeBadgeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* 11. Fascio di Luce Rotante / Border Beam */
@keyframes borderBeamRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   APP SECTION RESPONSIVE GRIDS
   ========================================================================== */
.app-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 48px;
  align-items: center;
}

@media (max-width: 991px) {
  .app-section-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
}

.app-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 36px;
  text-align: left;
}

@media (max-width: 580px) {
  .app-features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ==========================================================================
   SMARTPHONE REALISTIC DEVICE FRAME & MOBILE ADAPTATION
   ========================================================================== */
.smartphone-mockup-wrapper {
  position: relative;
  width: 315px;
  max-width: 100%;
  min-height: 660px;
  margin: 0 auto;
  z-index: 3;
}

/* Hardware buttons on chassis */
.smartphone-mockup-wrapper .hw-btn-vol-up {
  position: absolute;
  left: -5px;
  top: 120px;
  width: 4px;
  height: 42px;
  background: linear-gradient(180deg, #64748b, #334155);
  border-radius: 3px 0 0 3px;
  box-shadow: -1px 0 2px rgba(0,0,0,0.6);
  z-index: 1;
}

.smartphone-mockup-wrapper .hw-btn-vol-down {
  position: absolute;
  left: -5px;
  top: 180px;
  width: 4px;
  height: 42px;
  background: linear-gradient(180deg, #64748b, #334155);
  border-radius: 3px 0 0 3px;
  box-shadow: -1px 0 2px rgba(0,0,0,0.6);
  z-index: 1;
}

.smartphone-mockup-wrapper .hw-btn-power {
  position: absolute;
  right: -5px;
  top: 145px;
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, #64748b, #334155);
  border-radius: 0 3px 3px 0;
  box-shadow: 1px 0 2px rgba(0,0,0,0.6);
  z-index: 1;
}

/* Scocca Smartphone Reale con Cornice Metallica e Riflesso Speculare */
.smartphone-chassis {
  width: 100%;
  min-height: 660px;
  background: #020617;
  border: 4px solid #334155;
  border-radius: 50px;
  box-shadow:
    0 0 0 2px #0f172a,
    0 0 0 5px #1e293b,
    0 30px 70px -10px rgba(0, 0, 0, 0.9),
    0 0 45px rgba(72, 171, 147, 0.35);
  padding: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: phoneFloatSmooth 6s ease-in-out infinite;
  will-change: transform;
}

/* Display OLED interno allungato con bordo vetro */
.smartphone-screen {
  background: radial-gradient(circle at 50% 0%, #0d2238 0%, #06111d 60%, #03080e 100%);
  border-radius: 42px;
  padding: 12px 14px 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.85);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Dynamic Island */
.smartphone-dynamic-island {
  width: 100px;
  height: 25px;
  background: #000000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

/* App Bottom Navigation Bar */
.smartphone-app-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(10, 20, 30, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 6px;
  margin-top: 10px;
}

.smartphone-app-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #94A3B8;
  font-size: 0.58rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.smartphone-app-bottom-nav .nav-item.active {
  color: #38BDF8;
}

/* Satellite Chips per Desktop */
.smartphone-satellite-left {
  position: absolute;
  top: 15%;
  left: -65px;
  background: rgba(10, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(72, 171, 147, 0.7);
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #A7F3D0;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 10;
  animation: floatingSatelliteLeft 5.5s ease-in-out infinite;
}

.smartphone-satellite-right {
  position: absolute;
  bottom: 20%;
  right: -60px;
  background: rgba(10, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(236, 117, 64, 0.7);
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #FDBA74;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 10;
  animation: floatingSatelliteRight 6.5s ease-in-out infinite;
}

/* Adattamento Perfetto su Mobile: Smartphone allungato e badge mai sovrapposti */
@media (max-width: 768px) {
  .smartphone-mockup-wrapper {
    width: 295px;
    min-height: 630px;
    margin: 20px auto 0;
  }
  
  .smartphone-chassis {
    min-height: 630px;
    border-radius: 46px;
    padding: 7px;
  }
  
  .smartphone-screen {
    border-radius: 38px;
    padding: 10px 12px 12px;
  }

  /* Su mobile, i badge fluttuanti si posizionano in alto e in basso SENZA coprire lo schermo */
  .smartphone-satellite-left {
    position: static !important;
    margin: 0 auto 16px !important;
    width: fit-content;
    animation: none !important;
  }

  .smartphone-satellite-right {
    position: static !important;
    margin: 16px auto 0 !important;
    width: fit-content;
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY: RESPECT PREFERS-REDUCED-MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-logo-card {
    animation: none !important;
  }
  
  #particles-canvas {
    display: none !important;
  }
}
