/* ======================= LYRICS CONTAINER ======================= */

.main-lyrics-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    background: var(--surface-elevated);
    box-shadow: inset 4px 4px 20px rgba(0, 0, 0, 0.03),
                inset -1px -1px 20px rgba(0, 0, 0, 0.11);
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    will-change: scroll-position;
}

.main-lyrics-container::-webkit-scrollbar {
    display: none; /* Chrome, Edge, Safari */
}

.lyrics-inner {
    width: max-content;
    min-width: 100%;
    padding: 40px 60px;
}

/* Layout wrapper below the header divider */
.lyrics-body-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
}

.lyrics-text-col {
    flex: 1;
    min-width: 0;
}

.lyrics-header {
    margin-bottom: 0;
    padding-bottom: 8px;
}

.lyrics-section-divider {
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 40px;
}

.song-title-main {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0px;
    font-family: var(--font-sans);
    overflow: hidden; /* ADD THIS */
    text-overflow: ellipsis; /* ADD THIS */
    white-space: nowrap; /* ADD THIS */
}

.song-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 400;
    font-family: var(--font-sans);
    overflow: hidden; /* ADD THIS */
    text-overflow: ellipsis; /* ADD THIS */
    white-space: nowrap; /* ADD THIS */
}

/* ======================= VERSION SELECTOR ======================= */
#version-selector {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.version-badges-row {
    margin-bottom: 24px;
}

#version-selector::-webkit-scrollbar {
    display: none;
}

.version-tab-btn {
    padding: 5px 16px;
    border-radius: 0 0 6px 6px;
    border: 1.5px solid var(--border-color);
    border-top: none;
    background: var(--surface-elevated);
    color: color-mix(in srgb, var(--text-tertiary) 70%, transparent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
    font-family: var(--font-sans);
    margin-right: -1.5px;
    flex-shrink: 0;
}

.version-tab-btn:last-child {
    margin-right: 0;
}

.version-tab-btn:hover {
    background: color-mix(in srgb, var(--border-light) 30%, transparent);
}

.version-tab-btn.active {
    background: var(--border-light);
    border-color: var(--text-secondary);
    color: var(--text-tertiary);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Row that wraps version selector + mobile meta badges together */
.version-badges-row {
    display: flex;
    align-items: flex-start;
}

.version-badges-row #version-selector {
    flex: 1;
    margin-bottom: 0;
}

/* Mobile-only badges — hidden on desktop, shown via responsive.css */
.song-meta-badges-mobile {
    display: none;
}

/* Inline meta text (time sig · BPM) appended to author on mobile */
.subtitle-meta-inline {
    display: none;
}


/* ======================= LYRICS CONTENT ======================= */
.lyrics-content {
    max-width: none;
    width: max-content;
    font-family: var(--font-mono);
    line-height: var(--line-height-songs);
    color: var(--text-primary);
    white-space: pre;
    font-size: var(--font-size-songs);
    font-weight: var(--lyrics-weight);
}

/* Chord styling */
.chord {
    display: inline-block;
    color: var(--accent);
    font-weight: var(--chord-weight);
    font-size: var(--font-size-songs);
    font-family: var(--chord-font);
    position: relative;
    bottom: var(--chord-distance);
}

/* Inline chords inside text lines — colored but no position shift */
.chord.inline-chord {
    position: static;
    bottom: auto;
    font-weight: var(--chord-weight);
}

/* ======================= LINE COLOR MARKERS ======================= */
.lyric-line--marked {
    border-left: 2px solid var(--line-marker-color, #94a3b8);
    padding-left: 16px;
    padding-right: 1ch;
}

/* Section lines hidden: remove border, indent lyrics/chord lines instead */
body.lyrics-hide-section-lines .lyric-line--marked {
    border-left: none;
    padding-left: 0;
    padding-right: 0;
}

/* Comment lines (__ prefix) */
.comment {
    color: var(--text-tertiary);
    font-style: italic;
    opacity: 0.75;
}


/* Verse labels */
.verse-label,
.section-label {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1em;
    font-weight: 600;
    color: color-mix(in srgb, var(--text-primary) 85%, transparent);
    display: block;
    /* margin: calc(var(--font-size-songs) * 1.25) 0
            calc(var(--font-size-songs) * 0.4); */
}

/* .lyric-line:has(.verse-label, .section-label) {
    margin-top: calc(var(--font-size-songs) * var(--line-height-songs) * 0.5);
}

.lyrics-content > .lyric-line:first-child {
    margin-top: 0;
} */

body.dark-mode .verse-label, body.dark-mode .section-label{
font-weight: 650;
}


/* ======================= LYRICS HEADER LAYOUT ======================= */
.lyrics-header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.lyrics-header-left {
    min-width: 0; /* allows text-overflow ellipsis to work */
}



/* ======================= SONG META BADGES ======================= */
.song-meta-badges {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    user-select: none;
    white-space: nowrap;
}

.meta-badge i {
    font-size: 9px;
    opacity: 0.8;
}
/* ======================= BPM / TIME-SIG PANEL ROW ======================= */
.bpm-time-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.bpm-time-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.panel-sublabel {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bpm-input::-webkit-outer-spin-button,
.bpm-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bpm-input {
    flex: 1;
    min-height: 0;
}

.timesig-dropdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.timesig-dropdown .select {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 0;
    height: auto !important;
}


/* ======================= YOUTUBE VIDEO EMBED ======================= */
#song-video-container {
    /* Matches the horizontal padding of .lyrics-inner (40px 60px).
       Responsive overrides live in responsive.css. */
    padding: 0 60px 40px;
}

/* Row containing the toggle button, with the divider as a top border */
.song-video-toggle-row {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid var(--border-light);
}

/* Toggle button */
.song-video-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-secondary);
    font-family: inherit;
    line-height: 1;
    transition: color 0.15s;
    user-select: none;
}

.song-video-toggle:hover {
    color: var(--text-primary);
}

.song-video-chevron {
    font-size: 10px;
    width: 10px;
    text-align: center;
    transition: transform 0.22s ease;
    flex-shrink: 0;
}

.song-video-toggle[aria-expanded="true"] .song-video-chevron {
    transform: rotate(90deg);
}

.song-video-toggle-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.song-video-toggle-count {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--border-light);
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.song-video-toggle:hover .song-video-toggle-count {
    background: color-mix(in srgb, var(--border-light) 60%, var(--text-secondary) 20%);
}

/* Collapsible panel — uses grid-template-rows trick for smooth height animation */
.song-video-collapsible {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}

.song-video-collapsible[aria-hidden="false"] {
    grid-template-rows: 1fr;
}

.song-video-collapsible-inner {
    overflow: hidden;
    padding-top: 0;
    transition: padding-top 0.28s ease;
}

.song-video-collapsible[aria-hidden="false"] .song-video-collapsible-inner {
    padding-top: 20px;
}

/* Grid: 1 video = full-width; 2 videos = side-by-side when space allows,
   stacked automatically when it doesn't (auto-fit handles this). */
.song-videos-grid {
    display: grid;
    gap: 16px;
}

.song-videos-grid[data-count="1"] {
    grid-template-columns: 1fr;
    max-width: 720px;
}

.song-videos-grid[data-count="2"] {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    max-width: 760px;
}

.song-video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.song-video-wrapper iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}


.edit-song-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 20px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.edit-song-notice i {
    color: var(--accent);
    font-size: 13px;
    margin-top: 1px;
    flex-shrink: 0;
}