/* ---- Fretboard Tool ---- */
/* Override tool-page max-width for full-width layout */
.ft-page { max-width: 100%; }

.ft-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 0.8rem;
  align-items: center;
}

/* Transpose slider */
.ft-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ft-root-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #7cb8ff;
  min-width: 56px;
  text-align: center;
  line-height: 1.6;
  height: calc(1.1rem * 1.6);
  overflow: hidden;
}
.ft-root-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 6px;
  border-radius: 10px;
  background: #2a2d3a;
  outline: none;
  cursor: pointer;
}
.ft-root-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #2a6cb0;
  cursor: pointer;
  border: 2px solid #7cb8ff;
}
.ft-root-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #2a6cb0;
  cursor: pointer;
  border: 2px solid #7cb8ff;
}

/* Category / instrument dropdowns */
.ft-select {
  background: #1a1d27;
  color: #ccc;
  border: 1.5px solid #2a2d3a;
  border-radius: 10px;
  padding: 8px 32px 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  transition: border-color 0.15s;
}
.ft-select:hover, .ft-select:focus {
  border-color: #3a3d4a;
  color: #fff;
}

/* Audio button wave animations */
.ft-audio-btn .ft-audio-wave1 { opacity: 0.3; }
.ft-audio-btn .ft-audio-wave2 { opacity: 0.15; }
.ft-audio-btn:hover .ft-audio-wave1 { opacity: 0.8; }
.ft-audio-btn:hover .ft-audio-wave2 { opacity: 0.5; }

/* CAGED / Box shape toggle buttons (below fretboard) */
.ft-shape-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 4px;
}
.ft-shape-toggles {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.ft-shape-btn {
  width: 38px; height: 28px;
  border-radius: 10px;
  border: 2px solid;
  background: transparent;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  opacity: 1;
}
.ft-shape-btn.off {
  opacity: 0.25;
  background: transparent !important;
}
.ft-shape-btn[data-shape="C"]     { border-color: #aa82d2; color: #aa82d2; }
.ft-shape-btn[data-shape="C"].on  { background: rgba(170,130,210,0.2); }
.ft-shape-btn[data-shape="A"]     { border-color: #e6828c; color: #e6828c; }
.ft-shape-btn[data-shape="A"].on  { background: rgba(230,130,140,0.2); }
.ft-shape-btn[data-shape="G"]     { border-color: #f0b45a; color: #f0b45a; }
.ft-shape-btn[data-shape="G"].on  { background: rgba(240,180,90,0.2); }
.ft-shape-btn[data-shape="E"]     { border-color: #f0e66e; color: #f0e66e; }
.ft-shape-btn[data-shape="E"].on  { background: rgba(240,230,110,0.2); }
.ft-shape-btn[data-shape="D"]     { border-color: #78c878; color: #78c878; }
.ft-shape-btn[data-shape="D"].on  { background: rgba(120,200,120,0.2); }

/* Scrollable fretboard container */
.ft-canvas-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
  max-width: 100%;
  padding-bottom: 8px;
}
.ft-canvas-wrap canvas {
  display: block;
}

/* Custom note input */
.ft-custom-wrap {
  text-align: center;
  margin-bottom: 12px;
}
.ft-custom-input {
  background: #1a1d27;
  color: #ccc;
  border: 1.5px solid #2a2d3a;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  width: 280px;
  text-align: center;
  transition: border-color 0.15s;
}
.ft-custom-input:focus {
  border-color: #3a3d4a;
  color: #fff;
  outline: none;
}
.ft-custom-input::placeholder {
  color: #555;
}

/* Title and formula */
.ft-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
  white-space: nowrap;
  line-height: 1.6;
  height: calc(1.3rem * 1.6);
  overflow: hidden;
}
.ft-formula {
  font-size: 0.85rem;
  color: #7cb8ff;
  text-align: center;
  margin-bottom: 12px;
  white-space: nowrap;
  line-height: 1.6;
  height: calc(0.85rem * 1.6);
  overflow: hidden;
}

/* Transpose slider below fretboard */
.ft-slider-bottom {
  justify-content: center;
  margin-top: 12px;
  margin-bottom: 4px;
}
.ft-slider-bottom .ft-root-slider {
  width: 300px;
}

/* ---- Layout: card with fretboard top, panel bottom ---- */
.ft-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: #13151f;
  border: 1.5px solid #2a2d3a;
  border-radius: 10px;
  overflow: hidden;
}
.ft-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 24px 24px 16px;
}

/* ---- Info Panel (below fretboard, always visible) ---- */
.ft-panel {
  width: 100%;
  min-width: 0;
  border-top: 2px solid #2a2d3a;
  padding: 20px 22px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #c0c4d0;
  overflow-y: auto;
}
.ft-panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  padding-bottom: 12px;
  border-bottom: 2px solid #2a2d3a;
  margin-bottom: 12px;
}

/* ---- Notes display (matches cl-notes-display / cl-note-chip) ---- */
.ft-notes-display {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.ft-note-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px 5px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.ft-note-chip:hover {
  transform: translateY(-1px);
}
.ft-note-chip strong {
  font-size: 0.82rem;
  line-height: 1;
}
.ft-note-degree {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.7;
  letter-spacing: 0.02em;
  margin-bottom: 1px;
}
/* Root note chip (matches cl-note-root) */
.ft-note-root {
  background: #1c3a5c;
  border: 1px solid #2a6cb0;
  color: #7cb8ff;
}
/* Non-root note chip (matches cl-note-tone) */
.ft-note-tone {
  background: #2a1a3c;
  border: 1px solid #5a3a7a;
  color: #c88aff;
}
/* Active (playing) note chip (matches cl-note-active) */
.ft-note-active {
  box-shadow: 0 0 10px rgba(124, 184, 255, 0.4);
  transform: translateY(-2px);
  border-color: #7cb8ff !important;
  background: #2a4a6c !important;
  color: #fff !important;
}

/* Click hint (matches cl-click-hint — NO text-transform) */
.ft-click-hint {
  font-size: 0.62rem;
  color: #555;
  margin-top: 2px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ---- Panel buttons (matches cl-btn / cl-center-btns) ---- */
.ft-center-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.ft-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid #2a2d3a;
  background: #1a1d27;
  color: #ccc;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, border-color 0.15s;
  justify-content: center;
  white-space: nowrap;
  flex: 1 1 0;
}
.ft-btn:hover { background: #252836; border-color: #555; color: #fff; }
.ft-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* ---- Intervals / Formula text (matches cl-intervals-text) ---- */
.ft-intervals-text {
  font-size: 0.78rem;
  color: #b0b8d0;
  line-height: 1.8;
}
.ft-intervals-text span {
  color: #888;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Harmonisation cards (matches cl- equivalents) ---- */
.ft-harmonized {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.ft-harm-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #1a1d2e;
  border: 1.5px solid #2a2d3a;
  border-radius: 10px;
  padding: 4px 10px 5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ft-harm-card:hover {
  border-color: #5a7ab0;
  background: #252a40;
}
.ft-harm-degree {
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.7;
  color: #ccc;
}
.ft-harm-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b0b8d0;
}

/* ---- Accordion sections (matches cl-detail) ---- */
.ft-detail { border-top: 1.5px solid #2a2d3a; }
.ft-detail:first-of-type { border-top: none; }
.ft-detail summary {
  padding: 10px 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ft-detail summary::-webkit-details-marker { display: none; }
.ft-detail summary::after { content: '+'; font-size: 0.9rem; color: #555; transition: color 0.15s; }
.ft-detail[open] summary::after { content: '\2212'; }
.ft-detail summary:hover { color: #ccc; }
.ft-detail summary:hover::after { color: #888; }
.ft-detail[open] summary { color: #bbb; }
.ft-detail-body { padding: 0 0 12px; }
.ft-detail-body p { font-size: 0.78rem; color: #aaa; line-height: 1.55; margin: 0 0 6px; }
.ft-detail-body p:last-child { margin-bottom: 0; }
.ft-detail-body strong { color: #ccc; }

/* Learn More links (matches cl-links) */
.ft-panel .explainer-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ft-panel .explainer-links a {
  display: inline-block; padding: 5px 10px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 600; text-decoration: none;
  background: #1a1d2e; border: 1px solid #2a3050; color: #7cb8ff;
  transition: all 0.15s;
}
.ft-panel .explainer-links a:hover { background: #2a3a5a; border-color: #5a7ab0; color: #a0d0ff; }

/* Product links */
.ft-product-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-product-links a {
  display: block; width: calc(50% - 3px); box-sizing: border-box; padding: 5px 10px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 600; text-decoration: none;
  background: #1a1d2e; border: 1px solid #2a3050; color: #7cb8ff;
  transition: all 0.15s;
}
.ft-product-links a:hover { background: #2a3a5a; border-color: #5a7ab0; color: #a0d0ff; }
.ft-product-links-full { margin-top: 8px; }
.ft-product-links-full a {
  display: block; width: 100%; box-sizing: border-box; padding: 5px 10px; border-radius: 10px; text-align: center;
  font-size: 0.72rem; font-weight: 600; text-decoration: none;
  background: #1a1d2e; border: 1px solid #2a3050; color: #7cb8ff;
  transition: all 0.15s;
}
.ft-product-links-full a:hover { background: #2a3a5a; border-color: #5a7ab0; color: #a0d0ff; }

/* Nav links above products */
#ft-nav-links { margin-bottom: 4px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .ft-top { padding: 16px 16px 12px; }
  .ft-slider-bottom .ft-root-slider { width: 200px; }
  .ft-controls { gap: 8px; }
}
@media (max-width: 600px) {
  .ft-panel { padding: 14px 16px; }
  .ft-top { padding: 12px 12px 8px; }
  .ft-controls { gap: 6px; }
  .ft-select { font-size: 0.75rem; padding: 6px 28px 6px 10px; }
  .ft-dice-btn svg, .ft-audio-btn svg { width: 14px; height: 14px; }
  .ft-root-slider { width: 100px; }
  .ft-custom-input { width: 200px; font-size: 0.78rem; padding: 6px 10px; }
}
@media (max-width: 400px) {
  .ft-dice-btn svg, .ft-audio-btn svg { width: 12px; height: 12px; }
  .ft-select { font-size: 0.7rem; padding: 5px 24px 5px 8px; }
  .ft-controls { gap: 4px; }
}
