/* ==========================================================================
   Pedalera de efectos de guitarra/voz y amplificador en directo
   Estilos canónicos para fijate.com/tools/pedalera-efectos-guitarra-audio/
   ========================================================================== */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-page: #0d1117;
  --bg-card: #161b22;
  --bg-surface: #21262d;
  --bg-surface-hover: #30363d;
  --border-color: #30363d;
  --border-focus: #58a6ff;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;

  --primary: #238636;
  --primary-hover: #2ea043;
  --primary-text: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono {
  font-family: var(--font-mono);
}

.tool-layout {
  max-width: 1240px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

/* ================= BARRA DE ENTRADA Y MASTER ================= */
.audio-input-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.source-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 280px;
}

.bar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 40px;
  padding: 0 2.25rem 0 0.85rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
}

.select-compact {
  max-width: 320px;
}

.master-playback-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.15rem;
  height: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: #238636;
  color: #ffffff;
}

.btn-primary:hover {
  background: #2ea043;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
}

.btn-danger {
  background: #da3633;
  color: #ffffff;
}

.btn-danger:hover {
  background: #f85149;
}

.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
}

.btn-danger.recording .record-dot {
  background: #ffdd00;
  animation: blinkRec 1s infinite;
}

@keyframes blinkRec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ================= AFINADOR CROMÁTICO ================= */
.tuner-panel {
  background: #0f141c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.tuner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.tuner-note-display {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.tuner-target-note {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: #58a6ff;
  line-height: 1;
}

.tuner-cents {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.tuner-meter {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 24px;
  background: #1b212c;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.tuner-scale {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #238636;
}

.tuner-needle {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 6px;
  background: #58a6ff;
  border-radius: 3px;
  transform: translateX(-50%);
  transition: left 0.08s linear;
}

.tuner-freq {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ================= VISUALIZADOR OSCILOSCOPIO ================= */
.visualizer-container {
  position: relative;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

#scope-canvas {
  width: 100%;
  height: 120px;
  display: block;
}

.visualizer-badges {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.badge-status {
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
  border: 1px solid rgba(35, 134, 54, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-vol {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f6fc;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ================= PEDALERA INTERACTIVA ================= */
.pedalboard-container {
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text-main);
}

.pedals-rack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.pedal-chassis {
  background: #1f242c;
  border: 2px solid #38404d;
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.pedal-compressor { background: #1e3a5f; border-color: #2b5284; }
.pedal-overdrive { background: #14532d; border-color: #1e7e44; }
.pedal-distortion { background: #3b0764; border-color: #581c87; }
.pedal-chorus { background: #155e75; border-color: #0e7490; }
.pedal-delay { background: #713f12; border-color: #92400e; }
.pedal-reverb { background: #374151; border-color: #4b5563; }

.pedal-chassis.active {
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25), 0 8px 16px rgba(0, 0, 0, 0.6);
}

.pedal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.pedal-name {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.pedal-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.pedal-led.active {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444, inset 0 0 2px #fff;
}

.pedal-knobs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.knob-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.knob-wrap label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.knob-range {
  width: 100%;
  height: 5px;
  background: #0f172a;
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  accent-color: #f59e0b;
}

.knob-val {
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: right;
}

.footswitch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #cbd5e1 0%, #64748b 70%, #334155 100%);
  border: 3px solid #1e293b;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.footswitch:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ================= AMPLIFICADOR Y ECUALIZADOR ================= */
.amp-cab-section {
  background: #11151c;
  border: 2px solid #232936;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.amp-head {
  border-bottom: 2px solid #1e2430;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.amp-brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.amp-brand {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #d97706;
  text-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.amp-badge {
  font-size: 0.7rem;
  background: rgba(217, 119, 6, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(217, 119, 6, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.amp-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.85rem;
}

.eq-cab-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.eq-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.eq-faders-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.5rem;
  background: #090c12;
  border: 1px solid #1e2430;
  border-radius: var(--radius-sm);
  padding: 1rem 0.5rem;
}

.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.eq-freq {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #8b949e;
}

.eq-slider {
  width: 100%;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* ================= FAQ ================= */
.tool-faq-section {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
}

.faq-section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: var(--border-focus);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.faq-answer p {
  margin: 0;
}

/* ================= MODAL ================= */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.app-modal-backdrop.active {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.app-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.app-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.app-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.app-modal-body {
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.app-modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .card-main {
    padding: 0.85rem;
  }

  .audio-input-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .source-select-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .select-compact {
    max-width: 100%;
  }

  .master-playback-controls {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
    min-height: 44px;
  }

  .pedals-rack {
    grid-template-columns: 1fr;
  }

  .eq-faders-grid {
    grid-template-columns: repeat(5, 1fr);
    row-gap: 1rem;
  }
}
