/* Modern Song Viewer Styles - Global Stylesheet */

/* Font Face Declarations - Load LiberationMono for mobile compatibility */
@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono-Bold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Liberation Mono';
    src: url('../fonts/LiberationMono-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Song Viewer Container - unified card */
#song_viewer {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Song Header - extends to container edges, no separate box */
.song-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    position: relative;
    /* Extend to full width by counteracting parent padding from col-lg-12 */
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
    border-radius: 12px 12px 0 0;
}

.song-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

#songName {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

#songName i {
    font-size: 1.5rem;
    opacity: 0.9;
}

#songOriginalTitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0.25rem;
    font-weight: 400;
}

#songBookName {
    font-size: 0.875rem;
    opacity: 0.85;
    font-style: italic;
}

/* YouTube Video Frame */
#ytvideoframe {
    padding: 1.5rem 2rem 0;
    background: #f8f9fa;
}

#ytvideoframe iframe {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Song Content */
.song-content {
    padding: 2rem;
    background: #ffffff;
}

/* Modern Lyrics Container - Can be used anywhere */
.song-lyrics-container {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e1e8ed;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.song-lyrics-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Modern Monospace Lyrics Styling */
.song-lyrics-container pre,
.song-lyrics-container .songLyrics,
.song-lyrics-container #songLyrics,
pre.songLyrics,
#songLyrics.songLyrics {
    font-family: 'Liberation Mono', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace;
    font-size: 0.95rem;
    line-height: 1.35;
    color: #1a202c;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    letter-spacing: 0.01em;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Enhanced styling for chord lines and verse types */
.song-lyrics-container span.c,
pre.songLyrics span.c,
#songLyrics span.c {
    font-family: 'Liberation Mono', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace;
    color: #4c51bf;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.song-lyrics-container span.verseType,
pre.songLyrics span.verseType,
#songLyrics span.verseType {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    display: inline-block;
    margin: 0.5rem 0;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85em;
}

.song-lyrics-container span.lyrics,
pre.songLyrics span.lyrics,
#songLyrics span.lyrics {
    font-family: 'Liberation Mono', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace;
    color: #2d3748;
    font-weight: 600;
}

.song-lyrics-container span.lyrics-bold,
pre.songLyrics span.lyrics-bold,
#songLyrics span.lyrics-bold {
    font-family: 'Liberation Mono', 'Courier New', 'Consolas', 'Monaco', 'Menlo', monospace;
    color: #1a202c;
    font-weight: 600;
}

/* Song Actions */
.song-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
}

/* Override Bootstrap row behavior when song-actions has row class */
.song-actions.row {
    display: flex !important;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.song-actions.row>* {
    padding-left: 0;
    padding-right: 0;
    flex: 0 0 auto;
}

/* Remove any gap before the first child in song-actions row */
.song-actions.row>*:first-child,
.song-actions.row>button:first-child,
.song-actions.row>#editsongbutton:first-child {
    padding-left: 0;
}

/* Remove gap before first child - handle whitespace/text nodes */
.song-actions>*:first-child,
.song-actions>button:first-child,
.song-actions>#editsongbutton:first-child {
    margin-left: 0 !important;
}

/* Hide any empty or invisible divs in song-actions */
.song-actions.row>div:empty,
.song-actions.row>div[style*="display: none"],
.song-actions.row>div[style*="display:none"],
.song-actions>div:empty,
.song-actions>div[style*="display: none"],
.song-actions>div[style*="display:none"] {
    display: none !important;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* Song Metadata - Horizontal Layout */
.song-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    padding-left: 0;
    border-left: none;
    font-size: 0.9rem;
    color: #4b5563;
    line-height: normal;
}

.song-metadata .metadata-item {
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.song-metadata .metadata-label {
    font-weight: 600;
    color: #374151;
}

.song-metadata:empty {
    display: none;
}

/* Ensure buttons align nicely with metadata */
.song-actions .buttons {
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
}

.song-actions .btn {
    margin: 0;
    flex-shrink: 0;
    position: relative;
    width: auto;
    min-width: auto;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
}

#editsongbutton {
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 36px;
    font-size: 14px;
    line-height: 1.4;
}

#editsongbutton:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Ensure edit button uses compact styling like other action buttons */
.song-actions #editsongbutton {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 36px;
    line-height: 1.4;
}

/* Song Note */
.song-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin: 1rem 0;
    color: #856404;
}

.song-note:empty {
    display: none;
}

.song-note strong {
    color: #664d03;
}

/* Song Versions */
.song-versions {
    margin-top: 1rem;
}

.song-versions-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.song-version-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.song-version-link:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.song-version-link i {
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .song-header {
        padding: 1.5rem;
    }

    #songName {
        font-size: 1.5rem;
    }

    .song-content {
        padding: 1.5rem;
    }

    .song-lyrics-container {
        padding: 1.5rem;
        border-radius: 8px;
    }

    .song-lyrics-container pre,
    .song-lyrics-container .songLyrics,
    .song-lyrics-container #songLyrics,
    pre.songLyrics,
    #songLyrics.songLyrics {
        font-size: 0.85rem;
        line-height: 1.35;
    }

    .song-actions,
    .song-actions.row {
        flex-direction: column !important;
        align-items: flex-start;
        overflow-x: visible;
        margin-top: 0.25rem;
        padding-top: 0.25rem;
    }

    #editsongbutton {
        width: auto;
    }
}