/* 
   Worship Pads Standalone Stylesheet
*/

:root {
  --bg-1: #0b0f1a; 
  --bg-2: #111827; 
  --bg-3: #1a2035; 
  --bg-4: #232b42;
  
  --border: #ffffff14; 
  --border-med: #ffffff22;
  --border-light: rgba(255, 255, 255, 0.05);
  
  --primary: #3b82f6; 
  --primary-hover: #60a5fa; 
  --primary-glow: rgba(59, 130, 246, .3); 
  --primary-rgb: 59, 130, 246;
  
  --accent: #8b5cf6;  
  --accent-glow: rgba(139, 92, 246, .3);
  --accent-rgb: 139, 92, 246;
  
  --green: #10b981; 
  --red: #ef4444; 
  --amber: #f59e0b;
  
  --text-1: #e2e8f0; 
  --text-2: #94a3b8; 
  --text-3: #64748b;
  
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 12px; 
  --radius-sm: 8px;
}

body.light-mode {
  --bg-1: #f8fafc; 
  --bg-2: #ffffff; 
  --bg-3: #f1f5f9; 
  --bg-4: #e2e8f0;
  
  --border: #e2e8f0; 
  --border-med: #cbd5e1;
  --border-light: rgba(0, 0, 0, 0.05);
  
  --primary: #2563eb; 
  --primary-hover: #1d4ed8; 
  --primary-glow: rgba(37, 99, 235, .2);
  --primary-rgb: 37, 99, 235;
  
  --accent: #7c3aed; 
  --accent-glow: rgba(124, 58, 237, .2);
  --accent-rgb: 124, 58, 237;
  
  --text-1: #0f172a; 
  --text-2: #475569; 
  --text-3: #64748b;
}

body {
  font-family: var(--font);
  background-color: var(--bg-1) !important;
  color: var(--text-1);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Container */
.pads-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 100px 20px 80px;
}

/* Grid Layouts */
.pads-grid-top {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.pads-grid-bottom {
  display: grid;
  grid-template-columns: 13fr 7fr;
  gap: 24px;
}

@media (max-width: 992px) {
  .pads-grid-top {
    grid-template-columns: 1fr;
  }
  .pads-grid-bottom {
    grid-template-columns: 1fr;
  }
}

.pads-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pads-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-med);
  padding-bottom: 10px;
  margin-bottom: 2px;
}

/* Worship Pads Key Buttons (Chords keyboard) */
.worship-pads-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.worship-pad-btn {
  border: 1px solid var(--border-med);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    2px 2px 5px rgba(0,0,0,0.2), 
    inset 0 1px 1px rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.worship-pad-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.worship-pad-btn:hover {
  transform: translateY(-1px);
  box-shadow: 
    3px 4px 8px rgba(0,0,0,0.25), 
    inset 0 1px 1px rgba(255,255,255,0.1);
}

.worship-pad-btn:hover::after {
  opacity: 1;
}

.worship-pad-btn.active {
  background: linear-gradient(145deg, var(--primary), var(--primary-hover)) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 
    inset 1px 1px 6px rgba(0,0,0,0.3), 
    0 0 12px var(--primary-glow) !important;
  transform: translateY(0.5px);
}

/* Accidentals vs Naturals Piano Color Scheme */
.pad-key-nat {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.1), 
    inset 0 1px 0 #ffffff;
}

.pad-key-nat:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.pad-key-acc {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #0f172a !important;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.pad-key-acc:hover {
  background: #0f172a !important;
  border-color: #000000 !important;
  color: #ffffff !important;
}

body.light-mode .worship-pad-btn.pad-key-nat {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .worship-pad-btn.pad-key-acc {
  background: #334155 !important;
  color: #ffffff !important;
  border-color: #1e293b !important;
}

/* # and b switch styles to fix the dark/light mode issues */
.pad-label-toggle {
  background: transparent !important;
  border: none !important;
  color: var(--text-2) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: bold;
}

.pad-label-toggle:hover {
  color: var(--text-1) !important;
}

.pad-label-toggle.active {
  background: var(--primary) !important;
  color: #ffffff !important;
}

/* EQ Faders (Vertical) */
.eq-gain-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 10px !important;
  height: 120px !important;
  margin: 0 auto;
}

/* Custom range sliders styling */
input[type=range] {
  -webkit-appearance: none;
  background: transparent;
  outline: none;
  width: 100%;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: var(--border-med);
  border-radius: 2px;
}

input[type=range]::-moz-range-track {
  width: 100%;
  height: 4px;
  background: var(--border-med);
  border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  box-shadow: 0 2px 5px rgba(0,0,0,0.4), inset 0 0 0 1px var(--primary);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  position: relative;
}
input[type=range]:active::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: 0 3px 6px rgba(0,0,0,0.5), inset 0 0 0 2px var(--primary);
}

/* EQ chart container */
#pads-eq-chart {
  width: 100%;
  height: 110px;
  background: var(--bg-3);
  border-radius: 8px;
  border: 1px solid var(--border-med);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

/* MIDI Monitor Console */
.midi-monitor-console {
  height: 110px;
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Modals Overlay (Fix for popup modal) */
.modal-overlay {
  display: none; 
  position: fixed; 
  inset: 0; 
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7); 
  backdrop-filter: blur(10px); 
  -webkit-backdrop-filter: blur(10px);
  justify-content: center; 
  align-items: center;
  padding: 15px;
}

.modal-overlay.open { 
  display: flex; 
}

.modal-content {
  background: var(--bg-2); 
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  width: 100%; 
  max-width: 680px; 
  max-height: 90vh;
  display: flex; 
  flex-direction: column; 
  overflow: hidden;
  animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-body {
  padding: 20px; 
  overflow-y: auto; 
  flex: 1;
}

body.light-mode .modal-content {
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0,0,0,0.15);
}

body.light-mode .modal-body {
  background: #f1f5f9;
}

/* MIDI Table styling */
.midi-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.midi-ref-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid var(--border-med);
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.midi-ref-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-1);
}

.midi-ref-row.active-test {
  background: rgba(34, 197, 94, 0.15) !important;
  color: var(--text-1) !important;
}

/* Knobs controls */
.dial-knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  cursor: ns-resize;
  position: relative;
  width: 50px;
}

.dial-tick-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  pointer-events: none;
}

.dial-knob {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #5a5f70 0%, #2c2f3a 45%, #1a1c24 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 -1px 0 rgba(0,0,0,0.6) inset,
    0 4px 12px rgba(0,0,0,0.7),
    0 1px 3px rgba(0,0,0,0.5),
    0 0 0 1.5px rgba(255,255,255,0.06);
  position: relative;
  margin: 0 auto;
  transition: box-shadow 0.2s, transform 0.12s;
}

.dial-knob:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 -1px 0 rgba(0,0,0,0.6) inset,
    0 6px 16px rgba(0,0,0,0.75),
    0 0 0 1.5px rgba(var(--primary-rgb), 0.35),
    0 0 10px rgba(var(--primary-rgb), 0.25);
  transform: scale(1.04);
}

.dial-knob.knob-active {
  transform: scale(1.07);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 -1px 0 rgba(0,0,0,0.6) inset,
    0 6px 16px rgba(0,0,0,0.8),
    0 0 0 1.5px var(--primary),
    0 0 14px var(--primary-glow);
}

.dial-knob-cap {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3c3f4d 0%, #23252f 55%, #16181f 100%);
  box-shadow:
    0 1px 3px rgba(255,255,255,0.08) inset,
    0 2px 5px rgba(0,0,0,0.6) inset;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.dial-indicator {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.dial-indicator-dot {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5px;
  height: 8px;
  background: linear-gradient(to bottom, #fff 0%, var(--primary) 60%);
  border-radius: 2px;
  box-shadow: 0 0 5px 1px var(--primary-glow), 0 0 2px #fff;
}

.dial-value {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2);
  font-family: monospace;
  pointer-events: none;
  text-align: center;
  min-width: 32px;
  margin-top: 6px;
}

.knob-dragging {
  cursor: ns-resize !important;
  user-select: none;
}

/* Control Mode Toggles logic */
body.use-knobs .modal-slider:not(.always-knob) {
  display: none !important;
}

body.use-knobs .slider-val-bubble {
  display: none !important;
}

body:not(.use-knobs) .dial-knob-wrap:not(.always-knob-wrap) {
  display: none !important;
}

input.always-knob {
  display: none !important;
}

input.always-knob + .dial-knob-wrap {
  display: inline-flex !important;
}

/* General Layout adjustments */
.slider-val-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 24px;
}

.slider-val-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 38px !important;
  height: 24px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.slider-val-wrap input[type=range]::-moz-range-thumb {
  width: 38px !important;
  height: 24px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.slider-val-bubble {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: center;
  min-width: 38px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.15) inset;
  border: 1px solid rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  font-family: monospace;
  transition: left 0.1s cubic-bezier(0.2, 0, 0, 1), transform 0.1s ease, background 0.2s ease;
  z-index: 5;
  display: block;
}

.slider-val-wrap input[type=range]:active ~ .slider-val-bubble {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  transform: translate(-50%, -50%) scale(1.08);
}

body.use-knobs .slider-val-bubble {
  display: none !important;
}

.ctrl-row {
  width: 100%;
  margin-bottom: 8px;
}

.ctrl-label-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
}

body.use-knobs .ctrl-row {
  text-align: center;
}

body.use-knobs .ctrl-label-row {
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

body.use-knobs .val-display {
  display: none !important;
}

/* Vertical slider overlay labels */
.vertical-slider-wrap {
  position: relative;
  width: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.vertical-slider-wrap input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 100% !important;
  writing-mode: vertical-lr;
  direction: rtl; /* Bottom to top */
  cursor: pointer;
  margin: 0;
  padding: 0;
}

/* Style the track */
.vertical-slider-wrap input[type=range]::-webkit-slider-runnable-track {
  width: 8px;
  height: 100%;
  background: var(--bg-3) !important;
  border-radius: 4px;
  border: 1px solid var(--border-med) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

/* Style the thumb (make it transparent, we will use our overlay label as the thumb) */
.vertical-slider-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 24px !important;
  width: 38px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  margin-top: 0;
}

/* Firefox support */
.vertical-slider-wrap input[type=range]::-moz-range-track {
  width: 8px;
  height: 100%;
  background: var(--bg-3) !important;
  border-radius: 4px;
  border: 1px solid var(--border-med) !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.vertical-slider-wrap input[type=range]::-moz-range-thumb {
  height: 24px !important;
  width: 38px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

/* Our premium overlay thumb label */
.slider-thumb-label {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; /* Let all events pass to the range input beneath! */
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: center;
  min-width: 38px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.15) inset;
  border: 1px solid rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  font-family: monospace;
  transition: transform 0.1s ease, background 0.2s ease;
}

.vertical-slider-wrap input[type=range]:active + .slider-thumb-label {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  transform: translate(-50%, -50%) scale(1.08);
}

/* Listening buttons and Learn Mode elements (Dark Mode Optimization) */
.btn-learn-param {
  background: transparent !important;
  border: none !important;
  color: var(--text-3) !important;
  padding: 2px 4px !important;
  margin-left: 4px !important;
  cursor: pointer;
  font-size: 0.72rem !important;
  transition: all 0.15s ease-in-out;
  border-radius: 4px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.btn-learn-param:hover {
  color: var(--primary) !important;
  background: rgba(139, 92, 246, 0.15) !important;
}

.btn-learn-param.active {
  color: #fff !important;
  background: var(--accent) !important;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: param-pulse-glow 1.5s infinite alternate;
}

#btn-learn-modifier {
  transition: all 0.2s ease-in-out;
  position: relative;
}

#btn-learn-modifier:hover {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

#btn-learn-modifier.active {
  background: var(--amber) !important;
  color: #000 !important;
  border-color: var(--amber) !important;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
  animation: key-pulse-glow 1.5s infinite alternate;
}

@keyframes param-pulse-glow {
  0% { box-shadow: 0 0 4px var(--accent-glow); }
  100% { box-shadow: 0 0 10px var(--accent-glow), 0 0 2px #fff; }
}

@keyframes key-pulse-glow {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.8), 0 0 4px #fff; }
}

/* Toast Messages */
.toast {
  position:fixed; bottom:20px; right:20px; z-index:99999;
  padding:10px 16px; border-radius:var(--radius); color:#fff;
  font:600 .84rem var(--font); opacity:0; transform:translateY(14px);
  transition:opacity .26s, transform .26s;
  box-shadow:0 6px 20px rgba(0,0,0,.45); pointer-events:none;
  max-width:300px; display:flex; align-items:center; gap:8px;
}
.toast.show { opacity:1; transform:translateY(0); }

/* Tabs for Pads page */
.pads-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-med);
  padding-bottom: 8px;
}

.pads-tab {
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pads-tab:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.03);
}

body.light-mode .pads-tab:hover {
  background: rgba(0, 0, 0, 0.03);
}

.pads-tab.active {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
  transform: scale(1.03);
  animation: tab-active-bounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tab-active-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1.03); }
}

.pads-tab-content {
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.995);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.pads-tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Beautiful keyboard key press animation and pulse glow */
.worship-pad-btn.active {
  background: linear-gradient(145deg, var(--primary), var(--primary-hover)) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  transform: translateY(1px);
  animation: active-key-pulse 1.4s infinite alternate, key-press-bounce 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes key-press-bounce {
  0% { transform: scale(1) translateY(0); }
  45% { transform: scale(0.96) translateY(2.5px); }
  100% { transform: scale(1) translateY(1px); }
}

@keyframes active-key-pulse {
  0% {
    box-shadow: 
      inset 1px 1px 6px rgba(0,0,0,0.3), 
      0 0 8px rgba(139, 92, 246, 0.5) !important;
  }
  100% {
    box-shadow: 
      inset 1px 1px 6px rgba(0,0,0,0.3), 
      0 0 22px rgba(139, 92, 246, 0.85),
      0 0 6px rgba(255,255,255,0.3) !important;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  /* Irregular spacing fix */
  .pads-container {
    padding: 95px 12px 60px !important;
  }
  .pads-container > div:first-of-type {
    margin-bottom: 1.25rem !important;
    gap: 12px !important;
  }
  .pads-container h1 {
    font-size: 1.45rem !important;
  }
  .pads-container p {
    font-size: 0.85rem !important;
    margin-top: 2px !important;
  }
  
  .pads-tabs {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 6px !important;
    margin-bottom: 15px !important;
    padding-bottom: 6px !important;
    width: 100% !important;
  }
  
  .pads-tab {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px 6px !important;
    font-size: 0.82rem !important;
    border-radius: 6px !important;
    gap: 4px !important;
  }
  
  /* Show only icons on inactive tabs, show text label on active tab */
  .pads-tab span {
    display: none !important;
  }
  .pads-tab.active span {
    display: inline !important;
  }
  
  .pads-grid-top, .pads-grid-bottom {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
}

/* Flex row layout for centered squaricle buttons */
.pads-flex-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.worship-pad-btn {
  width: 75px;
  height: 75px;
  aspect-ratio: 1 / 1 !important;
  border-radius: 16px !important; /* Premium Squaricle shape */
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  flex: 0 0 75px !important;
  min-height: unset !important;
}

@media (max-width: 768px) {
  .pads-flex-row {
    gap: 8px;
  }
  .worship-pad-btn {
    width: 58px;
    height: 58px;
    flex: 0 0 58px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
  }
}

@media (max-width: 420px) {
  .pads-flex-row {
    gap: 6px;
  }
  .worship-pad-btn {
    width: 48px;
    height: 48px;
    flex: 0 0 48px !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
  }
}

/* Local audio file override indicator dot */
.worship-pad-btn.has-local-override::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #10b981 !important; /* Glowing emerald green */
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981, 0 0 2px #fff;
  z-index: 5;
}

/* PWA Onboarding Modal Styles */
.onboarding-content {
  max-width: 500px;
  background: var(--bg-2);
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
}

.onboarding-slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}

.onboarding-slides::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.onboarding-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 30px;
  box-sizing: border-box;
}

.onboarding-slide .hero-icon {
  font-size: 4.5rem;
  color: var(--primary);
  margin-bottom: 24px;
  filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.4));
  animation: pulseGlow 2s infinite ease-in-out;
}

.onboarding-slide h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: var(--text-1);
}

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

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.onboarding-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-med);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

.onboarding-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px 25px 30px;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.65)); }
}

/* MIDI Status LED & Tooltip */
.midi-led-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 2px;
}

.midi-led {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.midi-led.red {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.midi-led.yellow {
  background-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.midi-led.green {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.midi-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-1);
  color: var(--text-1);
  text-align: left;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-med);
  z-index: 1000;
  width: 220px;
  font-size: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  font-weight: normal;
  text-transform: none;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.midi-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--bg-1) transparent transparent transparent;
}

.midi-led-wrapper:hover .midi-tooltip,
.midi-led-wrapper:focus-within .midi-tooltip,
.midi-led-wrapper.show-tooltip .midi-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Toggle Switch Styling */
.switch-wrap {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-3);
  border: 1px solid var(--border-med);
  transition: .3s;
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-2);
  transition: .3s;
  border-radius: 50%;
}

.switch-wrap input:checked + .switch-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.switch-wrap input:checked + .switch-slider:before {
  transform: translateX(16px);
  background-color: #ffffff;
}

/* Responsive grid layouts and aligned mapping icons */
.ctrl-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: center;
}

.ctrl-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.ctrl-label-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

body.use-knobs .ctrl-label-row {
  flex-direction: row !important;
  justify-content: center !important;
}

@media (max-width: 600px) {
  .ctrl-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mapping Mode visual indicators */
.local-mapped-badge.active-mapping-target {
  background: var(--bg-1) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 10px var(--accent-glow) !important;
  animation: mapping-pulse 1s infinite alternate;
}

.worship-pad-btn.waiting-for-map {
  border-color: var(--primary) !important;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.2);
  animation: mapping-pulse-pads 1.5s infinite alternate;
}

@keyframes mapping-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes mapping-pulse-pads {
  0% { box-shadow: 0 0 2px rgba(139, 92, 246, 0.2); }
  100% { box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
}

/* Help page responsive columns */
.help-grid-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .help-grid-wrap {
    grid-template-columns: 1fr !important;
  }
}


