/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

/* ===== ELECTRIC POWER + AI TECH BACKGROUND ===== */
/* High-voltage power grid aesthetic: deep blue-black base, cyan/amber energy arcs */

/* --- Keyframes --- */
@keyframes glow-breathe {
  0%, 100% { opacity: 0.08; }
  50% { opacity: 0.22; }
}
@keyframes scan-beam {
  0% { top: -3px; }
  100% { top: 100%; }
}
@keyframes arc-flow {
  0% { stroke-dashoffset: 80; }
  100% { stroke-dashoffset: 0; }
}
@keyframes arc-flow-rev {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 80; }
}
@keyframes arc-flow-fast {
  0% { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}
@keyframes node-flash {
  0%, 100% { opacity: 0.25; r: 3; }
  50% { opacity: 1; r: 5; }
}
@keyframes substation-pulse {
  0% { r: 6; opacity: 0.7; }
  100% { r: 28; opacity: 0; }
}
@keyframes spark {
  0%, 100% { opacity: 1; }
  15% { opacity: 0.2; }
  30% { opacity: 0.9; }
  45% { opacity: 0.3; }
  60% { opacity: 1; }
}
@keyframes voltage-arc {
  0% { opacity: 0; d: path('M0,0 Q5,-8 10,0'); }
  20% { opacity: 0.8; }
  50% { opacity: 1; d: path('M0,0 Q5,-12 10,0'); }
  80% { opacity: 0.6; }
  100% { opacity: 0; d: path('M0,0 Q5,-6 10,0'); }
}

/* --- Tech Background Container --- */
.tech-bg {
  position: relative;
  overflow: hidden;
}

/* Multi-layer radial glow — simulates substation light pollution */
.tech-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 500px at 8% 30%, rgba(6,182,212,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 700px 600px at 92% 15%, rgba(59,130,246,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 600px 500px at 50% 90%, rgba(245,158,11,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 500px 400px at 70% 60%, rgba(16,185,129,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 400px 350px at 25% 75%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 300px 300px at 50% 30%, rgba(245,158,11,0.06) 0%, transparent 50%);
  animation: glow-breathe 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Scanning beam — high-energy horizontal sweep */
.tech-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 3%,
    rgba(6,182,212,0.5) 20%,
    rgba(245,158,11,0.9) 35%,
    rgba(6,182,212,1) 50%,
    rgba(245,158,11,0.9) 65%,
    rgba(6,182,212,0.5) 80%,
    transparent 97%);
  box-shadow:
    0 0 15px 3px rgba(6,182,212,0.3),
    0 0 40px 8px rgba(245,158,11,0.15),
    0 0 80px 16px rgba(6,182,212,0.08);
  animation: scan-beam 7s linear infinite;
  pointer-events: none;
  z-index: 2;
}

/* --- Circuit / Power Grid Overlay --- */
.circuit-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.circuit-overlay svg { width: 100%; height: 100%; }

/* Transmission lines — bright flowing energy */
.pwr-line {
  stroke-dasharray: 12 24;
  animation: arc-flow 3s linear infinite;
}
.pwr-line-slow {
  stroke-dasharray: 8 30;
  animation: arc-flow 6s linear infinite;
}
.pwr-line-rev {
  stroke-dasharray: 10 22;
  animation: arc-flow-rev 4s linear infinite;
}
.pwr-line-fast {
  stroke-dasharray: 6 14;
  animation: arc-flow-fast 1.8s linear infinite;
}

/* Junction nodes */
.pwr-node {
  animation: node-flash 2.5s ease-in-out infinite;
}
.pwr-node:nth-of-type(2n) { animation-delay: 0.6s; }
.pwr-node:nth-of-type(3n) { animation-delay: 1.2s; }
.pwr-node:nth-of-type(5n) { animation-delay: 0.3s; }
.pwr-node:nth-of-type(7n) { animation-delay: 1.8s; }

/* Substation pulse rings */
.sub-pulse {
  animation: substation-pulse 3s ease-out infinite;
}
.sub-pulse:nth-of-type(2) { animation-delay: 1s; }
.sub-pulse:nth-of-type(3) { animation-delay: 2s; }
.sub-pulse:nth-of-type(4) { animation-delay: 0.5s; }
.sub-pulse:nth-of-type(5) { animation-delay: 1.5s; }

/* Sparking effect on HV elements */
.hv-spark {
  animation: spark 0.8s step-end infinite;
}
.hv-spark:nth-of-type(2n) { animation-delay: 0.4s; }
.hv-spark:nth-of-type(3n) { animation-delay: 0.15s; }

/* ===== Fade-in Animation ===== */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Language Switcher ===== */
.lang-btn {
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-size: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.7);
}
.lang-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.lang-btn.active {
  background: #fff;
  color: #0f172a;
  font-weight: 600;
}

/* ===== Wind Animation ===== */
.wind-pole {
  transition: transform 0.5s ease-out;
  transform-origin: 300px 400px;
}

.wind-line {
  animation: wind-blow 3s linear infinite;
}
.wind-line:nth-child(2) { animation-delay: 0.5s; }
.wind-line:nth-child(3) { animation-delay: 1s; }
.wind-line:nth-child(4) { animation-delay: 1.5s; }
.wind-line:nth-child(5) { animation-delay: 0.3s; }

@keyframes wind-blow {
  0% { transform: translateX(-60px); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateX(600px); opacity: 0; }
}

/* ===== Wind Slider ===== */
#wind-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #334155;
  outline: none;
  cursor: pointer;
}
#wind-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
}
#wind-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
}

/* ===== Product Cards ===== */
.tower-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tower-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}
.tower-card img {
  transition: transform 0.5s ease;
}
.tower-card:hover img {
  transform: scale(1.05);
}

/* ===== Scene Gallery ===== */
.scene-card {
  position: relative;
  overflow: hidden;
}
.scene-card img {
  transition: transform 0.5s ease, filter 0.5s ease;
}
.scene-card:hover img {
  transform: scale(1.08);
  filter: brightness(0.4);
}
.scene-card .scene-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  color: #fff;
  padding: 1rem;
  text-align: center;
}
.scene-card:hover .scene-overlay {
  opacity: 1;
}

/* ===== Specs Table ===== */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table th {
  background: #1e293b;
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.specs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.specs-table tr:nth-child(even) td {
  background: #f8fafc;
}
.specs-table .frp-highlight {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #059669;
  font-weight: 500;
}

/* ===== FAQ ===== */
details summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-weight: 500;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary:hover {
  background: #f8fafc;
}
details summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: #94a3b8;
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-inline-start: 12px;
}
details[open] summary::after {
  content: '\2212';
}
details summary::-webkit-details-marker {
  display: none;
}
details .faq-answer {
  padding: 12px 20px 20px;
  color: #64748b;
  line-height: 1.6;
  border-bottom: 1px solid #e2e8f0;
}

/* ===== Chat Widget ===== */
#chat-toggle {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
#chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
#chat-toggle .pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #25d366;
  animation: chat-pulse 2s infinite;
  z-index: -1;
}
@keyframes chat-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

#chat-panel {
  position: fixed;
  bottom: 90px;
  inset-inline-end: 24px;
  z-index: 50;
  width: 280px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s;
}
#chat-panel.hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
}

/* ===== Process Steps ===== */
.process-step {
  position: relative;
}
.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  inset-inline-end: -30%;
  width: 60%;
  height: 2px;
  background: linear-gradient(to right, #3b82f6, #06b6d4);
  transform: translateY(-50%);
}

/* ===== Trust Badges ===== */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  backdrop-filter: blur(4px);
}

/* ===== Contact Bar ===== */
.contact-bar a {
  transition: background 0.2s, transform 0.2s;
}
.contact-bar a:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .lang-btn {
    padding: 4px 8px;
    font-size: 12px;
  }
  #chat-panel {
    inset-inline-end: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    max-width: 320px;
  }
  .process-step:not(:last-child)::after {
    display: none;
  }
}
