/* =====================================================
   NeuroEngine v3.0 -- Viewport-Safe Adaptive Morphing CSS
   Palazzo Vitturi

   ARCHITECTURE: CSS handles only cosmetic/additive changes.
   All destructive changes (display:none, max-height clips)
   are handled by JS with viewport checks.
   ===================================================== */

/* ---- GLOBAL MORPH TRANSITIONS ---- */
/* Smooth out CSS-driven property changes so they never feel jarring */

section[id],
#hero,
.hero__subtitle,
.hero__reciprocity,
.hero__assurance,
.hero__scroll,
.parting-whisper,
.heritage-divider,
.usp,
.btn-gold,
.btn[type="submit"],
.guarantee-box,
.final-cta__trust,
.usp__card,
.usp__card-text,
.hero__title {
  transition: padding 0.5s ease, font-size 0.3s ease, opacity 0.5s ease,
              letter-spacing 0.3s ease, border-color 0.3s ease, line-height 0.3s ease,
              background 0.4s ease, margin 0.4s ease;
}


/* ---- DECISO ---- */
/* Compact, fast, booking-focused */
/* NOTE: hero max-height/overflow now handled by JS (viewport-safe) */

body.mood-deciso #hero .hero__scroll {
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.mood-deciso [data-neuro-collapsed="true"] > *:not(h2):not(.container > h2) {
  display: none;
}

body.mood-deciso [data-neuro-collapsed="true"] {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

body.mood-deciso .btn-gold {
  font-size: 1.05em;
  padding: 1em 2.5em;
}

body.mood-deciso .hero__reciprocity,
body.mood-deciso .hero__assurance {
  font-size: 0.85em;
}

body.mood-deciso .parting-whisper {
  max-height: 120px;
  overflow: hidden;
}


/* ---- ANALIZZATORE ---- */
/* Structured, data-rich, comparison-oriented */

body.mood-analizzatore .guarantee-box {
  border: 1.5px solid rgba(201,168,76,0.3) !important;
  padding: 1.5rem !important;
}

body.mood-analizzatore .usp__card {
  border: 1px solid rgba(13,27,42,0.08);
}

body.mood-analizzatore .rooms .container {
  max-width: 1400px;
}

body.mood-analizzatore .final-cta__trust {
  font-size: 1em;
}


/* ---- SOGNATORE ---- */
/* Visual, immersive, cinematic */
/* NOTE: hero min-height now handled by JS (viewport-safe) */

body.mood-sognatore img {
  transition: all 0.6s ease;
}

body.mood-sognatore #hero .hero__bg-img {
  transform: scale(1.02);
  transition: transform 8s ease;
}

body.mood-sognatore .hero__subtitle {
  font-size: 1.15em;
  line-height: 1.8;
}

body.mood-sognatore #rooms img,
body.mood-sognatore .experience img {
  min-height: 350px;
  object-fit: cover;
}

body.mood-sognatore #history {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

body.mood-sognatore .usp__card-text {
  font-size: 1.05em;
  line-height: 1.8;
}

body.mood-sognatore .heritage-divider {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

body.mood-sognatore .btn-gold {
  letter-spacing: 0.06em;
}

/* Subtle de-emphasis of price for dreamer (not hidden, just subtle) */
body.mood-sognatore .hero__reciprocity,
body.mood-sognatore .mobile-booking-bar__price {
  opacity: 0.4;
}


/* ---- INSICURO ---- */
/* Trust-heavy, reassuring, social proof */

body.mood-insicuro #reviews {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

body.mood-insicuro .hero__assurance {
  font-size: 1em;
  padding: 0.75rem;
  background: rgba(13,27,42,0.3);
  border-radius: 6px;
  border: 1px solid rgba(201,168,76,0.15);
}

body.mood-insicuro .hero__assurance-item {
  font-weight: 500;
}

body.mood-insicuro .final-cta__trust {
  font-size: 1.05em;
  padding: 1rem;
  background: rgba(201,168,76,0.05);
  border-radius: 6px;
}

body.mood-insicuro .guarantee-box {
  display: block !important;
  border: 2px solid rgba(201,168,76,0.3) !important;
}

body.mood-insicuro a[href*="wa.me"] {
  position: relative;
}

body.mood-insicuro .btn-gold::after {
  content: '';
  display: none;
}


/* ---- IMPULSIVO ---- */
/* Minimal, fast, price-forward */
/* NOTE: hero clip + section hiding now handled by JS (viewport-safe) */

body.mood-impulsivo .hero__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

body.mood-impulsivo .usp {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

body.mood-impulsivo .usp__card {
  padding: 1rem;
}

body.mood-impulsivo .btn-gold {
  font-size: 1.1em;
  padding: 1em 3em;
  width: 100%;
  max-width: 400px;
}

body.mood-impulsivo section {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

body.mood-impulsivo .heritage-divider {
  margin: 1rem auto;
}


/* ---- DEBUG PANEL ---- */

#neuro-debug-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 99999;
  background: rgba(13, 27, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 12px;
  max-width: 340px;
  min-width: 280px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: rgba(245, 237, 224, 0.85);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.3) transparent;
}

#neuro-debug-panel::-webkit-scrollbar {
  width: 4px;
}

#neuro-debug-panel::-webkit-scrollbar-track {
  background: transparent;
}

#neuro-debug-panel::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.3);
  border-radius: 4px;
}

/* Mobile: smaller panel */
@media (max-width: 767px) {
  #neuro-debug-panel {
    bottom: 8px;
    right: 8px;
    max-width: 300px;
    min-width: 260px;
    font-size: 0.9em;
  }

  /* Hide section index on mobile */
  #neuro-section-index {
    display: none !important;
  }
}

/* Neuro morphing elements should not break print */
@media print {
  #neuro-debug-panel,
  #neuro-sticky-bar,
  #neuro-section-index,
  #neuro-trust-bar,
  #neuro-fullwidth-cta,
  .neuro-reassurance {
    display: none !important;
  }
}

/* Reduced motion: disable all morphing animations */
@media (prefers-reduced-motion: reduce) {
  section[id],
  #hero,
  .hero__subtitle,
  .hero__reciprocity,
  .hero__assurance,
  .hero__scroll,
  .parting-whisper,
  .heritage-divider,
  .usp,
  .btn-gold,
  .guarantee-box,
  .final-cta__trust,
  .usp__card,
  .usp__card-text {
    transition: none !important;
  }

  body.mood-sognatore img,
  body.mood-sognatore #hero .hero__bg-img {
    transition: none !important;
    transform: none !important;
  }

  #neuro-sticky-bar,
  #neuro-trust-bar,
  #neuro-fullwidth-cta {
    transition: none !important;
    transform: none !important;
  }
}
