/* Ability HUD - Unified Energy & Cooldown Display */

.ability-hud {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 9999; /* Above FPS panel (9998) but below persistent header (10000) */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Energy Bar Container */
.energy-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.energy-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #00d9ff;
  text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
  opacity: 0.9;
}

.energy-bar-wrapper {
  width: 280px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(0, 217, 255, 0.3);
  border-radius: 12px;
  padding: 3px;
  box-shadow:
    0 0 20px rgba(0, 217, 255, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.energy-bar {
  height: 100%;
  background: linear-gradient(90deg,
    #00d9ff 0%,
    #0099ff 50%,
    #00d9ff 100%);
  border-radius: 8px;
  transition: width 0.15s ease-out;
  box-shadow:
    0 0 12px rgba(0, 217, 255, 0.6),
    inset 0 2px 8px rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

/* Energy bar shine effect */
.energy-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent);
  animation: energy-shine 2s infinite;
}

@keyframes energy-shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* Low energy warning */
.energy-bar.low-energy {
  background: linear-gradient(90deg,
    #ff4444 0%,
    #cc0000 50%,
    #ff4444 100%);
  animation: energy-pulse 0.8s ease-in-out infinite;
}

@keyframes energy-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(255, 68, 68, 0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 20px rgba(255, 68, 68, 0.9); }
}

.energy-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.8),
    0 0 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Health/Armor Container */
.health-armor-container {
  display: flex;
  gap: 8px;
  width: 280px;
}

.stat-bar-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  min-width: 20px;
}

.stat-bar {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-bar.health-bar {
  background: linear-gradient(90deg, #00ff88 0%, #00cc66 100%);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.stat-bar.armor-bar {
  background: linear-gradient(90deg, #ffd700 0%, #ffaa00 100%);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Abilities Container */
.abilities-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

/* Individual Ability Slot */
.ability-slot {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Ability Icon */
.ability-icon {
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 30% 30%,
    rgba(60, 60, 80, 0.9),
    rgba(20, 20, 40, 0.95));
  border: 2px solid rgba(100, 150, 255, 0.4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.ability-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%);
  pointer-events: none;
}

/* Ability icon glow when ready */
.ability-icon.ready {
  border-color: rgba(0, 217, 255, 0.6);
  box-shadow:
    0 4px 16px rgba(0, 217, 255, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ability-icon.ready:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 217, 255, 0.9);
  box-shadow:
    0 6px 20px rgba(0, 217, 255, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Ability icon when active (toggle abilities) */
.ability-icon.active {
  border-color: #00ff88;
  box-shadow:
    0 4px 20px rgba(0, 255, 136, 0.6),
    inset 0 0 12px rgba(0, 255, 136, 0.2);
  animation: ability-active-pulse 1.5s ease-in-out infinite;
}

@keyframes ability-active-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 255, 136, 0.6); }
  50% { box-shadow: 0 4px 28px rgba(0, 255, 136, 0.9); }
}

/* Ability icon image/emoji */
.ability-icon-image {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Cooldown Overlay */
.ability-cooldown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ability-cooldown-overlay.on-cooldown {
  opacity: 1;
}

/* Cooldown radial progress */
.ability-cooldown-radial {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
}

/* Cooldown text */
.ability-cooldown-text {
  position: absolute;
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.6);
  z-index: 1;
}

/* Keybind Label */
.ability-keybind {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Dash Ability (special styling) */
.ability-slot.dash .ability-icon {
  border-color: rgba(255, 200, 0, 0.5);
}

.ability-slot.dash .ability-icon.ready {
  border-color: rgba(255, 200, 0, 0.7);
  box-shadow:
    0 4px 16px rgba(255, 200, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ability-slot.dash .ability-keybind {
  border-color: rgba(255, 200, 0, 0.5);
}

/* Not enough energy state */
.ability-icon.insufficient-energy {
  opacity: 0.5;
  border-color: rgba(255, 68, 68, 0.4);
  animation: insufficient-shake 0.5s ease;
}

@keyframes insufficient-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ability-hud {
    bottom: 20px;
    gap: 8px;
  }

  .energy-bar-wrapper {
    width: 220px;
    height: 20px;
  }

  .health-armor-container {
    width: 220px;
  }

  .stat-bar {
    height: 10px;
  }

  .stat-label {
    font-size: 9px;
    min-width: 18px;
  }

  .ability-slot {
    width: 52px;
    height: 52px;
  }

  .ability-icon {
    width: 48px;
    height: 48px;
  }

  .ability-icon-image {
    font-size: 24px;
  }

  .ability-cooldown-text {
    font-size: 16px;
  }

  .ability-keybind {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }
}

/* Accessibility - reduce motion */
@media (prefers-reduced-motion: reduce) {
  .energy-bar,
  .ability-icon {
    transition: none;
  }

  .energy-bar::before,
  .ability-icon.active,
  .energy-bar.low-energy {
    animation: none;
  }
}
