/* ==========================================================================
   3C SCAVI S.r.l.s. - Unified Earth & Road Master Scene ("La Strada di Taglio")
   Grafica uniforme color terra perfettamente integrata con la sede stradale
   ========================================================================== */

.master-excavation-scene {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* ==========================================================================
   LEVEL 1: SURFACE ROADWAY (Manto d'Asfalto Stradale)
   ========================================================================== */
.roadway-surface-band {
  position: relative;
  padding: 4.5rem 0 0 0;
  background: 
    linear-gradient(180deg, 
      var(--c-asphalt-dark) 0%, 
      var(--c-asphalt-main) 60%, 
      var(--c-asphalt-binder) 100%
    );
  overflow: hidden;
}

/* Road survey coordinates & laser grid */
.road-survey-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Road shoulder lane line at bottom of roadway */
.road-lane-markings {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.3) 40px,
    transparent 40px,
    transparent 75px
  );
  pointer-events: none;
}

.roadway-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  align-items: center;
  gap: 2.5rem;
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ==========================================================================
   TRANSITION: ASPHALT CUT LIP (Il Taglio della Strada con Lama Diamantata)
   ========================================================================== */
.asphalt-cut-divider {
  position: relative;
  z-index: 10;
  margin-top: 1.5rem;
  background: linear-gradient(180deg, #2D333F 0%, #1F232B 50%, #16191F 100%);
  border-top: 4px solid #8E8275; /* Concrete curb */
  border-bottom: 3px dashed var(--c-brand-yellow);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 0.85rem 0;
}

.cut-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cut-banner-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--c-brand-yellow);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  letter-spacing: 0.05em;
}

.cut-banner-badges {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.cut-badge {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--c-border-earth);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cut-badge i {
  color: var(--c-brand-yellow);
}

/* ==========================================================================
   LEVEL 2: UNDERGROUND CUT ("La Strada di Taglio")
   ========================================================================== */
.underground-cut-band {
  position: relative;
  padding: 3.5rem 0 5.5rem 0;
  /* Seamless rich earth transition from stabilized gravel into deep rock */
  background: 
    linear-gradient(180deg, 
      #3D2C1E 0%, 
      #4E3725 25%, 
      #3B2516 60%, 
      #24160C 100%
    );
  border-bottom: 3px solid var(--c-border-earth);
  overflow: hidden;
}

.underground-cut-band::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(245, 158, 11, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.cut-master-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: start;
  position: relative;
  z-index: 2;
}

/* Vertical Trench Stage (Left Side of the Cut) */
.trench-cut-stage {
  position: relative;
  background: #140C07;
  border: 2px solid var(--c-brand-yellow);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-earth), 0 0 30px rgba(0, 0, 0, 0.7);
}

/* Photorealistic Architectural Cross-Section Stage */
.cut-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(18, 11, 7, 0.95);
  border-bottom: 2px solid var(--c-brand-yellow);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cut-stage-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--c-brand-yellow);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cut-stage-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: #D1D5DB;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cut-real-viewport {
  position: relative;
  width: 100%;
  height: 580px;
  background: #0E0805;
  overflow: hidden;
}

.cut-real-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Interactive Hotspot Pins */
.cut-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cut-hotspot:hover,
.cut-hotspot.active {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 20;
}

.hotspot-pulse {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.8;
  animation: hotspotPulseAnim 2s infinite ease-out;
  pointer-events: none;
}

@keyframes hotspotPulseAnim {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hotspot-core {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(14, 8, 4, 0.94);
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85), 0 0 12px currentColor;
  transition: all 0.2s ease;
}

.cut-hotspot:hover .hotspot-core,
.cut-hotspot.active .hotspot-core {
  background: currentColor;
  color: #110A05 !important;
}

/* Hotspot Floating Tooltip Badge */
.hotspot-badge {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(18, 11, 7, 0.95);
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0.9;
  transition: all 0.2s ease;
}

.cut-hotspot:hover .hotspot-badge,
.cut-hotspot.active .hotspot-badge {
  opacity: 1;
  transform: translateX(-50%) translateY(4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 16px currentColor;
}

.hotspot-badge .badge-depth {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: #FBBF24;
}

.hotspot-badge .badge-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFF;
}

/* Specific Hotspot Colors */
.hotspot-fiber { color: #06B6D4; }
.hotspot-electric { color: #F59E0B; }
.hotspot-water { color: #3B82F6; }
.hotspot-gas { color: #EF4444; }
.hotspot-sewer { color: #10B981; }

/* Distinct Earth Strata Layers */
.stratum {
  position: relative;
  width: 100%;
  transition: all var(--transition-fast);
  border-bottom: 2px dashed rgba(255, 235, 205, 0.15);
}

/* Layer 1: Asfalto e Binder */
.stratum-asphalt {
  height: 70px;
  background: linear-gradient(180deg, #2E333E 0%, #22262F 100%);
}

/* Layer 2: Misto Granulare Stabilizzato (Massicciata) */
.stratum-base {
  height: 100px;
  background: linear-gradient(180deg, #524738 0%, #43392C 100%);
}

/* Layer 3: Sabbia di Protezione e Rinterro Controllato */
.stratum-sand {
  height: 155px;
  background: linear-gradient(180deg, #8A6E4C 0%, #6E5336 100%);
}

/* Layer 4: Formazione Argillosa Naturale / Terra Battuta */
.stratum-clay {
  height: 155px;
  background: linear-gradient(180deg, #5C361D 0%, #442411 100%);
}

/* Layer 5: Roccia Lavica e Substrato Compatto */
.stratum-bedrock {
  height: 160px;
  background: linear-gradient(180deg, #2C211B 0%, #16100D 100%);
}

.stratum-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(20, 12, 7, 0.85);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border-earth);
  pointer-events: none;
}

/* ==========================================================================
   Underground Conduits & Utility Networks
   ========================================================================== */
.utility-pipe {
  position: absolute;
  left: 0;
  right: 0;
  cursor: pointer;
  transition: all var(--transition-normal);
  z-index: 3;
}

.utility-pipe:hover,
.utility-pipe.active {
  filter: drop-shadow(0 0 16px currentColor);
  transform: scaleY(1.05);
}

/* 1. Fibra Ottica FTTH (-0.60m) */
.pipe-fiber {
  top: 135px;
  height: 22px;
  color: var(--c-pipe-fiber);
}

.pipe-fiber .pipe-body {
  height: 100%;
  background: linear-gradient(180deg, #FB923C 0%, #C2410C 100%);
  border-radius: 4px;
  border: 1px solid #FED7AA;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.55);
}

.pipe-fiber .light-pulse {
  position: absolute;
  top: 0;
  left: -20%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #FFF, #C084FC, transparent);
  animation: fiberFlow 2.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fiberFlow {
  0% { left: -30%; }
  100% { left: 110%; }
}

/* 2. Cavidotti Elettrici MT/BT (-0.90m) */
.pipe-electric {
  top: 195px;
  height: 32px;
  color: var(--c-pipe-electric);
}

.pipe-electric .warning-tape {
  position: absolute;
  top: -18px;
  left: 10px;
  right: 10px;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    #FBBF24,
    #FBBF24 8px,
    #000 8px,
    #000 16px
  );
  border: 1px solid #000;
  border-radius: 2px;
}

.pipe-electric .pipe-body {
  height: 100%;
  background: linear-gradient(180deg, #F87171 0%, #B91C1C 100%);
  border-radius: 6px;
  border: 1px solid #FECACA;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}

.pipe-electric .current-arc {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 20px,
    rgba(255, 255, 255, 0.45) 21px,
    transparent 23px
  );
  animation: electricPulse 1.2s infinite linear;
}

@keyframes electricPulse {
  from { background-position: 0 0; }
  to { background-position: 100px 0; }
}

/* 3. Condotta Idrica PEAD 100 (-1.35m) */
.pipe-water {
  top: 290px;
  height: 50px;
  color: var(--c-pipe-water);
}

.pipe-water .pipe-body {
  height: 100%;
  background: linear-gradient(180deg, #0284C7 0%, #0369A1 50%, #075985 100%);
  border-radius: 25px;
  border: 2px solid #38BDF8;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.5);
}

.pipe-water .water-stream {
  position: absolute;
  top: 15%;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.25), rgba(255, 255, 255, 0.6), rgba(56, 189, 248, 0.25));
  background-size: 200px 100%;
  animation: waterFlow 3s infinite linear;
}

@keyframes waterFlow {
  from { background-position: 0 0; }
  to { background-position: 200px 0; }
}

/* 4. Condotta Gas Metano Acciaio 3LPE (-1.80m) */
.pipe-gas {
  top: 385px;
  height: 40px;
  color: var(--c-pipe-gas);
}

.pipe-gas .warning-tape {
  position: absolute;
  top: -18px;
  left: 10px;
  right: 10px;
  height: 6px;
  background: #FACC15;
  border: 1px solid #78350F;
}

.pipe-gas .pipe-body {
  height: 100%;
  background: linear-gradient(180deg, #FDE047 0%, #CA8A04 50%, #854D0E 100%);
  border-radius: 20px;
  border: 2px solid #FEF08A;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.45);
}

/* 5. Collettore Fognario SN8 (-2.40m) */
.pipe-sewer {
  top: 480px;
  height: 78px;
  color: var(--c-pipe-sewer);
}

.pipe-sewer .pipe-body {
  height: 100%;
  background: linear-gradient(180deg, #4D7C0F 0%, #365314 50%, #1A2E05 100%);
  border-radius: 12px;
  border: 2px solid #A3E635;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(132, 204, 22, 0.4);
}

.pipe-sewer .corrugation-ribs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 14px,
    rgba(0, 0, 0, 0.45) 15px,
    rgba(0, 0, 0, 0.45) 20px
  );
}

/* Hotspot Interactive Pins */
.pipe-pin {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1A1009;
  border: 2px solid currentColor;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 0 12px currentColor;
  transition: transform var(--transition-fast);
  z-index: 10;
}

.pipe-pin::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 1px dashed currentColor;
  animation: pinSpin 6s linear infinite;
}

@keyframes pinSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.utility-pipe:hover .pipe-pin,
.utility-pipe.active .pipe-pin {
  transform: translateY(-50%) scale(1.2);
  background: currentColor;
  color: #1A1009;
}

.pipe-tag {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(26, 16, 10, 0.92);
  border: 1px solid currentColor;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   Earth Plaque: Persuasive Content & Technical Spec Drawer (Right Side)
   ========================================================================== */
.trench-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.trench-lead-text {
  font-size: 1.15rem;
  color: var(--c-text-muted);
  line-height: 1.7;
}

.trench-lead-text strong {
  color: #FFF;
}

.trench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trench-tab-btn {
  background: rgba(30, 20, 13, 0.7);
  border: 1px solid var(--c-border-earth);
  color: var(--c-text-muted);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trench-tab-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #FFF;
  border-color: var(--c-brand-yellow);
}

.trench-tab-btn.active {
  background: var(--c-brand-yellow);
  color: #1A120B;
  border-color: var(--c-brand-yellow);
  font-weight: 800;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* The Technical Detail Card (Integrated Earth Plaque) */
.utility-detail-card {
  background: var(--c-bg-card-earth);
  border: 1px solid var(--c-brand-yellow);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  position: relative;
  box-shadow: var(--shadow-earth);
  transition: all var(--transition-normal);
  backdrop-filter: blur(14px);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.detail-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid var(--c-brand-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--c-brand-yellow);
}

.detail-title-wrap h4 {
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
  color: #FFF;
}

.detail-title-wrap p {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  font-weight: 700;
}

.detail-desc {
  font-size: 0.98rem;
  color: var(--c-text-muted);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.detail-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(20, 12, 7, 0.75);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--c-border-earth);
  margin-bottom: 1.5rem;
}

.param-item {
  display: flex;
  flex-direction: column;
}

.param-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--c-text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.param-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFF;
}

.detail-guarantees {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.detail-guarantees li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--c-text-muted);
}

.detail-guarantees li i {
  color: var(--c-brand-yellow);
}

.trench-heading {
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  font-weight: 900;
  color: #FFF;
  line-height: 1.15;
}

.detail-card-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .roadway-hero-grid,
  .cut-master-grid,
  .cross-section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .trench-core {
    height: 560px;
    margin-left: 45px;
  }
  .depth-ruler {
    width: 45px;
    font-size: 0.62rem;
  }
  .pipe-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
  .pipe-pin {
    right: 15px;
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
  .detail-params-grid {
    grid-template-columns: 1fr;
  }
}
