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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a12;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  position: relative;
  padding: 1rem;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 0, 0.05) 0%, transparent 70%),
    #0a0a12;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index: 1000;
}

/* Header */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ff00ff, #00ffff, #ffff00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
  animation: pulse 2s ease-in-out infinite;
  letter-spacing: 0.1em;
}

@keyframes pulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.9; filter: brightness(1.2); }
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.play-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 2px solid #00ffff;
  color: #00ffff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.play-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
}

.play-btn.playing {
  border-color: #ff00ff;
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

.bpm-control, .volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bpm-control label, .volume-control label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.bpm-control input, .volume-control input {
  width: 80px;
  accent-color: #00ffff;
}

.bpm-control span {
  font-size: 0.9rem;
  color: #00ffff;
  min-width: 35px;
}

/* Main Content */
.main-content {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.beat-sections {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Sections */
.section {
  background: rgba(18, 18, 31, 0.9);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.drum-section {
  border-color: rgba(255, 0, 255, 0.3);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.1);
}

.bass-section {
  border-color: rgba(0, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.melody-section {
  border-color: rgba(255, 255, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.drum-section h2 { color: #ff00ff; text-shadow: 0 0 10px #ff00ff; }
.bass-section h2 { color: #00ffff; text-shadow: 0 0 10px #00ffff; }
.melody-section h2 { color: #ffff00; text-shadow: 0 0 10px #ffff00; }

.section-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.vol-slider {
  width: 60px;
  accent-color: #ff00ff;
}

.wave-select, .scale-select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
}

.randomize-btn {
  padding: 0.35rem 0.6rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.randomize-btn:hover {
  transform: scale(1.1);
}

.drum-btn:hover { background: rgba(255, 0, 255, 0.3); }
.bass-btn:hover { background: rgba(0, 255, 255, 0.3); }
.melody-btn:hover { background: rgba(255, 255, 0, 0.3); }

/* Drum Grid */
.drum-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drum-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drum-label {
  font-size: 0.65rem;
  width: 45px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
}

.step-grid {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.step-button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 3px;
}

.step-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.step-button.active {
  border-color: var(--accent-color);
}

.step-button.current {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Note Grid */
.note-grid {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.note-step {
  position: relative;
}

.note-step.current .note-select {
  border-color: #fff !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
}

.note-select {
  width: 40px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  padding: 0;
  border-radius: 3px;
}

.note-select:focus {
  outline: none;
  border-color: var(--accent-color);
}

.note-select option {
  background: #1a1a2e;
  color: #fff;
}

/* Oscilloscope Panel */
.oscilloscope-panel {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.oscilloscope-container {
  background: rgba(10, 10, 18, 0.9);
  border: 2px solid;
  border-radius: 8px;
  padding: 0.5rem;
  position: relative;
}

.oscilloscope-label {
  position: absolute;
  top: 0.25rem;
  left: 0.5rem;
  font-size: 0.6rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-shadow: 0 0 5px currentColor;
  letter-spacing: 0.1em;
}

.oscilloscope-canvas {
  width: 100%;
  height: 80px;
  display: block;
  border-radius: 4px;
}

/* Global Controls */
.global-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.global-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.randomize-all:hover {
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.3), rgba(0, 255, 255, 0.3));
  border-color: #ff00ff;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.clear-all:hover {
  background: rgba(255, 50, 50, 0.3);
  border-color: #ff5555;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.remix-link {
  color: #00ffff;
  text-decoration: none;
  transition: all 0.3s ease;
}

.remix-link:hover {
  text-shadow: 0 0 10px #00ffff;
}

/* Responsive */
@media (max-width: 768px) {
  .title {
    font-size: 1.8rem;
  }

  .main-content {
    flex-direction: column;
  }

  .oscilloscope-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .oscilloscope-container {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
  }

  .oscilloscope-canvas {
    height: 60px;
  }

  .step-button {
    width: 20px;
    height: 20px;
  }

  .note-select {
    width: 32px;
    height: 28px;
    font-size: 0.5rem;
  }

  .drum-label {
    width: 35px;
    font-size: 0.55rem;
  }

  .transport-controls {
    gap: 0.75rem;
  }

  .play-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 0.5rem;
  }

  .title {
    font-size: 1.4rem;
  }

  .step-button {
    width: 16px;
    height: 16px;
  }

  .note-select {
    width: 28px;
    height: 24px;
  }

  .section {
    padding: 0.75rem;
  }

  .section-header h2 {
    font-size: 0.85rem;
  }

  .bpm-control input, .volume-control input {
    width: 60px;
  }
}