/* Custom Styling & Animations for IoT Voice Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary-glow: rgba(59, 130, 246, 0.5);
  --success-glow: rgba(16, 185, 129, 0.5);
  --warning-glow: rgba(245, 158, 11, 0.5);
  --danger-glow: rgba(239, 68, 68, 0.5);
}

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #0b0f19;
  color: #f3f4f6;
  min-height: 100vh;
}

/* Glassmorphism backgrounds */
.glass-panel {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(31, 41, 55, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.glass-card.active-device {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(30, 58, 138, 0.25);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.2);
}

/* Voice Wave Visualizer */
.voice-wave-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 48px;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: #3b82f6;
  border-radius: 9999px;
  transition: height 0.15s ease;
}

.listening .wave-bar {
  background: #10b981;
  animation: wavePulse 1.2s infinite ease-in-out;
}

.listening .wave-bar:nth-child(1) { animation-delay: 0.0s; }
.listening .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.listening .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.listening .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.listening .wave-bar:nth-child(5) { animation-delay: 0.4s; }
.listening .wave-bar:nth-child(6) { animation-delay: 0.3s; }
.listening .wave-bar:nth-child(7) { animation-delay: 0.2s; }
.listening .wave-bar:nth-child(8) { animation-delay: 0.1s; }
.listening .wave-bar:nth-child(9) { animation-delay: 0.0s; }

@keyframes wavePulse {
  0%, 100% {
    height: 8px;
  }
  50% {
    height: 42px;
  }
}

/* Glowing Mic Button Pulsing Effect */
.mic-btn {
  position: relative;
  transition: all 0.3s ease;
}

.mic-btn.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Custom switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #3b82f6;
}

input:checked + .slider.green-slider {
  background-color: #10b981;
}

input:checked + .slider.amber-slider {
  background-color: #f59e0b;
}

input:checked + .slider.purple-slider {
  background-color: #8b5cf6;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.6);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.8);
}

/* Device status indicator badge */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-dot.offline {
  background-color: #ef4444;
}

/* Range input slider styling */
input[type="range"] {
  accent-color: #3b82f6;
}
