/* GrooveCore by Treq Music - Producer-Focused Responsive Design */

/* CSS Custom Properties for 2025 Modern Design */
:root {
  --modal-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --modal-scale-enter: scale(0.95);
  --modal-scale-exit: scale(1.05);
  --backdrop-blur: 8px;
  --shadow-modal: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure proper scrolling behavior for sticky positioning */
html {
  scroll-behavior: smooth;
}

body {
  background: #0a0a0a;
  color: #f0f0f0;
  font-family: 'Roboto', Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  /* Ensure sticky positioning works properly */
  position: relative;
}

/* ===== HEADER SECTION - Transport & Quick Actions ===== */
.app-header {
  background: rgba(15, 15, 15, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000; /* Increased z-index to ensure it stays above all content */
  width: 100%;
  transition: all 0.3s ease; /* Smooth transition for any changes */
}

/* Fixed header for desktop - ensures it always stays visible */
@media (min-width: 1024px) {
  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 15, 0.98); /* Slightly more opaque on desktop */
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Subtle shadow for depth */
  }
  
}

.app-title {
  font-size: 24px;
  font-weight: 900;
  color: #ff4500;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.by-treq {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.8;
}

/* Transport Controls - Most Important */
.transport-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.play-button {
  background: linear-gradient(145deg, #ff4500, #ff6500);
  border: none;
  border-radius: 50px;
  color: white;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 69, 0, 0.4);
}

.play-button.playing {
  background: linear-gradient(145deg, #d32f2f, #f44336);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.play-button.playing:hover {
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.tempo-control {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Quick Actions Row */
.quick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.style-preset-select {
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f0f0f0;
  padding: 8px 12px;
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
}

.variation-switch {
  display: flex;
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 3px;
}

.variation-option {
  padding: 8px 16px;
  border-radius: 15px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s ease;
  color: #888;
}

.variation-option.active {
  background: linear-gradient(145deg, #ff4500, #ff6500);
  color: white;
}

.project-controls {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: rgba(60, 60, 60, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f0f0f0;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(80, 80, 80, 0.9);
  border-color: #ff4500;
}

.clear-btn {
  background: rgba(200, 50, 50, 0.9);
  border: none;
  border-radius: 6px;
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: rgba(220, 70, 70, 0.9);
}

/* ===== MAIN CONTENT - Step Sequencer ===== */
.main-content {
  padding: 12px 12px 150px 12px; /* Add bottom padding for sticky section */
  max-width: 100%;
}

/* Only add horizontal scroll on smaller screens where needed */
@media (max-width: 1024px) {
  .main-content {
    overflow-x: auto;
  }
}

.step-sequencer-panel {
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 12px 180px 12px;
  -webkit-backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

/* Only set min-width on mobile where horizontal scrolling is needed */
@media (max-width: 1024px) {
  .step-sequencer-panel {
    min-width: 100%;
  }
}

/* Pattern A styling */
.step-sequencer-panel.pattern-a {
  border-color: rgba(255, 69, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 69, 0, 0.2);
}

/* Pattern B styling */
.step-sequencer-panel.pattern-b {
  border-color: rgba(0, 255, 136, 0.5);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.section-title {
  color: #ff4500;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sequencer header with title and controls side by side */
.sequencer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 20px;
}

.sequencer-header .section-title {
  font-size: 18px;
  margin-bottom: 0;
  text-align: left;
  flex-shrink: 0;
}

.pattern-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 69, 0, 0.1);
  border: 1px solid rgba(255, 69, 0, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: bold;
}

.pattern-label {
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pattern-display {
  color: #ff4500;
  font-size: 12px;
  font-weight: bold;
  min-width: 16px;
  text-align: center;
}

.sequencer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Uniform button sizing for sequencer controls */
.sequencer-controls .play-button,
.sequencer-controls .clear-button,
.sequencer-controls .help-button,
.sequencer-controls .save-button {
  height: 36px;
  min-width: 80px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Material Icons styling */
.sequencer-controls .material-icons {
  font-size: 18px;
  line-height: 1;
}

.sequencer-controls .play-button {
  background: #ff4500;
  color: white;
}

.sequencer-controls .play-button:hover {
  background: #ff6500;
  transform: translateY(-1px);
}

.sequencer-controls .clear-button {
  background: #dc3545;
  color: white;
}

.sequencer-controls .clear-button:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.sequencer-controls .help-button {
  background: #6c757d;
  color: white;
  min-width: 36px;
  width: 36px;
}

.sequencer-controls .help-button:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.sequencer-controls .save-button {
  background: #28a745;
  color: white;
}

.sequencer-controls .save-button:hover {
  background: #218838;
  transform: translateY(-1px);
}

.sequencer-controls .variation-switch {
  display: flex;
  background: #333;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  position: relative;
}


.sequencer-controls .variation-btn {
  height: 32px;
  min-width: 32px;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sequencer-controls .variation-btn.active {
  background: #ff4500;
  color: white;
}

.sequencer-controls .variation-btn[data-variation="A"].active {
  background: #ff4500;
  color: white;
}

.sequencer-controls .variation-btn[data-variation="B"].active {
  background: #00ff88;
  color: white;
}

.sequencer-controls .variation-btn:hover:not(.active) {
  background: #555;
  color: white;
}

/* Step Sequencer Grid - Responsive without unnecessary scrolling */
/* Pattern labels and instrument rows now use pure Tailwind grid classes for consistent responsive behavior */

/* Overflow properties moved to Tailwind responsive classes */

.instrument-name {
  background: linear-gradient(145deg, #333, #1a1a1a);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 8px;
  text-align: left;
  font-size: 10px;
  color: #ff4500;
  font-weight: bold;
  text-transform: uppercase;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  overflow: hidden;
  word-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  height: 32px;
  justify-content: flex-start;
  position: relative;
  cursor: pointer;
  min-width: 0;
}

.instrument-name > span:first-of-type {
  flex-shrink: 0;
}

.instrument-name > span:nth-of-type(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mute-solo-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 4px;
}

.expand-arrow {
  font-size: 10px;
  color: #888;
  transition: transform 0.3s ease, color 0.3s ease;
  pointer-events: none;
  flex-shrink: 0;
  margin-left: 4px;
}

.expand-arrow.expanded {
  transform: rotate(180deg);
  color: #ff4500;
}

.instrument-name .material-icons {
  font-size: 20px;
  color: #ff6500;
  flex-shrink: 0;
}

.instrument-name strong {
  color: #ff4500;
  font-weight: 900;
  font-size: 12px;
  margin-right: 6px;
  text-shadow: 0 0 3px rgba(255, 69, 0, 0.3);
}

/* Mute/Solo Controls */
.mute-solo-controls {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.mute-btn, .solo-btn {
  width: 16px;
  height: 16px;
  background: rgba(60, 60, 60, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  color: #888;
  font-size: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mute-btn:hover, .solo-btn:hover {
  background: rgba(80, 80, 80, 0.9);
  color: #f0f0f0;
}

.mute-btn.active {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.solo-btn.active {
  background: #28a745;
  color: white;
  border-color: #28a745;
}

/* Instrument Controls Container */
.instrument-controls {
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateY(-2px); /* Slight overlap to create bridge */
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 10;
  min-width: 500px;
  max-width: 600px;
}

/* Controls positioned above the row */
.instrument-controls.positioned-above {
  top: auto;
  bottom: 100%;
  transform: translateY(2px);
}

.instrument-controls::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  pointer-events: auto;
}

.instrument-controls.positioned-above::before {
  top: auto;
  bottom: -2px;
}

.instrument-controls-row {
  display: flex;
  gap: 20px;
  align-items: center;
  white-space: nowrap;
  justify-content: space-between;
}

.instrument-tooltip {
  font-size: 14px;
  color: #f0f0f0;
  text-align: left;
  line-height: 1.5;
  max-width: 100%;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 8px;
}

.instrument-row {
  position: relative;
}

.instrument-controls.expanded {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.instrument-controls {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}

.control-label {
  font-size: 10px;
  color: #ff4500;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

/* Instrument Controls Header */
.instrument-controls-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 4px 8px 0 8px;
  margin-bottom: 4px;
}

.close-controls-btn {
  background: rgba(60, 60, 60, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #888;
  width: 20px;
  height: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.close-controls-btn:hover {
  background: rgba(220, 50, 50, 0.9);
  border-color: #dc3545;
  color: white;
  transform: scale(1.1);
}

/* Small Knobs for GAIN, PAN, TUNE */
.small-knob {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 30% 30%, #666, #222);
  border: 1px solid #555;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: all 0.1s ease;
}

.small-knob:hover {
  border-color: #ff4500;
}

.small-knob::after {
  content: 'drag_click';
  font-family: 'Material Symbols Outlined';
  position: absolute;
  font-size: 32px;
  color: #ff4500;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
  transform-origin: center;
  text-shadow: 0 0 3px rgba(255, 69, 0, 0.8);
  pointer-events: none;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.1s ease;
}

.small-knob:hover::after {
  color: #ff6500;
  text-shadow: 0 0 6px rgba(255, 101, 0, 1);
}

/* Shuffle Slider */
.shuffle-slider {
  width: 60px;
  height: 16px;
  background: linear-gradient(145deg, #222, #111);
  border: 1px solid #555;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.1s ease;
  overflow: hidden;
}

.shuffle-slider:hover {
  border-color: #ff4500;
}

.shuffle-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--slider-width, 0%);
  height: 100%;
  background: linear-gradient(90deg, #ff4500, #ff6500);
  border-radius: 6px;
  transition: width 0.1s ease;
  box-shadow: 0 0 2px rgba(255, 69, 0, 0.4);
}

.shuffle-slider::after {
  content: '';
  position: absolute;
  top: 1px;
  left: calc(var(--slider-width, 0%) - 6px);
  width: 10px;
  height: 14px;
  background: linear-gradient(145deg, #fff, #ddd);
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: left 0.1s ease;
}

/* Step Buttons - Core Interface - Touch Optimized */
.step-button {
  /* Basic layout properties moved to Tailwind classes */
  /* Keep complex styling that can't be replicated in Tailwind */
  background: radial-gradient(circle at 30% 30%, #444, #111);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly mobile step buttons - properties moved to Tailwind responsive classes */

.step-button:hover {
  border-color: #ff4500;
  transform: translateY(-1px);
}

.step-button.blink {
  background: linear-gradient(135deg, #ffa500, #ff8500);
  animation: pulse 0.6s infinite;
}

.step-button.disabled {
  opacity: 0.3;
  background: #1a1a1a;
  border-color: #333;
  pointer-events: none;
  transform: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Row Highlighting */
.instrument-row.row-highlight {
  background: rgba(255, 69, 0, 0.1);
  border: 1px solid rgba(255, 69, 0, 0.3);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.2);
}

/* Instrument Color Coding */
.instrument-row[data-instrument="bd"] .step-button.active {
  background: linear-gradient(135deg, #00bcd4, #0097a7);
  border-color: #00bcd4;
  box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

.instrument-row[data-instrument="sd"] .step-button.active {
  background: linear-gradient(135deg, #ffeb3b, #f57c00);
  border-color: #ffeb3b;
  color: #333;
  box-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.instrument-row[data-instrument="ch"] .step-button.active {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
  border-color: #9c27b0;
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.instrument-row[data-instrument="oh"] .step-button.active {
  background: linear-gradient(135deg, #f8bbd9, #e91e63);
  border-color: #f8bbd9;
  color: #333;
  box-shadow: 0 0 10px rgba(248, 187, 217, 0.5);
}

.instrument-row[data-instrument="cb"] .step-button.active {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  border-color: #4caf50;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.instrument-row[data-instrument="cr"] .step-button.active {
  background: linear-gradient(135deg, #ffc107, #ffb300);
  border-color: #ffc107;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.instrument-row[data-instrument="cl"] .step-button.active {
  background: linear-gradient(135deg, #8bc34a, #689f38);
  border-color: #8bc34a;
  box-shadow: 0 0 10px rgba(139, 195, 74, 0.5);
}

.instrument-row[data-instrument="cym"] .step-button.active {
  background: linear-gradient(135deg, #ff8f00, #f57c00);
  border-color: #ff8f00;
  box-shadow: 0 0 10px rgba(255, 143, 0, 0.5);
}

.instrument-row[data-instrument="lt"] .step-button.active,
.instrument-row[data-instrument="mt"] .step-button.active,
.instrument-row[data-instrument="ht"] .step-button.active {
  background: linear-gradient(135deg, #795548, #5d4037);
  border-color: #795548;
  box-shadow: 0 0 10px rgba(121, 85, 72, 0.5);
}

.instrument-row[data-instrument="hc"] .step-button.active,
.instrument-row[data-instrument="mc"] .step-button.active,
.instrument-row[data-instrument="lc"] .step-button.active {
  background: linear-gradient(135deg, #e91e63, #c2185b);
  border-color: #e91e63;
  box-shadow: 0 0 10px rgba(233, 30, 99, 0.5);
}

.instrument-row[data-instrument="ma"] .step-button.active {
  background: linear-gradient(135deg, #607d8b, #455a64);
  border-color: #607d8b;
  box-shadow: 0 0 10px rgba(96, 125, 139, 0.5);
}

.instrument-row[data-instrument="rim"] .step-button.active {
  background: linear-gradient(135deg, #ffc107, #ff8f00);
  border-color: #ffc107;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.instrument-row[data-instrument="accent"] .step-button.active {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  border-color: #f44336;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* Volume Sliders */
.volume-slider {
  width: 100px;
  height: 24px;
  background: linear-gradient(145deg, #222, #111);
  border: 1px solid #555;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  margin: 0 auto;
  transition: all 0.1s ease;
  overflow: hidden;
}

.volume-slider:hover {
  border-color: #ff4500;
}

.volume-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--slider-width, 70%);
  height: 100%;
  background: linear-gradient(90deg, #ff4500, #ff6500);
  border-radius: 10px;
  transition: width 0.1s ease;
  box-shadow: 0 0 4px rgba(255, 69, 0, 0.4);
}

.volume-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: calc(var(--slider-width, 70%) - 10px);
  width: 16px;
  height: 20px;
  background: linear-gradient(145deg, #fff, #ddd);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: left 0.1s ease;
}

/* Knob */
.knob {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 30% 30%, #666, #222);
  border: 2px solid #555;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  margin: 10px auto;
  transition: all 0.1s ease;
}

/* Knob containers for bottom section */
.sticky-bottom-section .knob-container {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.sticky-bottom-section .knob {
  width: 40px;
  height: 40px;
  margin: 0;
  flex-shrink: 0;
}

  .sticky-bottom-section .knob::after {
    font-size: 36px;
  }

.sticky-bottom-section .knob-label {
  font-size: 9px;
  margin: 0;
  white-space: nowrap;
  min-width: 70px;
  text-align: left;
  color: #ff4500;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.knob:hover {
  border-color: #ff4500;
}

.knob::after {
  content: 'drag_click';
  font-family: 'Material Symbols Outlined';
  position: absolute;
  font-size: 46px;
  color: #ff4500;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
  transform-origin: center;
  text-shadow: 0 0 4px rgba(255, 69, 0, 0.8);
  pointer-events: none;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.1s ease;
}

.knob:hover::after {
  color: #ff6500;
  text-shadow: 0 0 8px rgba(255, 101, 0, 1);
}

.knob-label {
  text-align: center;
  font-size: 10px;
  color: #ff4500;
  margin-top: 5px;
  font-weight: bold;
  text-transform: uppercase;
}

/* ===== NIXIE TUBE BPM DISPLAY ===== */
.bpm-display-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
}

.nixie-bpm-display {
  background: radial-gradient(ellipse at center, rgba(20, 20, 20, 0.9) 0%, rgba(10, 10, 10, 0.95) 70%);
  border: 2px solid rgba(139, 69, 19, 0.6);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  box-shadow: 
    0 0 10px rgba(255, 140, 0, 0.3),
    inset 0 0 15px rgba(0, 0, 0, 0.8),
    inset 0 2px 5px rgba(255, 140, 0, 0.1);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 2;
}

.nixie-digit {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  font-weight: bold;
  color: #ff8c00;
  text-shadow: 
    0 0 8px #ff8c00,
    0 0 15px #ff6600,
    0 0 25px #ff4500,
    0 0 35px #ff2200;
  animation: nixie-flicker 3s ease-in-out infinite;
  min-width: 18px;
  text-align: center;
  position: relative;
  z-index: 3;
}

.bpm-unit {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 10px;
  font-weight: bold;
  color: #ff6600;
  margin-left: 4px;
  text-shadow: 
    0 0 5px #ff6600,
    0 0 10px #ff4500;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

.nixie-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(ellipse at center, 
    rgba(255, 140, 0, 0.15) 0%, 
    rgba(255, 102, 0, 0.1) 30%, 
    transparent 70%);
  border-radius: 20px;
  animation: nixie-ambient-glow 4s ease-in-out infinite alternate;
  z-index: 1;
}

/* Nixie tube flickering animation */
@keyframes nixie-flicker {
  0%, 95%, 100% { 
    text-shadow: 
      0 0 8px #ff8c00,
      0 0 15px #ff6600,
      0 0 25px #ff4500,
      0 0 35px #ff2200;
    opacity: 1;
  }
  96%, 97% { 
    text-shadow: 
      0 0 4px #ff8c00,
      0 0 8px #ff6600,
      0 0 12px #ff4500;
    opacity: 0.8;
  }
  98% { 
    text-shadow: 
      0 0 12px #ff8c00,
      0 0 20px #ff6600,
      0 0 30px #ff4500,
      0 0 40px #ff2200;
    opacity: 1;
  }
}

/* Ambient glow pulsing */
@keyframes nixie-ambient-glow {
  0% { 
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  100% { 
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Hover effects */
.bpm-display-container:hover .nixie-bpm-display {
  box-shadow: 
    0 0 15px rgba(255, 140, 0, 0.5),
    inset 0 0 15px rgba(0, 0, 0, 0.8),
    inset 0 2px 5px rgba(255, 140, 0, 0.2);
}

.bpm-display-container:hover .nixie-digit {
  text-shadow: 
    0 0 12px #ff8c00,
    0 0 20px #ff6600,
    0 0 30px #ff4500,
    0 0 40px #ff2200;
}

/* Responsive sizing */
@media (max-width: 768px) {
  .nixie-bpm-display {
    padding: 6px 8px;
  }
  
  .nixie-digit {
    font-size: 18px;
    min-width: 14px;
  }
  
  .bpm-unit {
    font-size: 8px;
  }
}

/* ===== STICKY BOTTOM SECTION ===== */
.sticky-bottom-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 15, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  z-index: 100;
  -webkit-backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bottom-panel {
  max-width: 1200px;
  margin: 0 auto;
}

.master-controls-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.tab-navigation {
  display: flex;
  justify-content: stretch;
  gap: 2px;
  margin-bottom: 8px;
  width: 100%;
}

.tab-navigation .tab-btn {
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px 4px 0 0;
  color: #888;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
  text-align: center;
}

.tab-navigation .tab-btn:hover {
  background: rgba(50, 50, 50, 0.9);
  color: #f0f0f0;
}

.tab-navigation .tab-btn.active {
  background: linear-gradient(145deg, #ff4500, #ff6500);
  color: white;
  border-color: #ff4500;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.groove-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  justify-items: center;
  margin-bottom: 8px;
}

.master-controls {
  display: flex;
  justify-content: center;
  gap: 30px;
  align-items: center;
}

.master-controls .knob-container {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.master-controls .knob {
  width: 50px;
  height: 50px;
  margin: 0;
  flex-shrink: 0;
}

.master-controls .knob-label {
  font-size: 10px;
  margin: 0;
  white-space: nowrap;
  min-width: 80px;
  text-align: left;
  color: #ff4500;
  font-weight: bold;
  text-transform: uppercase;
}

.rhythm-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.rhythm-btn {
  background: rgba(60, 60, 60, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f0f0f0;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.rhythm-btn:hover {
  background: rgba(80, 80, 80, 0.9);
  border-color: #ff4500;
}

/* Control Icons */
.control-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(145deg, rgba(70, 70, 70, 0.9), rgba(40, 40, 40, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.control-icon:hover {
  background: linear-gradient(145deg, rgba(90, 90, 90, 0.95), rgba(60, 60, 60, 0.95));
  border-color: #ff4500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transform: translateY(-0.5px);
}

.control-icon .material-icons {
  font-size: 14px;
  color: #ff4500;
  text-shadow: 0 0 2px rgba(255, 69, 0, 0.3);
}

/* Column controls now use Tailwind classes */

.pattern-label {
  font-size: 12px;
  color: #ff4500;
  font-weight: bold;
  margin-bottom: 2px;
}

/* Row controls now use Tailwind classes */


/* Loader */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  z-index: 1000;
  transition: opacity 0.5s ease;
  padding: 2rem;
  box-sizing: border-box;
}

.loader-wrapper.done {
  opacity: 0;
  pointer-events: none;
}

.loader {
  font-size: clamp(2.5rem, 12vw, 18vmin);
  font-weight: 900;
  color: #ff4500;
  text-align: center;
  letter-spacing: 0.05em;
  animation: pulse 2s ease-in-out infinite;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loader-subtitle {
  font-size: clamp(1rem, 4vw, 6vmin);
  font-weight: 400;
  color: #ff4500;
  text-align: center;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive loader adjustments */
@media (max-width: 768px) {
  .loader {
    font-size: clamp(2rem, 10vw, 14vmin);
    letter-spacing: 0.03em;
  }
  
  .loader-subtitle {
    font-size: clamp(0.8rem, 3vw, 4vmin);
  }
  
  .loader-wrapper {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .loader {
    font-size: clamp(1.8rem, 8vw, 12vmin);
    letter-spacing: 0.01em;
  }
  
  .loader-subtitle {
    font-size: clamp(0.7rem, 2.5vw, 3vmin);
  }
  
  .loader-wrapper {
    padding: 0.5rem;
  }
}

@media (max-width: 360px) {
  .loader {
    font-size: clamp(1.5rem, 7vw, 10vmin);
    letter-spacing: 0;
  }
  
  .loader-subtitle {
    font-size: clamp(0.6rem, 2vw, 2.5vmin);
  }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Extra Small Mobile (< 360px) */
@media (max-width: 359px) {
  .app-header {
    padding: 6px 8px;
  }
  
  .app-title {
    font-size: 18px;
    margin-bottom: 8px;
  }
  
  .transport-section {
    gap: 10px;
    margin-bottom: 8px;
  }
  
  .play-button {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  .quick-actions {
    gap: 6px;
  }
  
  .style-preset-select {
    font-size: 11px;
    padding: 8px 10px;
  }
  
  .project-controls {
    gap: 4px;
  }
  
  .action-btn {
    padding: 6px 4px;
    font-size: 9px;
  }
  
  .action-btn .material-icons {
    font-size: 14px;
  }
}

/* Mobile Portrait (< 480px) */
@media (max-width: 479px) {
  .app-header {
    padding: 8px 12px;
  }
  
  .app-title {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
  }
  
  .transport-section {
    gap: 12px;
    margin-bottom: 10px;
    justify-content: center;
  }
  
  .play-button {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 25px;
  }
  
  .quick-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  .style-preset-select {
    width: 100%;
    font-size: 12px;
    padding: 10px 12px;
  }
  
  .project-controls {
    justify-content: center;
    width: 100%;
    gap: 6px;
  }
  
  .main-content {
    padding: 10px 10px 160px 10px; /* Adjust for smaller bottom section */
  }
  
  .sequencer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .sequencer-header .section-title {
    font-size: 16px;
    text-align: center;
    width: 100%;
  }
  
  .sequencer-controls {
    width: 100%;
    justify-content: center;
    gap: 6px;
  }
  
  .sequencer-controls .play-button,
  .sequencer-controls .clear-button,
  .sequencer-controls .help-button,
  .sequencer-controls .save-button {
    height: 32px;
    min-width: 70px;
    font-size: 10px;
    padding: 6px 8px;
  }
  
  .sequencer-controls .help-button {
    min-width: 32px;
    width: 32px;
  }
  
  .sequencer-controls .variation-btn {
    height: 28px;
    min-width: 28px;
    font-size: 10px;
  }
  
  .sequencer-controls .material-icons {
    font-size: 16px;
  }
  
  .sticky-bottom-section {
    padding: 6px 8px;
  }
  
  .master-controls-section {
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  
  .tab-navigation .tab-btn {
    padding: 4px 8px;
    font-size: 8px;
  }
  
  .sticky-bottom-section .knob {
    width: 35px;
    height: 35px;
    margin: 3px auto;
  }
  
  .sticky-bottom-section .knob::after {
    font-size: 30px;
  }
  
  .sticky-bottom-section .knob-label {
    font-size: 7px;
    margin-top: 2px;
  }
  
  .groove-controls {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 6px;
  }
  
  .master-controls {
    gap: 20px;
  }
  
  .master-controls .knob-container {
    gap: 8px;
  }
  
  .master-controls .knob-label {
    font-size: 8px;
    min-width: 60px;
  }
  
  .sticky-bottom-section .knob-container {
    gap: 6px;
  }
  
  .sticky-bottom-section .knob-label {
    font-size: 8px;
    min-width: 55px;
  }
  
  /* Grid layout now fully handled by Tailwind classes */
  
  /* Step button responsive properties moved to Tailwind classes */
  
  .pattern-label {
    font-size: 10px;
  }
  
  .instrument-name {
    font-size: 8px;
    padding: 4px 6px;
    line-height: 1.1;
    height: 24px;
    gap: 4px;
    min-width: 0;
  }
  
  .mute-solo-controls {
    gap: 1px;
    margin-left: 2px;
  }
  
  .mute-btn, .solo-btn {
    width: 12px;
    height: 12px;
    font-size: 6px;
  }
  
  .expand-arrow {
    font-size: 8px;
    margin-left: 2px;
  }
  
  .instrument-name .material-icons {
    font-size: 18px;
  }
  
  .instrument-name strong {
    font-size: 10px;
    margin-right: 4px;
  }
  
  .volume-slider {
    width: 45px;
    height: 14px;
  }
  
  .groove-controls {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .knob {
    width: 40px;
    height: 40px;
  }
  
  .action-btn {
    padding: 8px 6px;
    font-size: 10px;
    flex: 1;
    min-width: 0;
    border-radius: 6px;
    justify-content: center;
  }
  
  .action-btn .button-text {
    display: none;
  }
  
  .action-btn .material-icons {
    font-size: 16px;
  }
  
  .button-text {
    display: none;
  }
  
  /* Ensure control icons remain usable on mobile */
  .control-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }
  
  .control-icon .material-icons {
    font-size: 10px;
  }
  
  /* Control button groups for mobile - properties moved to Tailwind classes */
}

/* Mobile Landscape & Small Tablets (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .app-header {
    padding: 12px 18px;
  }
  
  .app-title {
    font-size: 22px;
    margin-bottom: 14px;
  }
  
  .quick-actions {
    justify-content: space-around;
    gap: 14px;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .project-controls {
    gap: 10px;
    justify-content: center;
    width: 100%;
  }
  
  .action-btn {
    padding: 9px 14px;
    font-size: 11px;
    min-width: 80px;
  }
  
  .action-btn .button-text {
    display: inline;
  }
  
  .action-btn .material-icons {
    font-size: 15px;
  }
  
  .style-preset-select {
    min-width: 180px;
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .inspiration-select {
    min-width: 180px;
    font-size: 13px;
    padding: 10px 14px;
  }
  
  /* Grid layout now fully handled by Tailwind classes */
  
  /* Step button responsive properties moved to Tailwind classes */
  
  .pattern-label {
    font-size: 11px;
  }
  
  .groove-controls {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-header {
    padding: 16px 24px;
  }
  
  .app-title {
    font-size: 26px;
    margin-bottom: 16px;
  }
  
  .quick-actions {
    gap: 20px;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  
  .project-controls {
    gap: 12px;
    flex-wrap: nowrap;
  }
  
  .action-btn {
    padding: 10px 16px;
    font-size: 12px;
    min-width: 90px;
  }
  
  .action-btn .material-icons {
    font-size: 16px;
  }
  
  .style-preset-select {
    min-width: 220px;
    font-size: 14px;
    padding: 12px 16px;
  }
  
  .inspiration-select {
    min-width: 220px;
    font-size: 14px;
    padding: 12px 16px;
  }
  
  /* Grid layout now fully handled by Tailwind classes */
  
  /* Step button responsive properties moved to Tailwind classes */
  
  .pattern-label {
    font-size: 11px;
  }
  
  .groove-controls {
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
  }
  
  .instrument-name .material-icons {
    font-size: 22px;
  }
  
  .instrument-name strong {
    font-size: 11px;
    margin-right: 5px;
  }
  
  .mute-solo-controls {
    gap: 2px;
    margin-left: 4px;
  }
  
  .mute-btn, .solo-btn {
    width: 15px;
    height: 15px;
    font-size: 8px;
  }
  
  .expand-arrow {
    font-size: 10px;
    margin-left: 4px;
  }
}

/* Tablet Portrait Orientation - Vertical Layout */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .app-header {
    padding: 14px 20px;
  }
  
  .quick-actions {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }
  
  .style-preset-select,
  .inspiration-select {
    width: 100%;
    min-width: unset;
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .project-controls {
    justify-content: center;
    width: 100%;
    gap: 8px;
  }
  
  .action-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* Tablet Landscape Optimization - Horizontal Layout */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
  .app-header {
    padding: 10px 18px;
  }
  
  .app-title {
    font-size: 22px;
    margin-bottom: 10px;
  }
  
  .quick-actions {
    flex-direction: row;
    justify-content: space-around;
    gap: 14px;
    flex-wrap: nowrap;
  }
  
  .style-preset-select,
  .inspiration-select {
    min-width: 180px;
    font-size: 13px;
    padding: 8px 12px;
  }
  
  .project-controls {
    gap: 8px;
  }
  
  .action-btn {
    padding: 8px 12px;
    font-size: 11px;
    min-width: 75px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .app-header {
    padding: 20px 30px;
  }
  
  .transport-section {
    gap: 30px;
  }
  
  /* Grid layout now fully handled by Tailwind classes */
  
  /* Step button responsive properties moved to Tailwind classes */
  
  .pattern-label {
    font-size: 12px;
  }
  
  .groove-controls {
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
  }
  
  .main-content {
    padding: 170px 30px 120px 30px; /* Top padding increased to account for fixed header, moderate bottom padding for desktop */
  }
  
  .step-sequencer-panel {
    padding: 12px 12px 120px 12px; /* Reduced bottom padding for desktop */
  }
  
  .instrument-name .material-icons {
    font-size: 24px;
  }
  
  .instrument-name strong {
    font-size: 12px;
    margin-right: 6px;
  }
  
  .mute-solo-controls {
    gap: 2px;
    margin-left: 4px;
  }
  
  .mute-btn, .solo-btn {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  
  .expand-arrow {
    font-size: 10px;
    margin-left: 4px;
  }
}

/* Extra Large Desktop - Tailwind xl breakpoint (1280px+) */
@media (min-width: 1280px) {
  /* Grid layout now fully handled by Tailwind classes */
  
  .pattern-label {
    font-size: 12px;
  }
  
  .instrument-name {
    font-size: 11px;
    padding: 7px 8px;
  }
  
  .instrument-name .material-icons {
    font-size: 26px;
  }
  
  .instrument-name strong {
    font-size: 12px;
    margin-right: 6px;
  }
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  /* Grid layout now fully handled by Tailwind classes */
  
  /* Step button responsive properties moved to Tailwind classes */
  
  .pattern-label {
    font-size: 13px;
  }
  
  .instrument-name {
    font-size: 12px;
    padding: 8px 6px;
    line-height: 1.2;
  }
  
  .instrument-name .material-icons {
    font-size: 28px;
  }
  
  .instrument-name strong {
    font-size: 13px;
    margin-right: 6px;
  }
  
  .mute-solo-controls {
    gap: 3px;
    margin-left: 6px;
  }
  
  .mute-btn, .solo-btn {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }
  
  .expand-arrow {
    font-size: 12px;
    margin-left: 6px;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tailwind Integration Helpers */
.touch-friendly {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Ensure instrument rows are visible - Override any Tailwind conflicts */
.instrument-row {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Mobile Improvements */
@media (max-width: 640px) {
  .main-content {
    padding-bottom: 180px !important; /* More space for sticky bottom */
  }
  
  .step-sequencer-panel {
    padding: 8px !important;
  }
  
  .instrument-name {
    font-size: 9px !important;
    padding: 3px 6px !important;
    min-height: 28px !important;
  }
  
  /* Grid layout now fully handled by Tailwind classes */
}

/* ===== MODAL STYLES - 2025 UX/UI BEST PRACTICES ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  width: min(90vw, 1200px);
  height: min(85vh, 800px);
  max-width: 1200px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-content {
  transform: scale(1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.modal-header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-reset-btn {
  background: #ff4500;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.global-reset-btn:hover {
  background: #ff5500;
  transform: translateY(-1px);
}

.section-reset-btn {
  background: rgba(255, 69, 0, 0.2);
  color: #ff4500;
  border: 1px solid #ff4500;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 12px;
}

.section-reset-btn:hover {
  background: #ff4500;
  color: white;
  transform: scale(1.05);
}

.section-randomize-btn {
  background: rgba(0, 150, 255, 0.2);
  color: #0096ff;
  border: 1px solid #0096ff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.section-randomize-btn:hover {
  background: #0096ff;
  color: white;
  transform: scale(1.05);
}

.modal-header h2 {
  color: #ff4500;
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 1px;
}

.close-btn {
  background: none;
  border: none;
  color: #f0f0f0;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ff4500;
}

.close-btn .material-icons {
  font-size: 24px;
}

.modal-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-tabs .tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #888;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.modal-tabs .tab-btn:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.05);
}

.modal-tabs .tab-btn.active {
  color: #ff4500;
  border-bottom-color: #ff4500;
  background: rgba(255, 69, 0, 0.1);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(16px, 3vw, 25px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #ff4500 rgba(255, 255, 255, 0.1);
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff4500, #ff6500);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff5500, #ff7500);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  color: #ff4500;
  font-size: 20px;
  font-weight: 700;
  margin: 20px 0 15px 0;
  border-bottom: 2px solid rgba(255, 69, 0, 0.3);
  padding-bottom: 8px;
}

.tab-content h4 {
  color: #f0f0f0;
  font-size: 16px;
  font-weight: 600;
  margin: 15px 0 10px 0;
}

.tab-content ul {
  margin: 10px 0 20px 20px;
  color: #ccc;
  line-height: 1.6;
}

.tab-content li {
  margin: 8px 0;
}

.tab-content strong {
  color: #ff4500;
  font-weight: 600;
}

/* Help Button Styles */
.help-btn {
  background: linear-gradient(145deg, #333, #444);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f0f0f0;
  cursor: pointer;
  padding: 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
}

.help-btn:hover {
  background: linear-gradient(145deg, #ff4500, #ff6500);
  border-color: #ff4500;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

.help-btn .material-icons {
  font-size: 24px;
}

/* Mobile Modal Optimizations */
@media (max-width: 640px) {
  /* Modal container adjustments */
  #instrumentModal .modal-content,
  #instrumentModal #modalContent {
    width: 98vw !important;
    height: 98vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 12px !important;
  }
  
  /* Compact modal header */
  #instrumentModal .modal-header,
  #instrumentModal .flex.items-center.justify-between {
    padding: 12px 16px !important;
  }
  
  #instrumentModal h2 {
    font-size: 16px !important;
  }
  
  /* Compact modal body */
  #instrumentModal .modal-body,
  #instrumentModal .flex-1.overflow-y-auto {
    padding: 8px !important;
  }
  
  /* Top section mobile layout */
  #instrumentModal .modal-top-section,
  #instrumentModal .flex.flex-col.lg\\:flex-row {
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  
  /* Mobile-optimized action buttons */
  #instrumentModal .modal-actions,
  #instrumentModal .flex.gap-2.flex-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }
  
  #instrumentModal .modal-actions button,
  #instrumentModal .flex.items-center.gap-2.bg-orange-500,
  #instrumentModal .flex.items-center.gap-2.bg-blue-500,
  #instrumentModal .flex.items-center.gap-2.bg-green-500,
  #instrumentModal .flex.items-center.gap-2.bg-purple-500 {
    padding: 8px 6px !important;
    font-size: 11px !important;
    min-width: auto !important;
    gap: 4px !important;
  }
  
  #instrumentModal .modal-actions button span:last-child {
    display: none !important;
  }
  
  /* Compact description card */
  #instrumentModal .modal-description {
    padding: 8px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
  
  /* Mobile grid layout - single column */
  #instrumentModal .grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  /* Compact control sections */
  #instrumentModal .control-section {
    padding: 8px !important;
    border-radius: 6px !important;
  }
  
  #instrumentModal .control-section h3 {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    padding-bottom: 6px !important;
  }
  
  /* Mobile section buttons */
  #instrumentModal .section-reset-btn,
  #instrumentModal .section-randomize-btn {
    padding: 4px 6px !important;
    font-size: 10px !important;
    gap: 3px !important;
  }
  
  #instrumentModal .section-reset-btn span:last-child,
  #instrumentModal .section-randomize-btn span:last-child {
    display: none !important;
  }
  
  /* Compact control grids */
  #instrumentModal .control-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  
  /* Smaller controls on mobile */
  #instrumentModal .small-knob {
    width: 36px !important;
    height: 36px !important;
  }
  
  #instrumentModal .volume-slider,
  #instrumentModal .shuffle-slider {
    width: 45px !important;
    height: 14px !important;
  }
  
  #instrumentModal .control-label {
    font-size: 9px !important;
  }
  
  /* Hide scrollbar on mobile for cleaner look */
  #instrumentModal .modal-body {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  
  #instrumentModal .modal-body::-webkit-scrollbar {
    display: none !important;
  }
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    height: 95%;
    margin: 2.5%;
  }
  
  .instrument-modal-content {
    width: 95%;
    height: 95%;
  }
  
  .instrument-modal-controls {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 15px;
  }
  
  .modal-control-section {
    min-height: auto;
    padding: 15px;
  }
  
  .modal-control-section .small-knob {
    width: 60px;
    height: 60px;
  }
  
  .modal-control-section .small-knob::after {
    font-size: 45px;
  }
  
  .modal-control-section .control-label {
    font-size: 12px;
  }
  
  .modal-control-section h3 {
    font-size: 18px;
  }
  
  .modal-controls-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-tabs .tab-btn {
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .tab-content h3 {
    font-size: 18px;
  }
  
  .tab-content h4 {
    font-size: 15px;
  }
}

/* ===== INSTRUMENT MODAL STYLES (Legacy - mostly replaced by Tailwind) ===== */

.modal-control-section {
  background: rgba(25, 25, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-control-section h3 {
  color: #ff4500;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 69, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.modal-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  align-items: center;
  justify-items: center;
  flex: 1;
  align-content: center;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}


.modal-action-btn {
  min-width: 140px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(145deg, #444, #222);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-action-btn:hover {
  background: linear-gradient(145deg, #ff4500, #ff6500);
  border-color: #ff4500;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

.modal-description {
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.3);
  border-radius: 8px;
  padding: 20px;
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: #f0f0f0;
  text-align: left;
}

/* Modal Control Groups - Enhanced */
.modal-control-section .control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 140px;
}

.modal-control-section .control-label {
  font-size: 14px;
  color: #ff4500;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 8px;
}

/* Enhanced knobs for modal */
.modal-control-section .small-knob {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 30% 30%, #777, #333);
  border: 3px solid #666;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: all 0.1s ease;
}

.modal-control-section .small-knob:hover {
  border-color: #ff4500;
  box-shadow: 0 0 8px rgba(255, 69, 0, 0.4);
}

.modal-control-section .small-knob::after {
  content: 'drag_click';
  font-family: 'Material Symbols Outlined';
  position: absolute;
  font-size: 60px;
  color: #ff4500;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
  transform-origin: center;
  text-shadow: 0 0 6px rgba(255, 69, 0, 0.8);
  pointer-events: none;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.1s ease;
}

.modal-control-section .small-knob:hover::after {
  color: #ff6500;
  text-shadow: 0 0 8px rgba(255, 101, 0, 1);
}

/* Enhanced sliders for modal */
.modal-control-section .volume-slider,
.modal-control-section .shuffle-slider {
  width: 120px;
  height: 30px;
  background: linear-gradient(145deg, #333, #111);
  border: 1px solid #666;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: all 0.1s ease;
  overflow: hidden;
}

.modal-control-section .volume-slider:hover,
.modal-control-section .shuffle-slider:hover {
  border-color: #ff4500;
  box-shadow: 0 0 4px rgba(255, 69, 0, 0.4);
}

.modal-control-section .volume-slider::before,
.modal-control-section .shuffle-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--slider-width, 70%);
  height: 100%;
  background: linear-gradient(90deg, #ff4500, #ff6500);
  border-radius: 8px;
  transition: width 0.1s ease;
  box-shadow: 0 0 3px rgba(255, 69, 0, 0.5);
}

.modal-control-section .volume-slider::after,
.modal-control-section .shuffle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: calc(var(--slider-width, 70%) - 8px);
  width: 14px;
  height: 16px;
  background: linear-gradient(145deg, #fff, #ddd);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: left 0.1s ease;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
  .instrument-modal-content {
    width: 95%;
    max-height: 90vh;
    margin: 5vh auto;
  }
  
  .instrument-modal-body {
    padding: 15px;
    max-height: calc(90vh - 120px);
  }
  
  .modal-controls-row {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
  }
  
  .modal-control-section {
    padding: 15px;
  }
  
  .modal-control-section h3 {
    font-size: 16px;
  }
  
  .modal-actions {
    gap: 10px;
  }
  
  .modal-action-btn {
    min-width: 100px;
    padding: 10px 15px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .instrument-modal-content {
    width: 98%;
    max-height: 95vh;
    margin: 2.5vh auto;
  }
  
  .modal-controls-row {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
  }
  
  .modal-control-section .small-knob {
    width: 35px;
    height: 35px;
  }
  
  .modal-control-section .small-knob::after {
    font-size: 30px;
  }
  
  .modal-control-section .volume-slider,
  .modal-control-section .shuffle-slider {
    width: 60px;
    height: 16px;
  }
  
  .modal-control-section .control-label {
    font-size: 9px;
  }
}