/* ============================================
   VoltAssistant Cloud - Visual Effects Suite
   Energy-themed, dynamic animations
   ============================================ */

/* ==========================================
   Aurora Borealis Background
   ========================================== */

@keyframes aurora-wave {
  0%, 100% {
    opacity: 0.5;
    transform: translateY(0) scaleY(1);
  }
  25% {
    opacity: 0.8;
    transform: translateY(-20px) scaleY(1.2);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-10px) scaleY(0.9);
  }
  75% {
    opacity: 0.9;
    transform: translateY(-30px) scaleY(1.1);
  }
}

@keyframes aurora-drift {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-45%) translateY(-20px);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}

.aurora-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aurora-layer {
  position: absolute;
  width: 200%;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  filter: blur(80px);
  animation: aurora-drift 15s ease-in-out infinite;
}

.aurora-layer-1 {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(16, 185, 129, 0.15) 30%,
    rgba(5, 150, 105, 0.25) 50%,
    rgba(16, 185, 129, 0.1) 70%,
    transparent 100%
  );
  animation-delay: 0s;
}

.aurora-layer-2 {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.1) 25%,
    rgba(16, 185, 129, 0.2) 50%,
    rgba(20, 184, 166, 0.15) 75%,
    transparent 100%
  );
  animation-delay: -5s;
  animation-duration: 20s;
}

.aurora-layer-3 {
  background: linear-gradient(
    160deg,
    transparent 0%,
    rgba(52, 211, 153, 0.12) 40%,
    rgba(6, 182, 212, 0.18) 60%,
    transparent 100%
  );
  animation-delay: -10s;
  animation-duration: 25s;
}

/* ==========================================
   Energy Flow Visualization
   ========================================== */

@keyframes energy-flow {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes energy-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.energy-flow-container {
  position: relative;
  height: 4px;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.energy-flow-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(16, 185, 129, 0.8) 50%,
    transparent 100%
  );
  border-radius: 2px;
  animation: energy-flow 2s ease-in-out infinite;
}

.energy-node {
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 12px #10b981, 0 0 24px rgba(16, 185, 129, 0.5);
  animation: energy-pulse 2s ease-in-out infinite;
}

.energy-node.charging {
  background: #3b82f6;
  box-shadow: 0 0 12px #3b82f6, 0 0 24px rgba(59, 130, 246, 0.5);
}

.energy-node.solar {
  background: #fbbf24;
  box-shadow: 0 0 12px #fbbf24, 0 0 24px rgba(251, 191, 36, 0.5);
}

/* ==========================================
   Animated Energy Flow Path
   ========================================== */

.energy-path {
  stroke: rgba(16, 185, 129, 0.3);
  stroke-width: 2;
  fill: none;
}

.energy-path-flow {
  stroke: #10b981;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 20 10;
  animation: path-flow 1.5s linear infinite;
}

@keyframes path-flow {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -30;
  }
}

/* ==========================================
   Glowing Elements
   ========================================== */

.glow-accent {
  box-shadow: 
    0 0 10px rgba(16, 185, 129, 0.3),
    0 0 20px rgba(16, 185, 129, 0.2),
    0 0 30px rgba(16, 185, 129, 0.1);
}

.glow-accent-strong {
  box-shadow: 
    0 0 15px rgba(16, 185, 129, 0.4),
    0 0 30px rgba(16, 185, 129, 0.3),
    0 0 45px rgba(16, 185, 129, 0.2);
}

@keyframes glow-pulse-energy {
  0%, 100% {
    box-shadow: 
      0 0 10px rgba(16, 185, 129, 0.2),
      0 0 20px rgba(16, 185, 129, 0.1);
  }
  50% {
    box-shadow: 
      0 0 20px rgba(16, 185, 129, 0.4),
      0 0 40px rgba(16, 185, 129, 0.3),
      0 0 60px rgba(16, 185, 129, 0.2);
  }
}

.glow-pulse {
  animation: glow-pulse-energy 3s ease-in-out infinite;
}

.text-glow {
  text-shadow: 
    0 0 10px currentColor,
    0 0 20px currentColor;
}

.text-glow-strong {
  text-shadow: 
    0 0 10px currentColor,
    0 0 20px currentColor,
    0 0 40px currentColor;
}

/* ==========================================
   Smooth Chart Animations
   ========================================== */

@keyframes chart-bar-grow {
  0% {
    transform: scaleY(0);
  }
  100% {
    transform: scaleY(1);
  }
}

@keyframes chart-line-draw {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes number-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.chart-bar-animated {
  transform-origin: bottom;
  animation: chart-bar-grow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.chart-line-animated {
  stroke-dasharray: 1000;
  animation: chart-line-draw 2s ease-out forwards;
}

.stat-number {
  animation: number-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Staggered delays */
.chart-bar-animated:nth-child(1) { animation-delay: 0.1s; }
.chart-bar-animated:nth-child(2) { animation-delay: 0.2s; }
.chart-bar-animated:nth-child(3) { animation-delay: 0.3s; }
.chart-bar-animated:nth-child(4) { animation-delay: 0.4s; }
.chart-bar-animated:nth-child(5) { animation-delay: 0.5s; }
.chart-bar-animated:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================
   Card Hover Effects
   ========================================== */

.card-energy {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.card-energy:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(16, 185, 129, 0.15);
}

.card-energy-highlight {
  position: relative;
  overflow: hidden;
}

.card-energy-highlight::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(16, 185, 129, 0.1) 60deg,
    transparent 120deg
  );
  animation: rotate-highlight 8s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-energy-highlight:hover::before {
  opacity: 1;
}

@keyframes rotate-highlight {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================
   Status Indicators
   ========================================== */

@keyframes status-ping {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.status-indicator {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-indicator.online {
  background: #10b981;
}

.status-indicator.online::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #10b981;
  animation: status-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-indicator.warning {
  background: #fbbf24;
}

.status-indicator.error {
  background: #ef4444;
  animation: glow-pulse-energy 1s ease-in-out infinite;
}

/* ==========================================
   Loading States
   ========================================== */

@keyframes energy-wave {
  0% {
    transform: translateX(-100%) scaleY(0.5);
  }
  50% {
    transform: translateX(0%) scaleY(1);
  }
  100% {
    transform: translateX(100%) scaleY(0.5);
  }
}

.loading-energy {
  position: relative;
  background: rgba(16, 185, 129, 0.1);
  overflow: hidden;
  border-radius: 8px;
}

.loading-energy::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(16, 185, 129, 0.3) 50%,
    transparent 100%
  );
  animation: energy-wave 1.5s ease-in-out infinite;
}

/* ==========================================
   Interactive Elements
   ========================================== */

.btn-energy {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-energy::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn-energy:hover::before {
  width: 300%;
  height: 300%;
}

.btn-energy:active {
  transform: scale(0.98);
}

/* ==========================================
   Data Visualization
   ========================================== */

.gauge-container {
  position: relative;
  width: 120px;
  height: 60px;
  overflow: hidden;
}

.gauge-background {
  fill: none;
  stroke: rgba(16, 185, 129, 0.2);
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke: #10b981;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px #10b981);
}

.gauge-value {
  font-size: 1.5rem;
  font-weight: 700;
  fill: #10b981;
  text-anchor: middle;
}

/* ==========================================
   Motion Preferences
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  .aurora-layer,
  .energy-flow-bar,
  .energy-node,
  .energy-path-flow,
  .glow-pulse,
  .chart-bar-animated,
  .chart-line-animated,
  .stat-number,
  .card-energy-highlight::before,
  .status-indicator.online::before,
  .loading-energy::after {
    animation: none !important;
  }
  
  .card-energy:hover {
    transform: none;
  }
  
  .chart-bar-animated {
    transform: scaleY(1);
  }
  
  .stat-number {
    opacity: 1;
    transform: scale(1);
  }
}
