/* ==========================================================================
   SMART LOOPER & SPEED TRAINER
   ========================================================================== */

.modal-looper-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-looper-card {
  background: var(--bg-surface-raised, #16171d);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  color: var(--text-primary, #f0f0f5);
  animation: looperPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes looperPop {
  0% { transform: scale(0.96) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.looper-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.looper-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.looper-modal-title {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.looper-modal-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #94a3b8);
}

.btn-close-looper {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-secondary, #94a3b8);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-looper:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.looper-modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.looper-section-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px 20px;
}

.section-card-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f0f5;
}

.looper-bars-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.bar-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.bar-input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
}

.stepper-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
}

.btn-step-bar {
  width: 40px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-primary, #f0f0f5);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-step-bar:hover {
  background: rgba(255, 255, 255, 0.2);
}

.bar-num-input {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: monospace;
}

.looper-arrow-sep {
  font-size: 1.4rem;
  color: #10b981;
  padding-top: 18px;
}

.looper-quick-bars {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-bars-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
}

.btn-quick-bars {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #f0f0f5);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-bars:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Speed Trainer */
.trainer-active {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.04);
}

.trainer-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trainer-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
}

.trainer-speeds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 540px) {
  .trainer-speeds-grid {
    grid-template-columns: 1fr;
  }
}

.speed-pill-selector {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.btn-speed-pill,
.btn-target-pill {
  flex: 1;
  padding: 6px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-speed-pill.active,
.btn-target-pill.active {
  background: #10b981;
  color: #0f172a;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* Status Display */
.looper-status-display {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #64748b;
}

.status-indicator.running {
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  animation: pulseRunning 1.2s infinite alternate;
}

@keyframes pulseRunning {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 1; }
}

.status-meta {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.status-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
}

/* Footer */
.looper-modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.btn-looper-action {
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-looper-action.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f0f0f5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-looper-action.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-looper-action.primary {
  background: #10b981;
  color: #0f172a;
  border: none;
}

.btn-looper-action.primary.is-active {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.btn-looper-action.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
