/* ============================================================
   Chord Progression Generator — page-specific styles
   Dark theme, uses design tokens from /css/styles.css
   ============================================================ */

.cprog-page {
  --bg: #0C1A14;
  --bg-card: #12251B;
  --bg-card-border: #1F4B34;
  --text: #E8F5EE;
  --text-dim: #7CA88E;
  --accent: #10B981;
  --accent-hover: #059669;
  --red: #EF4444;
  --slot-bg: #183026;
  --slot-border: #2A5E42;
  --highlight: rgba(16, 185, 129, 0.15);
}

/* ── Layout ── */
.cprog-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  background: var(--bg);
  min-height: 100vh;
}

body:has(.cprog-page) { background: #0C1A14; }
body:has(.cprog-page) .nav { background: rgba(12, 26, 20, 0.92); border-bottom-color: #1F4B34; }
body:has(.cprog-page) .nav__menu a { color: #7CA88E; }
body:has(.cprog-page) .nav__menu a:hover,
body:has(.cprog-page) .nav__menu a.active { color: #10B981; }
body:has(.cprog-page) .footer { background: #0A1610; color: #7CA88E; }
body:has(.cprog-page) .footer h4 { color: #E8F5EE; }
body:has(.cprog-page) .footer a { color: #7CA88E; }
body:has(.cprog-page) .footer a:hover { color: #10B981; }
body:has(.cprog-page) .footer__bottom { border-top-color: #1F4B34; color: #5A8A6E; }
body:has(.cprog-page) .footer__brand p,
body:has(.cprog-page) .footer .loc { color: #5A8A6E; }

.cprog-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}
.cprog-page .page-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 32px;
  text-align: center;
}
.cprog-page .page-subtitle strong { color: var(--text); font-weight: 500; }

/* ── Card ── */
.cp-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Controls ── */
.cp-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.cp-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-weight: 500;
}
.cp-ctrl--toggle {
  cursor: pointer;
  user-select: none;
}
.cp-ctrl--toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.cp-select {
  appearance: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237CA88E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.cp-select:focus { outline: none; border-color: var(--accent); }
.cp-select--wide { min-width: 200px; }
.cp-input--sm {
  width: 60px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  text-align: center;
}
.cp-input--sm:focus { outline: none; border-color: var(--accent); }
.cp-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--bg-card-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.cp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.cp-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* ── Sections ── */
.cp-section {
  margin-bottom: 24px;
}
.cp-section__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ── Diatonic Chords ── */
.cp-diatonic {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cp-diatonic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--slot-bg);
  border: 1px solid var(--slot-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 72px;
  color: var(--text);
  font-family: var(--font-body);
}
.cp-diatonic-btn:hover {
  border-color: var(--accent);
  background: var(--highlight);
}
.cp-diatonic-btn__numeral {
  font-size: 0.6875rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-weight: 600;
}
.cp-diatonic-btn__name {
  font-size: 1rem;
  font-weight: 600;
}

/* ── Progression Slots ── */
.cp-slots-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cp-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-height: 56px;
  padding: 8px;
  background: var(--bg);
  border: 1px dashed var(--bg-card-border);
  border-radius: var(--radius);
}
.cp-slots:empty::after {
  content: 'Click diatonic chords above or choose a preset to add chords here';
  color: var(--text-dim);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  padding: 0 8px;
  opacity: 0.6;
}
.cp-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--slot-bg);
  border: 1px solid var(--slot-border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.cp-slot:hover {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}
.cp-slot:hover::after {
  content: '\00d7';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--red);
  color: #fff;
  font-size: 0.6875rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cp-slot.highlight {
  border-color: var(--accent);
  background: var(--highlight);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
.cp-slot__numeral {
  font-size: 0.625rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.cp-btn--add {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--slot-bg);
  border: 1px dashed var(--slot-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  display: none; /* hidden for now, chords added via diatonic buttons */
}

.cp-slot-actions {
  display: flex;
  gap: 10px;
}
.cp-btn--ghost {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-family: var(--font-body);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.cp-btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Transport Bar ── */
.cp-transport {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--bg-card-border);
}
.cp-btn--play,
.cp-btn--stop {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.cp-btn--play {
  background: var(--accent);
  color: #fff;
}
.cp-btn--play:hover { background: var(--accent-hover); }
.cp-btn--play.playing { background: var(--accent-hover); }
.cp-btn--stop {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-dim);
}
.cp-btn--stop:hover { border-color: var(--red); color: var(--red); }
.cp-status {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-left: auto;
}
.cp-status.playing { color: var(--accent); }

/* ── Chord Diagrams Card ── */
.cp-diagrams-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
}
.cp-diagrams {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.cp-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  min-width: 100px;
}
.cp-diagram__name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}
.cp-diagram__numeral {
  font-size: 0.625rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.cp-diagram svg {
  color: var(--text);
}

/* ── Info Sections ── */
.cp-info {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-top: 20px;
  color: var(--text);
}
.cp-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-bottom: 16px;
  color: var(--text);
}
.cp-info ol {
  padding-left: 20px;
  color: var(--text-dim);
  line-height: 1.8;
}
.cp-info ol strong { color: var(--text); font-weight: 500; }
.cp-info p {
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 12px;
}
.cp-info p:last-child { margin-bottom: 0; }
.cp-info p strong { color: var(--text); font-weight: 500; }
.cp-info--links p { font-size: 0.9375rem; }
.cp-info a { color: var(--accent); text-decoration: none; }
.cp-info a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .cprog-page { padding: 32px 16px 64px; }
  .cp-card { padding: 16px; }
  .cp-controls { gap: 10px; }
  .cp-diatonic { gap: 6px; }
  .cp-diatonic-btn { min-width: 60px; padding: 10px 12px; }
  .cp-transport { gap: 8px; }
}

@media (max-width: 480px) {
  .cp-controls { flex-direction: column; align-items: stretch; }
  .cp-ctrl { justify-content: space-between; }
  .cp-select { flex: 1; }
  .cp-select--wide { min-width: unset; }
  .cp-transport { flex-direction: column; align-items: stretch; }
  .cp-transport .cp-ctrl { justify-content: space-between; }
  .cp-btn--play, .cp-btn--stop { width: 100%; border-radius: var(--radius-sm); height: 44px; }
  .cp-status { margin-left: 0; text-align: center; }
  .cp-diagrams { justify-content: center; }
}
