/* ============================================================
   Chord Inversion Tool — Styles
   FrequencyDetector.com
   ============================================================ */

/* Selectors Row */
.cit-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: flex-end;
  margin-bottom: var(--space-md);
}

.cit-selector-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 160px;
}

.cit-selector-group--btn {
  flex: 0 0 auto;
  min-width: auto;
  justify-content: flex-end;
}

.cit-selector-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

/* Chord Summary */
.cit-summary {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  margin-bottom: var(--space-md);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  background: rgba(0, 255, 65, 0.04);
}

.cit-summary__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.cit-summary__notes {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  color: var(--color-text);
  margin-top: var(--space-xs);
  letter-spacing: 0.05em;
}

.cit-summary__formula {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

/* Inversions Grid */
.cit-inversions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* Inversion Card */
.cit-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.cit-card:hover {
  border-color: rgba(0, 255, 65, 0.3);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.08);
}

.cit-card--playing {
  border-color: var(--color-primary);
  box-shadow: 0 0 24px rgba(0, 255, 65, 0.2);
}

/* Card Header */
.cit-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.cit-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-secondary);
  line-height: 1.2;
}

.cit-card__slash {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 900;
  color: var(--color-primary);
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.3);
}

/* Notes List */
.cit-card__notes {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.03em;
}

.cit-card__notes-label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 2px;
}

/* Mini Piano Container */
.cit-card__piano {
  position: relative;
  height: 80px;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  padding: 6px;
}

/* Frequency Table */
.cit-card__freq-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 11px;
}

.cit-card__freq-table th {
  text-align: left;
  color: var(--color-text-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.cit-card__freq-table td {
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cit-card__freq-table .cit-note-cell {
  color: var(--color-text);
  font-weight: 600;
}

.cit-card__freq-table .cit-note-cell--bass {
  color: var(--color-secondary);
  font-weight: 700;
}

.cit-card__freq-table .cit-freq-cell {
  color: var(--color-primary);
}

.cit-card__freq-table .cit-interval-cell {
  color: var(--color-text-muted);
}

/* Play Button */
.cit-card__play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px var(--space-sm);
  background: transparent;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  margin-top: auto;
}

.cit-card__play:hover {
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.15);
}

.cit-card__play:active {
  background: rgba(0, 255, 65, 0.2);
}

.cit-card__play--playing {
  background: rgba(0, 255, 65, 0.15);
  color: #fff;
}

/* Mini Piano Keys (HTML div-based) */
.cit-piano-keys {
  display: flex;
  position: relative;
  height: 100%;
  width: 100%;
}

.cit-piano-white {
  flex: 1;
  height: 100%;
  background: linear-gradient(180deg, #f0f0f0 0%, #ffffff 15%, #e8e8e8 100%);
  border: 1px solid #999;
  border-radius: 0 0 3px 3px;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.cit-piano-white--active {
  background: linear-gradient(180deg, #00cc33 0%, #00ff41 15%, #00dd38 100%);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
  border-color: #00aa2a;
}

.cit-piano-white--bass {
  background: linear-gradient(180deg, #00a0cc 0%, #00e5ff 15%, #00c0dd 100%);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  border-color: #0088aa;
}

.cit-piano-black {
  width: 12px;
  height: 58%;
  background: linear-gradient(180deg, #333 0%, #1a1a1a 100%);
  border: 1px solid #000;
  border-radius: 0 0 3px 3px;
  position: absolute;
  z-index: 2;
  top: 0;
}

.cit-piano-black--active {
  background: linear-gradient(180deg, #00aa33 0%, #008828 100%);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
  border-color: #006619;
}

.cit-piano-black--bass {
  background: linear-gradient(180deg, #0088aa 0%, #006688 100%);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
  border-color: #004466;
}

.cit-piano-note-label {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 7px;
  color: #555;
  pointer-events: none;
  white-space: nowrap;
}

.cit-piano-white--active .cit-piano-note-label,
.cit-piano-white--bass .cit-piano-note-label {
  color: #003300;
  font-weight: 700;
}

/* Voice Leading Section */
.cit-voice-leading {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  margin-bottom: var(--space-md);
}

.cit-voice-leading__content {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text);
  line-height: 1.7;
}

.cit-voice-leading__item {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cit-voice-leading__item:last-child {
  border-bottom: none;
}

.cit-voice-leading__label {
  color: var(--color-secondary);
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.cit-voice-leading__tip {
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
}

/* Voice Leading Arrow */
.cit-voice-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) 0;
}

.cit-voice-arrow__icon {
  font-size: var(--fs-lg);
  color: var(--color-primary);
  opacity: 0.5;
}

/* Export Actions */
.export-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.btn--sm {
  padding: 6px 12px;
  font-size: var(--fs-xs);
}

/* Keyboard Hints */
.kbd-hints {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .cit-inversions-grid {
    grid-template-columns: 1fr;
  }

  .cit-selectors {
    flex-direction: column;
  }

  .cit-selector-group {
    min-width: 100%;
  }

  .cit-summary__name {
    font-size: 2rem;
  }

  .cit-card__piano {
    height: 65px;
  }
}

@media (max-width: 480px) {
  .cit-summary__name {
    font-size: 1.6rem;
  }

  .cit-card {
    padding: var(--space-sm);
  }

  .cit-card__freq-table {
    font-size: 10px;
  }

  .cit-card__piano {
    height: 56px;
  }
}
