/* css/reading-pane.css */
.reading-pane {
    flex: 1;
    background: var(--bg-dark);
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    position: relative;
}

#toolbar {
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
}

.transp-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #333;
    padding: 3px;
    border-radius: 4px;
}

.transp-controls button {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    border-radius: 3px;
}

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

#transpDisplay {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: var(--accent);
}

/* Main Display Container - Flex Column */
#songDisplay {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Occupy full pane height */
    min-height: 0;
    /* CRITICAL for nested flex scrolling */
    overflow: hidden;
    /* Prevent body scroll from scrolling header */
    padding: 0;
    /* Remove padding from container, move to children */
}

/* Song Body - Scrolling Part */
#song-body-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px 100px 40px;
    /* Added bottom padding for scroll comfort */
    position: relative;
    /* scroll-behavior: smooth; Optional */
}

#song-body-content {
    white-space: pre-wrap;
    outline: none;
    font-size: 16px;
    /* Slightly larger for readability */
    line-height: 1.4;
    /* Relaxed line height */
    /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; -- OLD PREF */
    font-family: 'Consolas', 'Courier New', monospace;
    /* REQUIRED FOR CHORD ALIGNMENT */
    color: #e0e0e0;
}

/* Fixed Header */
.song-header {
    flex: 0 0 auto;
    /* Don't grow or shrink */
    border-bottom: 1px solid var(--border);
    background: #1e1e1e;
    padding: 15px 20px;
    /* Match horizontal padding */
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    /* margin-bottom removed */
}

.song-header h1.ti {
    color: var(--link-blue);
    margin: 0 0 5px 0;
    font-size: 22px;
    /* Smaller title */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compact-meta-row {
    font-size: 13px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
    line-height: 1.4;
}

.compact-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.compact-meta-item strong {
    color: #ccc;
    font-weight: 500;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    background: #252526;
    padding: 15px;
    border-radius: 5px;
    font-size: 14px;
}

.meta-row span {
    color: var(--text-muted);
    margin-right: 8px;
}

.meta-row strong {
    color: var(--text);
    font-weight: 600;
}

/* Editing Styles */
.edit-input {
    background: #111;
    border: 1px solid #444;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 14px;
    width: 90%;
}

.editing-active {
    background: #1e1e1e;
    border: 1px dashed #444;
    padding: 10px;
}

.edit-labels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Floating Editor Toolbar */
.editor-floating-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #252526;
    border-bottom: 1px solid #444;
    padding: 8px;
    display: flex;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin: 0 -40px 20px -40px;
    /* Counteract padding of parent */
}

.editor-toggle-btn {
    background: #333;
    border: 1px solid #555;
    color: #aaa;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.editor-toggle-btn:hover {
    background: #444;
    color: #fff;
}

.editor-toggle-btn.active {
    background: #2b5c90;
    /* Blue-ish */
    color: white;
    border-color: #4a8cd6;
}

/* Chord Map */
.chord-map-container {
    margin-top: 15px;
    background: #252526;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #cd3227;
}

.chord-map-title {
    font-weight: bold;
    color: #cd3227;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
}

.chord-map-container table {
    width: 100%;
    border-collapse: collapse;
}

.chord-map-container td {
    padding: 5px;
    text-align: center;
    border: 1px solid #444;
}

.chord-map-container .chord-box {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: inherit;
    text-decoration: none;
    min-width: 30px;
}

/* --- NEW PARSING STYLES --- */

/* Semantic Parts */
.song-part {
    margin-bottom: 25px;
    /* Clear separation between verses */
}

/* Chord Lines: Monospace + Color */
.chord-line {
    color: #ff6b6b;
    /* Red/Salmon */
    font-weight: bold;
    font-family: 'Consolas', 'Courier New', monospace;
    /* Alignment */
    white-space: pre;
    /* Preserve Spaces */
    line-height: 1.2;
    margin-bottom: 2px;
    /* Tight to lyric */
    min-height: 1.2em;
    /* Ensure visibility */
}

/* Lyric Lines: Monospace + Normal */
.lyric-line {
    color: #e0e0e0;
    font-family: 'Consolas', 'Courier New', monospace;
    /* Alignment */
    white-space: pre-wrap;
    line-height: 1.5;
    margin-bottom: 10px;
    /* Space before next couplet/line */
}

/* Legacy Overrides (just in case) */
#songDisplay .chMono,
#songDisplay .te {
    /* If any slip through, style appropriately */
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: pre;
}

#songDisplay .chMono {
    color: #ff6b6b;
    font-weight: bold;
}

#songDisplay .te {
    color: #e0e0e0;
}