/* ── VARIABLES ── */
:root {
    --bg: #0e0e10;
    --surface: #18181c;
    --surface2: #222228;
    --border: #2e2e38;
    --accent: #f5c842;
    --accent2: #e87c3e;
    --text: #e8e8f0;
    --muted: #7a7a8c;
    --chord: #5dade2;
    --green: #2ecc71;
    --red: #e74c3c;
    --radius: 6px;
    --font-ui: "Syne", sans-serif;
    --font-mono: "DM Mono", monospace;
}

/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.6;
    min-height: 100vh;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    cursor: pointer;
}

/* ── NAV ── */
.site-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}
.logo span {
    color: var(--text);
}
.nav-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px;
}
.nav-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    width: 100%;
    padding: 7px 0;
}
.nav-search input::placeholder {
    color: var(--muted);
}
.nav-links {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.nav-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: var(--radius);
    transition:
        border-color 0.15s,
        color 0.15s;
}
.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.nav-btn.pro {
    background: var(--accent);
    border-color: var(--accent);
    color: #111;
}
.nav-btn.pro:hover {
    background: #f0bb30;
}

/* ── PAGE WRAP ── */
.page-wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ── SONG LAYOUT ── */
.song-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 860px) {
    .song-layout {
        grid-template-columns: 1fr;
    }
    .song-sidebar {
        display: none;
    }
}

/* ── BREADCRUMB ── */
.breadcrumb {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 14px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.breadcrumb a {
    transition: color 0.15s;
}
.breadcrumb a:hover {
    color: var(--accent);
}

/* ── SONG HEADER ── */
.song-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 16px;
    align-items: start;
}
.album-art {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #1a2a3a, #2980b9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.song-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 2px;
}
.song-artist {
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    transition: opacity 0.15s;
}
.song-artist:hover {
    opacity: 0.8;
}
.meta-pills {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* PILLS */
.pill {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
    text-transform: uppercase;
}
.pill--type {
    color: var(--chord);
    border-color: var(--chord);
}
.pill--novice {
    color: var(--green);
    border-color: var(--green);
}
.pill--intermediate {
    color: var(--accent2);
    border-color: var(--accent2);
}
.pill--advanced {
    color: var(--red);
    border-color: var(--red);
}

/* RATING */
.rating-block {
    text-align: right;
    flex-shrink: 0;
}
.stars {
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 1px;
}
.rating-num {
    font-weight: 800;
    font-size: 1.05rem;
}
.rating-count,
.favorites {
    color: var(--muted);
    font-size: 0.72rem;
}
.favorites strong {
    color: var(--text);
}

/* ── TOOLBAR ── */
.tab-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 5px;
}
.toolbar-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.ctrl-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: "Space Mono", monospace;
    font-size: 0.78rem;
    padding: 3px 9px;
    border-radius: 4px;
    transition:
        border-color 0.15s,
        color 0.15s;
    min-width: 28px;
    text-align: center;
}
.ctrl-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.ctrl-val {
    font-family: "Space Mono", monospace;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}
.toolbar-sep {
    width: 1px;
    height: 24px;
    background: var(--border);
}
.autoscroll-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    transition: all 0.15s;
}
.autoscroll-btn:hover,
.autoscroll-btn[aria-pressed="true"] {
    border-color: var(--green);
    color: var(--green);
    background: rgba(46, 204, 113, 0.07);
}
.toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.action-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.95rem;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.action-btn[aria-pressed="true"] {
    border-color: var(--red);
    color: var(--red);
}

/* ── CHORD SHEET ── */
.chord-sheet-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    animation: fadeUp 0.35s ease;
}
.sheet-meta {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 18px;
    font-size: 0.74rem;
    color: var(--muted);
    flex-wrap: wrap;
}
.sheet-meta strong {
    color: var(--text);
}
.chord-sheet {
    padding: 22px 26px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    overflow-x: auto;
}

/* ── VERSE BLOCKS ── */
.verse-block {
    margin-bottom: 24px;
}

.section-label {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* The verse-lines div — preserves spaces so chords align above lyrics */
.verse-lines {
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-x: auto;
}

/* markdownify wraps lines in <p> — we strip that margin */
.verse-lines p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Chord spans — inline so they sit on the chord line with correct spacing */
.ch {
    display: inline;
    color: var(--chord);
    font-size: 0.94em; /* one size for all chords */
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.12s;
    white-space: pre;
}
.ch:hover {
    color: #85c1e9;
}

/* Tab blocks */
.tab-block {
    display: block;
    background: rgba(93, 173, 226, 0.05);
    border-left: 2px solid var(--chord);
    border-radius: 0 4px 4px 0;
    padding: 10px 16px;
    margin: 0 0 20px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    color: #a8bcc8;
    overflow-x: auto;
    white-space: pre;
}
.tab-block code {
    background: none;
    font-family: inherit;
    color: inherit;
}

/* ── CHORD POPUP ── */
.chord-popup {
    position: fixed;
    background: var(--surface2);
    border: 1px solid var(--chord);
    border-radius: 8px;
    padding: 10px 12px;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.15s,
        transform 0.15s;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.chord-popup.show {
    opacity: 1;
    transform: none;
}
.chord-popup-name {
    font-family: var(--font-ui);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--chord);
    margin-bottom: 6px;
}
.chord-popup-label {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ── SIDEBAR ── */
.song-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.sidebar-card-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
}

/* Strum */
.strum-pattern {
    padding: 12px 14px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 44px;
}
.strum-arrow {
    font-size: 1.1rem;
    font-weight: 700;
    width: 26px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.strum-arrow.down {
    color: var(--accent);
    background: rgba(245, 200, 66, 0.1);
}
.strum-arrow.up {
    color: var(--accent2);
    background: rgba(232, 124, 62, 0.1);
}
.strum-arrow.mute {
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.7rem;
}
.strum-bpm {
    font-family: "Space Mono", monospace;
    font-size: 0.72rem;
    color: var(--muted);
    padding: 6px 14px;
    border-top: 1px solid var(--border);
}

/* Chord strip */
.chord-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}
.chord-strip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: border-color 0.15s;
}
.chord-strip-item:hover {
    border-color: var(--chord);
}
.chord-strip-name {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--chord);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}
.stat-item {
    background: var(--surface);
    padding: 10px 12px;
}
.stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}
.stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    margin-top: 2px;
}
.stat-value--gold {
    color: var(--accent);
}
.stat-value--blue {
    color: var(--chord);
}

/* Related songs */
.related-list {
    list-style: none;
    padding: 4px 0;
}
.related-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    gap: 8px;
    transition: background 0.12s;
}
.related-item a:hover {
    background: var(--surface2);
}
.related-title {
    font-size: 0.82rem;
    font-weight: 600;
}
.related-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--muted);
}

/* ── HOME ── */
.home-layout {
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.hero {
    text-align: center;
    padding: 60px 20px 20px;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 12px;
}
.hero-title span {
    color: var(--accent);
}
.hero-sub {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 24px;
}
.hero-search {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}
.hero-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding: 12px 16px;
}
.hero-search button {
    background: var(--accent);
    border: none;
    color: #111;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 20px;
    transition: background 0.15s;
}
.hero-search button:hover {
    background: #f0bb30;
}
.section-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.song-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    transition:
        border-color 0.15s,
        transform 0.15s;
}
.song-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.song-card-art {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.song-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
}
.song-card-artist {
    font-size: 0.75rem;
    color: var(--muted);
    display: block;
    margin-bottom: 5px;
}
.song-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
}
.song-card-rating {
    font-size: 0.72rem;
    color: var(--accent);
}
.artist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.artist-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s;
}
.artist-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.artist-chip span {
    color: var(--muted);
    font-size: 0.72rem;
}
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.artist-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.15s;
}
.artist-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.artist-card-art {
    font-size: 1.8rem;
}
.artist-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
}
.artist-card-count {
    font-size: 0.72rem;
    color: var(--muted);
}
.list-header {
    margin-bottom: 24px;
}
.list-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
}
.list-sub {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 4px;
}
.artist-page-hero {
    display: flex;
    align-items: center;
    gap: 16px;
}
.artist-page-art {
    font-size: 2.5rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2a3a, #2980b9);
    border-radius: 10px;
}

/* ── FOOTER ── */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 24px 20px;
}
.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-logo {
    font-weight: 800;
    color: var(--accent);
}
.footer-logo span {
    color: var(--text);
}
.footer-links {
    display: flex;
    gap: 16px;
}
.footer-links a {
    font-size: 0.82rem;
    color: var(--muted);
    transition: color 0.15s;
}
.footer-links a:hover {
    color: var(--accent);
}
.footer-copy {
    font-size: 0.72rem;
    color: var(--muted);
    margin-left: auto;
}

/* ── UTILITIES ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
/* ─────────────────────────────
   CHORDPRO RENDER MODE
   (Overrides old inline system)
   chatgpt
   (Improved spacing & chord height)
───────────────────────────── */

.song {
    margin-top: 8px;
    padding-bottom: 4rem;
}

/* Each lyric line */
.line {
    display: block;
    margin-bottom: 1.1rem; /* wider gap between lines */
    line-height: 1.85; /* more vertical breathing room */
    white-space: nowrap;
    padding-top: 1.4em; /* reserve vertical space for chords */
}

/* Word container */
.word {
    display: inline-block;
    position: relative;
    padding-right: 8px;
}

/* Chord styling */
.word .ch {
    position: absolute;
    top: -1.3em; /* adjust vertical chord placement */
    left: 0;
    display: block;
    color: var(--chord);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.word .ch:hover {
    color: #85c1e9;
}

/* Spacer lines */
.line.spacer {
    margin-bottom: 1.6rem;
}

@media print {
    .site-nav,
    .tab-toolbar,
    .song-sidebar,
    .site-footer {
        display: none !important;
    }
    .song-layout {
        grid-template-columns: 1fr;
    }
    body {
        background: white;
        color: black;
    }
    .chord-sheet-wrap {
        border: none;
    }
    .ch {
        color: #1a5276;
    }
}

/* ─────────────────────────────
   FLOATING SCROLL PANEL
───────────────────────────── */

.scroll-panel {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: none;
}

.scroll-panel.active {
    display: block;
}

.scroll-box {
    width: 42px;
    background: #2b2b2b;
    border-radius: 10px;
    padding: 10px 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-speeds {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.speed-label {
    font-size: 9px;
    color: #aaa;
    letter-spacing: 0.5px;
}

.speed-btn {
    width: 22px;
    height: 16px;
    border: none;
    border-radius: 3px;
    background: #777;
    cursor: pointer;
    transition: 0.2s;
}

.speed-btn:nth-child(2) {
    background: #888;
}
.speed-btn:nth-child(3) {
    background: #999;
}
.speed-btn:nth-child(4) {
    background: #aaa;
}
.speed-btn:nth-child(5) {
    background: #bbb;
}

.speed-btn:hover {
    transform: scale(1.1);
    background: #f5c542;
}

.stop-btn {
    margin-top: 6px;
    font-size: 9px;
    color: #ff5252;
    background: none;
    border: none;
    cursor: pointer;
}

.font-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #aaa;
}

.font-controls button {
    width: 24px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #333;
    color: #fff;
    cursor: pointer;
}

.font-controls button:hover {
    background: #444;
}

/* Simple Chord toggle button */

.ctrl-btn--toggle {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #444;
    background: #2c2c2c;
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
}

.ctrl-btn--toggle.active {
    background: #f5c542;
    color: #000;
    border-color: #f5c542;
}

.ctrl-btn--toggle:hover {
    transform: translateY(-1px);
}

/* Instrumental / Intro lines chord render*/
/* ─────────────────────────────
   Instrumental / Intro Lines
───────────────────────────── */

.chord-line {
    display: flex;
    flex-wrap: wrap; /* allow wrapping if long */
    gap: 26px; /* space between chords */
    margin-bottom: 1.1rem;
    line-height: 1.6;
}

.chord-line .ch {
    position: static; /* remove absolute behavior */
}

.chord-only {
    font-weight: 700;
}
