/* 
 * Moveable & Strummable Guitar Chords - Visual Design System
 * Cyber Glassmorphism & Modern Web Aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(6, 182, 212, 0.4);

  --text-main: #f8fafc;
  --text-subtle: #cbd5e1;
  --text-muted: #64748b;

  --accent-cyan: #06b6d4;
  --accent-cyan-bright: #00f2fe;
  --accent-purple: #8b5cf6;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --gradient-brand: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6b21a8 100%);
  --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(6, 182, 212, 0.25), transparent 70%);

  --fret-nut-color: #e2e8f0;
  --fret-line-color: #334155;
  --string-color: #94a3b8;
  --root-dot-bg: #00f2fe;
  --note-dot-bg: #3b82f6;
  --barre-bg: rgba(6, 182, 212, 0.85);
  --muted-color: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.3);

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse at 10% 10%, rgba(6, 182, 212, 0.12), transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(139, 92, 246, 0.12), transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* Header & Banner */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 16px 24px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-logo svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 60%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Global Controls Bar */
.global-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  gap: 6px;
}

.control-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 6px;
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle.active {
  background: var(--accent-cyan);
  color: #0f172a;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* Root Picker Slider / Buttons */
.root-picker-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px;
  overflow-x: auto;
}

.btn-root-note {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-root-note:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-root-note.active {
  background: var(--accent-gold);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Main Container */
.main-wrapper {
  max-width: 1400px;
  margin: 28px auto 0;
  padding: 0 24px;
}

/* Banner / Rule Explainer Badge */
.rule-banner {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: blur(8px);
}

.rule-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-icon {
  width: 36px;
  height: 36px;
  background: rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan-bright);
  font-weight: 800;
  font-size: 1.1rem;
}

.rule-text p {
  font-size: 0.88rem;
  color: var(--text-subtle);
}

.rule-text strong {
  color: var(--accent-cyan-bright);
}

.rule-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.stat-pill span {
  color: var(--accent-cyan);
}

/* Filter Bar Section */
.filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
}

.filter-row-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-box input {
  width: 100%;
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 42px;
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.select-filter {
  background: rgba(9, 13, 22, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

.select-filter:focus {
  border-color: var(--accent-cyan);
}

/* Category Pills */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.pill-btn {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-glass);
  color: var(--text-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  background: rgba(51, 65, 85, 0.7);
  color: #fff;
}

.pill-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0284c7 100%);
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

/* Shape Group Sections (Accordion) */
.shape-group-section {
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.shape-group-section.is-expanded {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
  background: rgba(15, 23, 42, 0.65);
}

.shape-group-section.is-collapsed {
  border-color: var(--border-glass);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
  gap: 12px;
  outline: none;
}

.section-header:hover .section-header-titles h2 {
  color: var(--accent-cyan-bright);
}

.section-header-titles h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s ease;
}

.chevron-icon {
  display: inline-block;
  font-size: 0.95rem;
  color: var(--accent-gold);
  width: 18px;
}

.section-subtitle {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
  margin-left: 28px;
}

.header-right-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-action-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 0.2s ease;
}

.section-header:hover .toggle-action-label {
  color: var(--accent-cyan);
}

.group-count-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan-bright);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Accordion Grid Wrapper Animation */
.chord-grid-wrapper.closed {
  display: none;
}

.chord-grid-wrapper.open {
  display: block;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeInGrid 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInGrid {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chord Grid Display */
.chord-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Chord Card */
.chord-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.chord-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

@keyframes cardFlash {
  0% {
    transform: scale(0.97);
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  }
  100% {
    transform: scale(1);
    border-color: var(--border-glass);
    box-shadow: none;
  }
}

.card-re-rendered {
  animation: cardFlash 0.35s ease-out forwards;
}

.card-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chord-title-group h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.chord-title-group .transposed-name {
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.root-badge {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-gold);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.78rem;
}

.caged-badge {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* SVG Container */
.svg-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 8px 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.svg-wrapper:hover {
  transform: scale(1.02);
}

.chord-svg {
  max-width: 100%;
  height: auto;
}

/* Control Buttons (Toggles & Language) */
.btn-lang {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-lang:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
}

.btn-lang.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan-bright);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Card Actions / Footer */
.card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 10px;
}

.btn-info {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan-bright);
  width: 100%;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-info:hover {
  background: var(--accent-cyan);
  color: #0f172a;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}

/* Modal Overlay & Playing Tips Blocks */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-dark);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 26px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  scrollbar-width: thin;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(30, 41, 59, 0.7);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.6);
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-bottom: 2px;
  padding-right: 30px;
  color: var(--text-main);
}

/* Modal Display Mode Selector Bar */
.modal-display-mode-bar {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 4px;
  margin-top: 8px;
  width: fit-content;
}

.btn-modal-display {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-modal-display:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-modal-display.active {
  background: var(--accent-cyan);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.modal-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Playing Tips Blocks */
.tip-block {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-glass);
}

.tip-block-arpeggio {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.35);
}

.tip-block-easy {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.tip-block-sub {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
}

.tip-block-ergo {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(6, 182, 212, 0.3);
}

.tip-block-transitions {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.35);
}

.tip-block-tricks {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
}

.tip-block-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.tip-block-text {
  font-size: 0.85rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

.tip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip-item-arpeggio {
  font-size: 0.84rem;
  color: var(--accent-cyan-bright);
  font-weight: 600;
  line-height: 1.4;
}

.tip-item-simplification {
  font-size: 0.84rem;
  color: var(--accent-emerald);
  font-weight: 600;
  line-height: 1.4;
}

.tip-item-substitution {
  font-size: 0.84rem;
  color: #c084fc;
  font-weight: 600;
  line-height: 1.4;
}

.tip-item-transition {
  font-size: 0.84rem;
  color: #e879f9;
  font-weight: 600;
  line-height: 1.4;
}

.tip-item-embellishment {
  font-size: 0.84rem;
  color: var(--accent-gold);
  font-weight: 600;
  line-height: 1.4;
}

/* Interactive Clickable Tip Summary Cards */
.tip-card-interactive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  gap: 12px;
}

.tip-card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.tip-card-interactive:active {
  transform: translateY(0);
}

.tip-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.tip-card-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tip-card-text-summary {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.tip-card-action-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan-bright);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tip-card-interactive:hover .tip-card-action-badge {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
}

/* Sub-Modal Overlay (Level 2 Modal on top of Chord Inspector) */
.sub-modal-overlay {
  z-index: 2000 !important;
  background: rgba(2, 6, 23, 0.88) !important;
  backdrop-filter: blur(16px) !important;
}

.sub-modal-content {
  max-width: 620px !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(6, 182, 212, 0.3) !important;
  animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tip-badge-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Guitar TAB Visual Box */
.tab-display-box {
  background: #090d16;
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
}

.tab-display-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.tab-code {
  font-family: 'Consolas', 'Courier New', 'JetBrains Mono', monospace;
  font-size: 0.94rem;
  color: #38bdf8;
  line-height: 1.45;
  white-space: pre;
  margin: 0;
}

.tab-code .tab-line-name {
  color: var(--accent-gold);
  font-weight: bold;
}

/* Detailed Walkthrough List inside Sub-modal */
.tip-detail-section {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.tip-detail-section h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-detail-section p {
  font-size: 0.88rem;
  color: var(--text-subtle);
  line-height: 1.55;
  margin-bottom: 10px;
}

.tip-step-list {
  padding-left: 20px;
  margin: 8px 0;
}

.tip-step-list li {
  font-size: 0.86rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Key Fit & Diatonic Context Block */
.key-usage-block {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.key-badges-flex {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.key-badge-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  user-select: none;
}

.key-badge-btn:hover {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.key-badge-btn .key-tag-degree {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Diatonic 7 Scale Degree Modal Content */
.diatonic-modal-content {
  max-width: 960px !important;
  width: 95% !important;
}

.diatonic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.scale-degree-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.25s ease;
  cursor: pointer;
}

.scale-degree-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(6, 182, 212, 0.3);
}

.scale-degree-card.is-current-chord {
  border-color: var(--accent-gold);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

.degree-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.degree-roman-tag {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan-bright);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.degree-roman-tag.tonic {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.5);
}

.degree-roman-tag.dominant {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.5);
}

.fret-dist-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.fret-dist-badge.far {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-subtle);
  border-color: rgba(148, 163, 184, 0.3);
}

.degree-chord-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  text-align: center;
}

.degree-shape-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

/* Responsive adjust */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .global-controls {
    justify-content: space-between;
  }
  .rule-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .toggle-action-label {
    display: none;
  }
  .modal-content {
    padding: 18px 20px;
    max-height: 92vh;
  }
  .diatonic-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* Multi-Shape Cycler Nav Bar inside Diatonic Cards */
.degree-shape-cycler {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  margin: 6px 0;
  user-select: none;
}

.btn-shape-nav {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan-bright);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-shape-nav:hover {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

.btn-shape-nav:active {
  transform: scale(0.95);
}

.shape-counter-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
}

.shape-counter-badge .counter-num {
  color: var(--accent-gold);
}

.shape-counter-badge .caged-tag {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
}

.degree-card-footer-action {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-cyan-bright);
  margin-top: 6px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.scale-degree-card:hover .degree-card-footer-action {
  opacity: 1;
  text-decoration: underline;
}

/* Stacked Modal Level 3 (Inspector on top of Diatonic Map Modal) */
.modal-overlay.stacked-on-diatonic {
  z-index: 3000 !important;
  background: rgba(2, 6, 23, 0.9) !important;
  backdrop-filter: blur(20px) !important;
}

.btn-back-to-diatonic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #c084fc;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-back-to-diatonic:hover {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: #c084fc;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.5);
  transform: translateX(-3px);
}



