/* Base and Typography */
:root {
  /* Modern Music Production Colors */
  --primary: #ff6b35; /* Warm orange accent */
  --secondary: #7c5cff; /* Purple accent */
  --accent: #ff3d85; /* Pink accent */
  --success: #00d9a5; /* Green accent */
  --warning: #ffcc00; /* Yellow */

  /* Neutral colors */
  --bg-dark: #1a1a1f;
  --bg-medium: #252530;
  --bg-light: #2e2e3a;
  --bg-card: #35353f;
  --text-primary: #ffffff;
  --text-secondary: #b4b4c8;
  --text-muted: #85859b;

  /* UI Elements */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);

  /* Beat Grid */
  --button-off: #45454f;
  --button-hover: #5a5a6a;
  --button-active: var(--primary);
  --button-ticked: var(--secondary);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  background-color: var(--bg-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.accent {
  color: var(--primary);
}

/* Mobile Top Menu */
.mobile-top-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  z-index: 1000;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu-btn {
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--bg-light);
}

.mobile-title {
  flex: 1;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.playback-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bg-light);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1100;
  padding: 20px;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-menu-close {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu-content {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mobile-menu-item {
  display: block;
  padding: 12px 15px;
  background-color: rgba(30, 144, 255, 0.1);
  color: var(--secondary);
  text-decoration: none;
  font-family: 'Orbitron', sans-serif;
  border-radius: 5px;
  border: 1px solid rgba(30, 144, 255, 0.3);
  text-align: center;
  font-size: 1rem;
}

.mobile-menu-item:active {
  background-color: rgba(30, 144, 255, 0.2);
  transform: scale(0.98);
}

/* Main Content Wrapper */
.main-content {
  margin-left: 0;
  padding: 24px;
}

/* Interface Header */
.interface-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.inspire-logo {
  margin-right: 24px;
}

.logo-img {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.interface-title {
  flex: 1;
}

.subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 400;
}

.playback-status {
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-light);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.playback-status.playing {
  color: var(--success);
  border-color: var(--success);
  background-color: rgba(0, 217, 165, 0.1);
}

/* Core styles matching the dashboard */
.inspire-interface {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
  color: var(--text-primary);
  background-color: transparent;
  position: relative;
}

/* Status Bar */
.status-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.status-indicator {
  font-weight: 600;
  display: flex;
  align-items: center;
  color: var(--success);
}

.status-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 217, 165, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(0, 217, 165, 0); }
  100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 217, 165, 0); }
}

.status-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 5px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
  opacity: 0.6;
}

.dot:nth-child(1) {
  animation: dot-pulse 2s infinite;
}

.dot:nth-child(2) {
  animation: dot-pulse 2s infinite 0.5s;
}

.dot:nth-child(3) {
  animation: dot-pulse 2s infinite 1s;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.status-code {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Module structure */
.beat-machine-module {
  position: relative;
  z-index: 2;
  padding: 32px;
  background: var(--bg-medium);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.module-container {
  margin-bottom: 28px;
}

.module-title {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  letter-spacing: -0.01em;
}

/* Beat Machine Section Selector */
.section-selector {
  margin-bottom: 24px;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.section-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 90px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.section-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.section-tab:hover::before {
  width: 300px;
  height: 300px;
}

.section-tab:hover {
  background: var(--bg-light);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.section-tab:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.1s ease;
}

.section-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
  transform: translateY(-2px);
}

.section-tab.active:hover {
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

/* Controls Panel */
.controls-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border);
  min-width: 220px;
}

.control-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tempo-display {
  position: relative;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 140px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.tempo-value {
  font-family: 'Inter', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
}

.tempo-label {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tempo-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.tempo-slider-container {
  width: 100%;
}

.tempo-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: var(--bg-dark);
  outline: none;
  border: 1px solid var(--border);
  cursor: pointer;
}

.tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.tempo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
}

.tempo-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.tempo-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(255, 107, 53, 0.4);
}

.tempo-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.control-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.control-btn:hover::after {
  width: 200px;
  height: 200px;
}

.control-btn:hover {
  background: var(--bg-light);
  border-color: var(--border-hover);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.control-btn:active {
  transform: translateY(-1px) scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.1s ease;
}

.control-btn.wide {
  width: auto;
  padding: 0 24px;
  font-size: 0.875rem;
  height: 48px;
  letter-spacing: -0.01em;
}

.control-btn.large {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  border-radius: 16px;
}

.control-btn.primary {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 217, 165, 0.3);
}

.control-btn.primary::after {
  background: rgba(255, 255, 255, 0.3);
}

.control-btn.primary:hover {
  background: #00c294;
  border-color: #00c294;
  box-shadow: 0 10px 30px rgba(0, 217, 165, 0.5);
  transform: translateY(-5px) scale(1.08);
}

.control-btn.primary:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 217, 165, 0.4);
}

.playback-controls {
  display: flex;
  justify-content: center;
  margin: 0 10px;
}

.pattern-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Beat Grid, specifically enhanced for mobile */
.beat-maker-wrap {
  margin-bottom: 35px;
}

.mobile-instrument-select {
  display: none;
  margin-bottom: 15px;
  align-items: center;
  gap: 10px;
}

.mobile-instrument-select label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--secondary);
}

.beat-maker-container {
  display: flex;
  position: relative;
}

.instrument-labels {
  width: 160px;
  display: none; /* Hidden for 6x6 grid layout */
  flex-direction: column;
  padding-right: 15px;
}

.instrument-label {
  height: 30px;
  margin: 4px 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.2s;
}

.instrument-label:hover {
  color: var(--text-primary);
}

.instrument-label.active {
  color: var(--primary);
  font-weight: 600;
}

.instrument-label.custom-sound {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-btn {
  font-size: 0.65rem;
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0;
  transition: all 0.2s ease;
}

.upload-btn:hover {
  background: #ff2976;
  box-shadow: 0 2px 8px rgba(255, 61, 133, 0.3);
  transform: translateY(-1px);
}

.sound-upload {
  display: none;
}

.grid-container {
  flex: 1;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  overflow-x: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 12px;
  min-width: unset;
  max-width: 700px;
  margin: 0 auto;
  aspect-ratio: 1;
}

.grid button {
  background: var(--button-off);
  border: 2px solid var(--border);
  padding: 0;
  height: 100%;
  min-height: 80px;
  position: relative;
  outline: none;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.grid button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.grid button:hover::before {
  width: 150px;
  height: 150px;
}

.grid button:hover {
  background: var(--button-hover);
  border-color: var(--border-hover);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.grid button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.1s ease;
}

.grid button.on {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  color: white;
}

.grid button.on::before {
  background: rgba(255, 255, 255, 0.2);
}

.grid button.on:hover {
  background: #ff7e4d;
  border-color: #ff7e4d;
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
  transform: scale(1.1);
}

.grid button.on:active {
  transform: scale(0.98);
}

.grid button.ticked {
  background: var(--secondary);
  border-color: var(--secondary);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.6);
  transform: scale(1.1);
}

.grid button.ticked.on {
  background: var(--secondary);
  border-color: var(--secondary);
}

/* Mobile Pattern Navigation */
.mobile-grid-navigation {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  border: 1px solid rgba(30, 144, 255, 0.2);
}

.beat-page-indicator {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--secondary);
}

.beat-navigation-controls {
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: rgba(30, 144, 255, 0.1);
  border: 1px solid rgba(30, 144, 255, 0.3);
  border-radius: 5px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.nav-btn:hover::before {
  width: 80px;
  height: 80px;
}

.nav-btn:hover {
  background: rgba(30, 144, 255, 0.2);
  border-color: rgba(30, 144, 255, 0.5);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
}

.nav-btn:active {
  background: rgba(30, 144, 255, 0.3);
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(124, 92, 255, 0.2);
  transition: all 0.1s ease;
}

/* Effects Panel - Enhanced UX/UI */
.effects-module {
  margin-bottom: 28px;
}

.effects-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  background: var(--bg-card);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.effect-group {
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
  position: relative;
  transition: all 0.3s ease;
}

.effect-group:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.effect-label {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.effect-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.slider-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-dark);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.slider-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-value {
  font-family: 'Inter', monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 80px;
  text-align: center;
}

.effect-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: var(--bg-dark);
  outline: none;
  border: 1px solid var(--border);
  cursor: pointer;
}

.effect-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.effect-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(124, 92, 255, 0.4);
}

.effect-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.effect-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(124, 92, 255, 0.4);
}

.effect-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-dark);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Toggle Switch - Enhanced */
.toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-dark);
  border: 2px solid var(--border);
  transition: all 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: all 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
  background-color: var(--success);
  border-color: var(--success);
}

input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(0, 217, 165, 0.2);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
  background-color: white;
}

/* MIDI Keyboard - Centered and Enhanced */
.keyboard-module {
  margin-bottom: 35px;
}

.keyboard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  align-items: center;
  justify-content: center;
}

.preset-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.preset-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--secondary);
  letter-spacing: 1px;
}

.octave-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.octave-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--secondary);
  letter-spacing: 1px;
}

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

.octave-display {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.2rem;
  color: var(--secondary);
  width: 30px;
  text-align: center;
}

.keyboard-options {
  display: flex;
  gap: 15px;
}

.option-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.option-checkbox input {
  width: 18px;
  height: 18px;
  background: rgba(30, 144, 255, 0.1);
  border: 1px solid rgba(30, 144, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
}

.checkbox-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--light);
  letter-spacing: 0.5px;
}

.midi-keyboard {
  display: flex;
  height: 140px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--border);
  border-top: none;
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  align-items: flex-end;
}

.key {
  position: relative;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.key.white {
  background: linear-gradient(to bottom, #fff 0%, #eee 100%);
  height: 100%;
  width: 40px;
  border: 1px solid #888;
  border-radius: 0 0 4px 4px;
  color: #333;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key.white:hover {
  background: linear-gradient(to bottom, #f0f8ff 0%, #e6f2ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.key.white:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.key.white.active {
  background: linear-gradient(to bottom, var(--secondary) 0%, rgba(124, 92, 255, 0.8) 100%);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(124, 92, 255, 0.4);
  transform: translateY(2px);
}

.key.black {
  background: linear-gradient(to bottom, #444 0%, #222 100%);
  height: 65%;
  width: 24px;
  border: 1px solid #000;
  border-radius: 0 0 2px 2px;
  margin-left: -12px;
  margin-right: -12px;
  z-index: 2;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.key.black:hover {
  background: linear-gradient(to bottom, #666 0%, #444 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.key.black:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.key.black.active {
  background: linear-gradient(to bottom, var(--accent) 0%, rgba(255, 61, 133, 0.8) 100%);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(255, 61, 133, 0.4);
  transform: translateY(2px);
}

.key-label {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
  font-size: 0.65rem;
  font-family: 'Share Tech Mono', monospace;
  opacity: 0.7;
}

.keyboard-info {
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--light);
  opacity: 0.7;
  font-family: 'Rajdhani', sans-serif;
}

/* Option Select */
.option-select {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  appearance: none;
  min-height: 48px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
  position: relative;
}

.option-select:hover {
  background: var(--bg-light);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.option-select:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.option-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
  transform: translateY(-2px);
}

/* Section Controls - Enhanced and Centered */
.section-controls {
  margin-bottom: 35px;
}

.section-control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  justify-content: center;
  align-items: center;
  background: var(--bg-card);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.section-control-buttons .control-btn {
  min-width: 160px;
  height: 56px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-card) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.section-control-buttons .control-btn:hover {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-light) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.section-control-buttons .option-select {
  min-width: 160px;
  height: 56px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Sequencer Timeline */
.sequencer-timeline {
  margin-bottom: 20px;
}

.timeline-container {
  display: flex;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  border: 1px solid rgba(30, 144, 255, 0.2);
  height: 50px;
  overflow: hidden;
  margin-bottom: 15px;
  margin-top: 15px;
}

.timeline-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  border-right: 1px solid var(--grid-border);
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

.timeline-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.timeline-section:hover::after {
  left: 100%;
}

.timeline-section:last-child {
  border-right: none;
}

.timeline-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  filter: brightness(1.2);
}

.timeline-section:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
}

.timeline-section.intro {
  background: linear-gradient(135deg, rgba(255, 61, 133, 0.2), rgba(255, 61, 133, 0.1));
}

.timeline-section.verse {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(124, 92, 255, 0.1));
}

.timeline-section.chorus {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.1));
}

.timeline-section.outro {
  background: linear-gradient(135deg, rgba(0, 217, 165, 0.2), rgba(0, 217, 165, 0.1));
}

/* Panel blinker */
.panel-blinker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  bottom: 16px;
  right: 16px;
  animation: blinker 3s infinite;
}

@keyframes blinker {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0, 217, 165, 0.4);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 4px rgba(0, 217, 165, 0);
  }
}

/* Interface Footer */
.interface-footer {
  position: relative;
  z-index: 2;
  margin-top: 32px;
  padding-top: 24px;
}

.footer-line {
  height: 1px;
  background: var(--border);
  margin-bottom: 16px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-code {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}

.notification {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: notification-slide-in 0.3s ease forwards;
  max-width: 90vw;
  backdrop-filter: blur(20px);
}

@keyframes notification-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notification-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Remove glitch and scanning animations - replaced with subtle modern effects */
.scanning {
  position: relative;
}

.glitch {
  /* Remove glitch effect */
}

/* Custom styles for touch devices */
.touch-device .control-btn,
.touch-device .section-tab,
.touch-device .key,
.touch-device .nav-btn,
.touch-device .grid button,
.touch-device .option-select,
.touch-device .timeline-section {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.touch-device .upload-btn {
  cursor: default;
}

/* Enhanced mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
  /* Mobile touch-specific styles */
  .control-btn:active,
  .section-tab:active,
  .nav-btn:active {
    transform: scale(0.92);
    transition: transform 0.1s ease;
  }

  .grid button:active {
    transform: scale(0.88);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .control-btn.primary:active {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(0, 217, 165, 0.4);
  }

  .key:active {
    transform: translateY(3px) scale(0.95);
  }

  .timeline-section:active {
    transform: translateY(0) scale(0.97);
  }

  .option-select:active {
    transform: translateY(1px) scale(0.98);
  }

  /* Increase touch target sizes on mobile */
  .control-btn,
  .section-tab,
  .nav-btn {
    min-height: 48px;
    min-width: 48px;
  }

  .grid button {
    min-height: 52px;
  }
}

/* Fast tap response */
.touch-device .control-btn:active,
.touch-device .section-tab:active,
.touch-device .key:active {
  transform: scale(0.95);
  transition: transform 0.08s;
}

/* Responsive styles - MAJOR MOBILE ENHANCEMENTS */
@media (max-width: 1200px) {
  .controls-panel, .effects-panel {
    gap: 15px;
    justify-content: space-around;
  }
  
  .control-group, .effect-group {
    min-width: 180px;
  }
  
  .midi-keyboard {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 992px) {
  .playback-status {
    position: static;
    margin-left: auto;
    margin-top: 10px;
  }
  
  .interface-header {
    flex-wrap: wrap;
  }
  
  .instrument-label {
    font-size: 0.7rem;
  }
  
  .effect-group {
    flex: 0 0 calc(50% - 10px);
  }
}

@media (max-width: 768px) {
  /* Mobile Top Menu */
  .mobile-top-menu {
    display: flex;
  }
  
  body {
    padding-top: 50px; /* Space for fixed top menu */
  }
  
  .notification-container {
    top: 60px;
  }
  
  /* Hide sidebar for mobile */
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding: 15px;
  }
  
  .interface-header {
    flex-direction: column;
    text-align: center;
  }
  
  .inspire-logo {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .playback-status {
    width: 100%;
    margin-top: 15px;
    text-align: center;
  }
  
  .status-bar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .status-dots {
    display: none;
  }
  
  /* Improved grid display for mobile - 6x6 layout */
  .beat-maker-container {
    flex-direction: column;
  }

  .mobile-instrument-select {
    display: flex;
  }

  .instrument-labels {
    display: none;
  }

  .grid-container {
    margin-top: 15px;
    width: 100%;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    min-width: 0;
    width: 100%;
    gap: 10px;
    max-width: 100%;
  }

  .grid button {
    min-height: 100px;
  }

  .mobile-grid-navigation {
    display: flex;
  }
  
  /* More touch-friendly effect controls */
  .control-group, .effect-group {
    flex: 0 0 100%;
  }
  
  .effect-group {
    order: 3;
  }
  
  .keyboard-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* Ensure minimum touch target size */
  .control-btn,
  .section-tab,
  .option-select,
  .key,
  .nav-btn,
  .toggle {
    min-height: 44px;
  }
  
  .tempo-slider, .effect-slider {
    height: 10px;
  }
  
  .tempo-slider::-webkit-slider-thumb,
  .effect-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }
  
  .tempo-slider::-moz-range-thumb,
  .effect-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }
  
  .timeline-container {
    height: 40px;
  }
  
  .timeline-section {
    font-size: 0.7rem;
  }
  
  .midi-keyboard {
    height: 120px;
  }
  
  .key.white {
    width: 36px;
  }
  
  .key.black {
    width: 20px;
    margin-left: -10px;
    margin-right: -10px;
  }
}

/* Further mobile optimizations */
@media (max-width: 480px) {
  .inspire-interface {
    padding: 20px 12px;
  }
  
  .beat-machine-module {
    padding: 15px;
  }
  
  h1 {
    font-size: 1.7rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  /* Improved grid sizing for small screens */
  .grid button {
    min-height: 90px;
  }

  .grid {
    gap: 8px;
  }

  .section-control-buttons {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .section-control-buttons .control-btn,
  .section-control-buttons .option-select {
    min-width: 100%;
  }
  
  .controls-panel, .effects-panel {
    padding: 15px;
    gap: 10px;
  }
  
  .tempo-display {
    width: 100px;
    height: 75px;
  }
  
  .tempo-value {
    font-size: 2rem;
  }
  
  .control-btn.large {
    width: 50px;
    height: 50px;
  }
  
  .control-btn.wide {
    padding: 0 12px;
    font-size: 0.8rem;
  }
  
  .option-select {
    padding: 10px;
    font-size: 0.8rem;
  }
  
  .midi-keyboard {
    height: 100px;
    padding: 10px;
  }
  
  .key.white {
    width: 32px;
  }
  
  .key.black {
    width: 18px;
    margin-left: -9px;
    margin-right: -9px;
  }
  
  .keyboard-info {
    font-size: 0.75rem;
  }
}

/* Grid pattern mobile optimization */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .grid button {
    aspect-ratio: 1/1;
    height: auto;
    min-height: 40px;
  }
  
  .beat-maker-wrap {
    padding-bottom: 10px;
  }
}

/* Fix for iOS Safari scrolling issues */
@supports (-webkit-overflow-scrolling: touch) {
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  .grid-container,
  .midi-keyboard,
  .section-tabs,
  .instrument-labels {
    -webkit-overflow-scrolling: touch;
  }
  
  .grid button {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Enhanced tap target sizes for iOS */
  @media (max-width: 768px) {
    .grid button {
      min-height: 48px;
    }
    
    .section-tab,
    .control-btn,
    .nav-btn {
      min-height: 48px;
    }
  }
}
