/* Modern Karaoke Display - Inspired by Chord Websites */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #0f3460;
    --text-primary: #4581e9;
    --text-secondary: #d1d5db;
    --text-dim: #6b7280;
    --chord-blue: #60a5fa;
    --current-green: #10b981;
    --accent-orange: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-secondary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Title Bar */
#title-bar {
    background: var(--bg-medium);
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid var(--bg-light);
}

.title-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

#song-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

#transpose-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#transpose-controls button {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--chord-blue);
    padding: 8px 16px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

#transpose-controls button:hover {
    background: var(--chord-blue);
    color: white;
    transform: scale(1.1);
}

#transpose-display {
    font-size: 16px;
    color: var(--chord-blue);
    min-width: 80px;
    text-align: center;
}

/* Main Karaoke Container */
#karaoke-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

#lyrics-display {
    width: 100%;
    max-width: 1200px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 56px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: pre-wrap;
}

/* Musician Mode - Left Aligned, Modern Font */
body.musician-mode #lyrics-display {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 48px;
    font-weight: 500;
    text-align: left;
    white-space: pre-wrap;
}

/* Musician mode colors - current line still blue for consistency */
body.musician-mode .current-line {
    color: #60a5fa;
    font-weight: 600;
}

body.musician-mode .chord-line {
    color: #60a5fa;
    font-size: 0.85em;
    font-weight: 500;
}

body.musician-mode .normal-line {
    color: #d1d5db;
}

body.musician-mode .preview-line {
    color: #6b7280;
}

/* Line Styles */
.lyric-line {
    margin: 8px 0;
    transition: all 0.3s ease;
}

.chord-line {
    color: var(--chord-blue);
    font-size: 0.9em;
    margin-bottom: 2px;
    user-select: none;
    font-weight: 500;
}

.current-line {
    color: #60a5fa;
    font-weight: 600;
    font-size: 1.1em;
    text-shadow: 0 0 30px rgba(96, 165, 250, 0.4);
}

.preview-line {
    color: #6b7280;
    opacity: 0.8;
}

.normal-line {
    color: #9ca3af;
}

/* Paragraph Spacing */
.paragraph-break {
    margin: 30px 0;
}

/* Title Screen */
#lyrics-display.title-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.title-screen-title {
    font-size: 72px;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 20px;
    text-shadow: 0 0 40px rgba(96, 165, 250, 0.5);
}

.title-screen-artist {
    font-size: 36px;
    color: #9ca3af;
    margin-bottom: 40px;
}

.title-screen-hint {
    font-size: 24px;
    color: #6b7280;
    font-style: italic;
}

/* Control Bar */
#control-bar {
    background: var(--bg-medium);
    padding: 15px 20px;
    border-top: 2px solid var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.controls-left,
.controls-center,
.controls-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Navigation Groups */
.nav-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-group.hidden {
    display: none;
}

#song-counter {
    color: var(--chord-blue);
    font-size: 14px;
    font-weight: 600;
    padding: 0 15px;
    white-space: nowrap;
}

#control-bar button {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--text-dim);
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

#control-bar button:hover {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

#control-bar button.active {
    background: var(--current-green);
    color: white;
    border-color: var(--current-green);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-medium);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--bg-light);
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Song List */
#song-search {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--bg-light);
    color: var(--text-secondary);
    border-radius: 6px;
    margin-bottom: 15px;
}

#song-search:focus {
    outline: none;
    border-color: var(--chord-blue);
}

#song-list {
    max-height: 400px;
    overflow-y: auto;
}

.song-item {
    padding: 12px;
    margin: 5px 0;
    background: var(--bg-dark);
    border: 1px solid var(--bg-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.song-item:hover {
    background: var(--bg-light);
    border-color: var(--chord-blue);
    transform: translateX(5px);
}

.song-item .song-title {
    font-size: 16px;
    color: var(--text-secondary);
}

.song-item .chord-badge {
    background: var(--chord-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Setlist */
#setlist-file {
    background: var(--bg-dark);
    color: var(--text-secondary);
    padding: 10px;
    border: 2px dashed var(--bg-light);
    border-radius: 6px;
    width: 100%;
    margin-bottom: 10px;
}

#upload-setlist,
#start-setlist {
    width: 100%;
    padding: 12px;
    background: var(--chord-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

#upload-setlist:hover,
#start-setlist:hover {
    background: var(--current-green);
    transform: scale(1.02);
}

#setlist-preview {
    margin-top: 20px;
}

#setlist-preview h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

#setlist-songs {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

#setlist-songs li {
    padding: 8px;
    margin: 5px 0;
    background: var(--bg-light);
    border-radius: 4px;
}

/* Help Content */
.help-content {
    line-height: 1.8;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 10px;
}

.shortcut {
    padding: 8px;
    margin: 5px 0;
    background: var(--bg-dark);
    border-radius: 4px;
    font-size: 14px;
}

kbd {
    background: var(--bg-light);
    color: var(--chord-blue);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: Monaco, monospace;
    font-size: 13px;
    border: 1px solid var(--text-dim);
}

/* Edit Mode Indicator */
#edit-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc2626;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 900;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Status Toast */
#status-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-medium);
    color: var(--text-secondary);
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    font-size: 16px;
    border: 2px solid var(--chord-blue);
}

#status-toast.hidden {
    display: none;
}

/* Fullscreen Mode */
body.fullscreen #control-bar {
    display: none;
}

body.fullscreen #title-bar {
    display: none;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    #lyrics-display {
        font-size: 32px;
    }
    
    body.musician-mode #lyrics-display {
        font-size: 24px;
    }
    
    #control-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls-left,
    .controls-center,
    .controls-right {
        width: 100%;
        justify-content: space-around;
    }
}
