/* Interactive Background & Particles Support */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: transparent;
  cursor: default;
}

/* Keep the particles canvas behind the content */
#particles-js canvas {
  pointer-events: none;
  display: block;
}

/* Keep page content above the particles layer */
#page,
.site,
.elementor,
.elementor-section,
.elementor-container,
.elementor-column,
.elementor-widget,
header,
main,
.site-content,
section {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

/* Re-enable pointer events for interactive elements so they remain clickable */
#page a,
#page button,
#page input,
#page textarea,
#page select,
#page label,
#page summary,
#page .octf-btn,
#page .main-navigation a,
#page .mmenu-toggle,
#page .audio-module,
#page .audio-module * {
  pointer-events: auto;
}

/* Interactive background hover effect container */
.interactive-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle 800px at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                               rgba(19, 216, 255, 0.05) 0%, 
                               rgba(19, 216, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.interactive-bg-overlay.active {
  opacity: 1;
}

/* Audio Player Styling - Modern Cybertech Style */

.audio-module {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 25, 54, 0.8) 0%, rgba(11, 99, 246, 0.15) 50%, rgba(19, 216, 255, 0.1) 100%);
  border: 1px solid var(--st-line, rgba(140, 247, 255, 0.14));
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 3; /* ensure controls sit above particles */
  overflow: hidden;
}

/* Animated gradient background on hover */
.audio-module::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 0%, rgba(19, 216, 255, 0.1) 50%, transparent 100%);
  background-size: 200% 200%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.audio-module:hover {
  transform: translateY(-8px);
  border-color: rgba(140, 247, 255, 0.4);
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(19, 216, 255, 0.15),
    inset 0 1px 0 rgba(140, 247, 255, 0.2);
}

.audio-module:hover::before {
  opacity: 1;
  animation: gradientShift 2s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* Audio player controls container */
.audio-module .audio-inner.button-container {
  position: relative;
  z-index: 2;
}

/* Custom audio player styling */
audio {
  width: 100%;
  height: 44px;
  accent-color: #ff8a6b;
  outline: none;
}

/* Webkit browsers (Chrome, Safari, Edge) */
audio::-webkit-media-controls-panel {
  background: linear-gradient(135deg, rgba(11, 99, 246, 0.3), rgba(19, 216, 255, 0.15));
  border-radius: 8px;
}

audio::-webkit-media-controls-play-button {
  background-color: #ff8a6b;
  border-radius: 50%;
  cursor: pointer;
}

audio::-webkit-media-controls-play-button:hover {
  background-color: #ff9d7f;
  filter: drop-shadow(0 0 8px rgba(255, 138, 107, 0.4));
}

audio::-webkit-media-controls-mute-button {
  color: #8cf7ff;
}

audio::-webkit-media-controls-mute-button:hover {
  color: #13d8ff;
  filter: drop-shadow(0 0 8px rgba(19, 216, 255, 0.3));
}

audio::-webkit-media-controls-timeline {
  background: linear-gradient(90deg, rgba(140, 247, 255, 0.2), rgba(19, 216, 255, 0.3));
  border-radius: 4px;
}

audio::-webkit-media-controls-volume-slider {
  background: rgba(140, 247, 255, 0.15);
  accent-color: #8cf7ff;
}

audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-current-time-display {
  color: #e8f7ff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  font-weight: 500;
}

/* Firefox styling */
audio {
  filter: sepia(0%) saturate(0%);
}

/* Info section */
.audio-module .audio-inner:not(.button-container) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.audio-h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #e8f7ff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.audio-bottom-h5 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #8cf7ff, #13d8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 32px;
  text-align: right;
}

/* Pulse animation for active playing */
@keyframes audioPulse {
  0%, 100% {
    box-shadow: 
      0 24px 70px rgba(0, 0, 0, 0.42),
      0 0 20px rgba(19, 216, 255, 0.1),
      inset 0 1px 0 rgba(140, 247, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 24px 70px rgba(0, 0, 0, 0.42),
      0 0 40px rgba(19, 216, 255, 0.25),
      inset 0 1px 0 rgba(140, 247, 255, 0.3);
  }
}

/* Apply pulse when audio is playing */
audio:not([src=""])::-webkit-media-controls-panel {
  animation: audioPulse 2s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .audio-module {
    padding: 18px;
    gap: 12px;
  }

  audio {
    height: 40px;
  }

  .audio-h5 {
    font-size: 12px;
  }

  .audio-bottom-h5 {
    font-size: 18px;
  }
}

/* Loading state animation */
@keyframes audioLoad {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.audio-module.loading {
  background: linear-gradient(
    90deg,
    rgba(6, 25, 54, 0.8),
    rgba(11, 99, 246, 0.15),
    rgba(6, 25, 54, 0.8)
  );
  background-size: 200% 100%;
  animation: audioLoad 1.5s infinite;
}

/* Glow effect for hover */
.audio-module::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(19, 216, 255, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.audio-module:hover::after {
  opacity: 1;
}

/* Animation on focus */
audio:focus,
audio:focus-visible {
  outline: none;
}

.audio-module:focus-within {
  border-color: rgba(140, 247, 255, 0.6);
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(19, 216, 255, 0.2),
    inset 0 1px 0 rgba(140, 247, 255, 0.3);
}

/* Accessibility: high contrast mode support */
@media (prefers-contrast: more) {
  .audio-module {
    border-color: rgba(140, 247, 255, 0.6);
    box-shadow: 
      0 16px 45px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(140, 247, 255, 0.4);
  }

  .audio-h5,
  .audio-bottom-h5 {
    color: #ffffff;
  }
}

/* Accessibility: reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .audio-module,
  .audio-module::before,
  .audio-module::after,
  .audio-h5,
  .audio-bottom-h5 {
    transition: none;
    animation: none;
  }

  .audio-module:hover {
    transform: none;
  }
}

/* Custom controls (injected by JS) */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  z-index: 2;
}

.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #13d8ff 0%, #0b63f6 52%, #7b5cff 100%);
  color: #021025;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(2, 10, 24, 0.24),
    inset 0 0 0 1px rgba(140, 247, 255, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.play-btn:hover,
.play-btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 10px 24px rgba(2, 10, 24, 0.28),
    inset 0 0 0 1px rgba(140, 247, 255, 0.22);
}

.play-btn:focus-visible {
  outline: 2px solid rgba(140, 247, 255, 0.65);
  outline-offset: 4px;
}

.play-btn .icon { font-size: 18px; }
.play-btn.is-playing {
  background: linear-gradient(135deg, #13d8ff, #8cf7ff);
  color: #021025;
  box-shadow:
    0 8px 22px rgba(2, 10, 24, 0.24),
    inset 0 0 0 1px rgba(140, 247, 255, 0.2);
}

.audio-module.is-empty {
  opacity: 0.82;
}

.audio-module.is-empty .play-btn {
  cursor: not-allowed;
  opacity: 0.62;
}

.audio-module.is-empty .progress {
  cursor: default;
}

.audio-module.is-empty:hover {
  transform: none;
}

.progress {
  flex: 1 1 auto;
  height: 34px;
  padding: 3px 0;
  position: relative;
  cursor: pointer;
}

.progress-wave {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
}

.progress-wave-bar {
  flex: 1 1 0;
  min-width: 2px;
  height: 32%;
  border-radius: 999px;
  background: rgba(140, 247, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(140, 247, 255, 0.04);
  transform-origin: bottom center;
  transition: height 0.18s ease, background 0.12s linear, opacity 0.12s linear;
}

.progress-wave-bar:nth-child(6n + 1) {
  height: 46%;
}

.progress-wave-bar:nth-child(6n + 2) {
  height: 72%;
}

.progress-wave-bar:nth-child(6n + 3) {
  height: 96%;
}

.progress-wave-bar:nth-child(6n + 4) {
  height: 58%;
}

.progress-wave-bar:nth-child(6n + 5) {
  height: 82%;
}

.progress-wave-bar.is-filled {
  background: linear-gradient(180deg, #8cf7ff 0%, #13d8ff 48%, #7b5cff 100%);
  opacity: 0.95;
}

.progress:hover .progress-wave-bar,
.progress:focus-visible .progress-wave-bar {
  background-color: rgba(140, 247, 255, 0.24);
}

.progress:hover .progress-wave-bar.is-filled,
.progress:focus-visible .progress-wave-bar.is-filled {
  background: linear-gradient(180deg, #e8fbff 0%, #13d8ff 48%, #7b5cff 100%);
}

.progress.is-playing .progress-wave-bar.is-filled {
  animation: progress-wave-pulse 1.2s infinite ease-in-out;
}

.progress.is-playing .progress-wave-bar.is-filled:nth-child(3n + 2) {
  animation-delay: 120ms;
}

.progress.is-playing .progress-wave-bar.is-filled:nth-child(3n) {
  animation-delay: 240ms;
}

.time {
  min-width: 96px;
  text-align: right;
  color: var(--st-ink);
  font-weight: 600;
  font-size: 13px;
}

.wave { display: flex; gap: 6px; align-items: flex-end; width: 54px; }
.wave .bar { display: block; width: 5px; height: 6px; background: rgba(140,247,255,0.18); border-radius: 2px; transform-origin: bottom center; }
.wave.is-playing .bar { animation: pulse 900ms infinite ease-in-out; }
.wave.is-playing .bar:nth-child(2) { animation-delay: 80ms; }
.wave.is-playing .bar:nth-child(3) { animation-delay: 160ms; }
.wave.is-playing .bar:nth-child(4) { animation-delay: 240ms; }
.wave.is-playing .bar:nth-child(5) { animation-delay: 320ms; }
.wave.is-playing .bar:nth-child(6) { animation-delay: 400ms; }

@keyframes pulse {
  0% { transform: scaleY(0.3); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.3); opacity: 0.6; }
}

@keyframes progress-wave-pulse {
  0% { transform: scaleY(0.86); }
  50% { transform: scaleY(1.08); }
  100% { transform: scaleY(0.86); }
}

/* Keep layout neat on small screens */
@media (max-width: 520px) {
  .play-btn { width: 44px; height: 44px; }
  .time { display: none; }
  .wave { width: 42px; gap: 4px; }
}
