@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

.font-orbitron {
  font-family: 'Orbitron', monospace;
}

.glassmorphism {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4);
}

/* Enhanced dual-track sliders with glow effects */
.slider {
  background: linear-gradient(90deg, #00D4FF, #6B46C1, #39FF14);
  border-radius: 12px;
}

.tempo-slider {
  background: linear-gradient(90deg, #FFD700, #FF6B35, #FFD700);
  border-radius: 12px;
}

.melody-slider {
  background: linear-gradient(90deg, #00D4FF, #0099CC, #00D4FF);
  border-radius: 12px;
}

.drum-slider {
  background: linear-gradient(90deg, #39FF14, #00CC11, #39FF14);
  border-radius: 12px;
}

.slider::-webkit-slider-thumb,
.tempo-slider::-webkit-slider-thumb,
.melody-slider::-webkit-slider-thumb,
.drum-slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb {
  background: #00D4FF;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.tempo-slider::-webkit-slider-thumb {
  background: #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.melody-slider::-webkit-slider-thumb {
  background: #00D4FF;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.drum-slider::-webkit-slider-thumb {
  background: #39FF14;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
}

.slider::-webkit-slider-thumb:hover,
.tempo-slider::-webkit-slider-thumb:hover,
.melody-slider::-webkit-slider-thumb:hover,
.drum-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 25px currentColor;
}

/* Firefox support */
.slider::-moz-range-thumb,
.tempo-slider::-moz-range-thumb,
.melody-slider::-moz-range-thumb,
.drum-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb {
  background: #00D4FF;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.tempo-slider::-moz-range-thumb {
  background: #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.melody-slider::-moz-range-thumb {
  background: #00D4FF;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.drum-slider::-moz-range-thumb {
  background: #39FF14;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
}

/* Enhanced scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #00D4FF, #FFD700, #39FF14);
  border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #0099CC, #E6C200, #00CC11);
}

/* Enhanced glow animations */
@keyframes pulse-melody {
  0%, 100% {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.8);
  }
}

@keyframes pulse-drums {
  0%, 100% {
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(57, 255, 20, 0.8);
  }
}

@keyframes pulse-tempo {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
  }
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 20, 20, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(255, 20, 20, 0.8);
  }
}

@keyframes pulse-purple {
  0%, 100% {
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(147, 51, 234, 0.8);
  }
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(34, 197, 94, 0.8);
  }
}

/* Glow effect classes */
.glow-cyan {
  animation: pulse-melody 2s ease-in-out infinite;
}

.glow-green {
  animation: pulse-drums 2s ease-in-out infinite;
}

.glow-yellow {
  animation: pulse-tempo 2s ease-in-out infinite;
}

.glow-red {
  animation: pulse-red 2s ease-in-out infinite;
}

.glow-purple {
  animation: pulse-purple 2s ease-in-out infinite;
}

/* Enhanced button hover effects */
button {
  transition: all 0.3s ease-in-out;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

button:active {
  transform: translateY(0);
}

/* Enhanced loading animations for dual-track generation */
.generating {
  position: relative;
  overflow: hidden;
}

.generating::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), rgba(255, 215, 0, 0.3), rgba(57, 255, 20, 0.3), transparent);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Enhanced sync indicator styling */
.sync-indicator {
  background: linear-gradient(45deg, #00D4FF, #FFD700, #39FF14);
  background-size: 300% 300%;
  animation: gradient 3s ease infinite;
}

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

/* Enhanced 32-beat timeline styling */
.beat-timeline {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px;
}

.beat-marker {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.beat-marker.active {
  background: #FFD700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
  transform: scale(1.2);
}

.beat-marker.played {
  background: #00D4FF;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.5);
}

/* Enhanced track-specific styling */
.melody-track {
  border-left: 5px solid #00D4FF;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), transparent);
}

.drum-track {
  border-left: 5px solid #39FF14;
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.15), transparent);
}

.tempo-control {
  border-left: 5px solid #FFD700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), transparent);
}

/* Enhanced visualizer effects */
.visualizer-bar {
  transition: height 0.15s ease-out, opacity 0.15s ease-out;
  filter: drop-shadow(0 0 6px currentColor);
}

.melody-bar {
  background: linear-gradient(to top, #00D4FF, #0099CC, #00CCFF);
}

.drum-bar {
  background: linear-gradient(to top, #39FF14, #00CC11, #66FF44);
}

/* Enhanced responsive design */
@media (max-width: 768px) {
  .glassmorphism {
    backdrop-filter: blur(8px);
  }
  
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .lg\:col-span-3,
  .lg\:col-span-1 {
    grid-column: span 1;
  }
  
  .text-5xl,
  .text-7xl {
    font-size: 2.5rem;
  }
}

/* Enhanced table styling for MIDI viewer */
table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
}

td, th {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
  background: rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Enhanced beat counter styling */
.beat-counter {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(0, 212, 255, 0.2));
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 16px;
}

/* Enhanced input focus effects */
input[type="text"]:focus,
select:focus {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* Enhanced dropdown styling */
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Enhanced animation for playing state */
@keyframes bounce-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.playing-bounce {
  animation: bounce-slow 1s ease-in-out infinite;
}

/* Enhanced tempo sync animation */
@keyframes sync-pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.sync-pulse {
  animation: sync-pulse 1s ease-in-out infinite;
}

/* Enhanced glassmorphism for different elements */
.glassmorphism-thick {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 48px 0 rgba(31, 38, 135, 0.5);
}

.glassmorphism-subtle {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px 0 rgba(31, 38, 135, 0.3);
}

/* Enhanced grid layout for beat display */
.grid-cols-16 {
  grid-template-columns: repeat(16, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .grid-cols-16 {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}