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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    margin: 0;
    color: #333;
    -webkit-overflow-scrolling: touch;
}

.container {
    display: flex;
    height: 100vh;
    background: white;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
    background: var(--selected-color, #2c3e50);
    color: white;
}

.sidebar-header h1 {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.search-box {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.add-song-btn {
    width: 100%;
    height: 37px;
    background: var(--selected-color, #3498db);
    color: white;
    border: 2px solid #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin-bottom: 8px;
}

.add-song-btn:hover {
    background: var(--selected-color-hover, #2980b9);
}

.alphabet-index {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.letter-btn {
    background: #e9ecef;
    color: #495057;
    border: none;
    padding: 5px 8px !important;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.15s;
    margin: 1px;
}

.translit-btn {
    background-color: #e9ecef;
    color: #495057;
    border: none;
    margin-left: 8px;
    padding: 3px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.15s;
}

.letter-btn:hover {
    background: var(--selected-color, #3498db);
    color: white;
}

.translit-btn:hover {
    background: var(--selected-color, #3498db) !important;
    color: #fff;
}

.letter-btn.active {
    background: var(--selected-color, #3498db) !important;
    color: white !important;
}

.translit-btn.active {
    background: var(--selected-color, #3498db) !important;
    color: #fff !important;
}

.alphabet-index {
    background-color: #fff;
    color: #fff;
    /*border-color: var(--selected-color, #3498db);*/
}

.song-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}

.song-item {
    padding: 4px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.song-item:hover {
    background: #f8f9fa;
}

.song-item.active {
    background: var(--selected-color, #3498db);
    color: white;
}

.song-item.dragging {
  opacity: 0.5;
}
.song-item.drag-over {
  background: #ffe082 !important;
  border: 1.5px dashed #bfa100;
}

.song-info {
    flex: 1;
}

.song-title {
    font-weight: 500;
    font-size: 13px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.song-header {
    padding: 20px 24px;
    background: var(--selected-color, #34495e);
    color: white;
}

.song-title-large {
    font-size: 1.8rem;
    margin: 0 0 8px 0;
    font-weight: 400;
}

.song-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    white-space: nowrap;
}

.song-tags-display {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.audio-player {
    margin-top: 12px;
    width: 100%;
}

.audio-player audio {
    width: 100%;
    height: 32px;
}

.controls-section {
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.controls-grid {
    display: grid;
    grid-template-columns: 0.6fr 3fr 1.4fr 1fr;
    gap: 16px;
}

.control-group {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.transpose-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn {
    background: var(--selected-color, #3498db);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:hover {
    background: var(--selected-color-hover, #2980b9);
    filter: brightness(0.9);
}

.color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
    font-size: 12px;
}

.color-option:hover {
    background: #f8f9fa;
}

.color-option.selected {
    background: #e3f2fd;
}

.color-circle {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.custom-color-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.custom-color-option {
    position: relative;
}

.column-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.column-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.column-btn.active {
    background: var(--selected-color, #3498db);
}

/* Lyrics Section */
.lyrics-section {
    flex: 1;
    padding: 0 24px 24px 24px;
    overflow-y: auto;
}

.lyrics-content {
    line-height: 1.6;
    font-size: 15px;
    background: white;
    padding: 0 20px 20px 20px;
    /*border-radius: 6px;
    border: 1px solid #e9ecef;*/
}

.chord {
    font-weight: bold;
    color: #3498db;
    font-size: 13px;
}

.chord-line {
    line-height: 1.1;
    /*margin-bottom: 0.1em;*/
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre;
}

.lyrics-line {
    line-height: 1.2;
    /*margin-bottom: 0.5em;*/
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre;
}

.section-header {
    font-weight: 600;
    font-size: 16px;
    margin: 16px 0 8px 0;
    color: var(--selected-color, #3498db);
}

.lyrics-columns {
    display: grid;
    gap: 20px;
}

.lyrics-column {
    /*background: #f8f9fa;*/
    padding: 16px;
    padding-top: 0;
    /*border-radius: 4px;*/
}

/* Status */
.status {
    padding: 6px 12px;
    margin: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Faith Confirmation Modal */
.faith-modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.faith-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faith-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.faith-question {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.faith-question p {
    margin: 0 0 12px 0;
}


.faith-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.faith-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.4;
}

.faith-btn-yes {
    background: #27ae60;
    color: white;
}

.faith-btn-yes:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.faith-btn-no {
    background: #e74c3c;
    color: white;
}

.faith-btn-no:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Upload Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.upload-modal {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.upload-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.upload-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-column:first-child {
    border-right: 1px solid #e0e0e0;
    padding-right: 24px;
}

.upload-column:last-child {
    padding-left: 24px;
}

.upload-btn {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--selected-color, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-textarea {
    width: 100%;
    height: 350px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    min-height: 120px;
    resize: vertical;
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
}

.file-input-group {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s;
    background: #f8f9fa;
}

.file-input-label:hover {
    border-color: var(--selected-color, #3498db);
    background: #f0f8ff;
}

.file-input-label.has-file {
    border-color: var(--selected-color, #3498db);
    background: #e3f2fd;
}

.upload-btn {
    width: 100%;
    background: var(--selected-color, #3498db);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 16px;
}

.upload-btn:hover {
    background: var(--selected-color-hover, #2980b9);
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.upload-progress {
    margin-top: 12px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--selected-color, #3498db);
    width: 0%;
    transition: width 0.3s ease;
}

/* Upload Success Modal */
.upload-success-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    padding: 15px;
}

.success-content {
    padding: 24px;
    text-align: center;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease;
}

.success-message {
    margin-bottom: 24px;
}

.success-message p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.success-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--selected-color, #3498db);
    color: white;
    min-width: 140px;
}

.success-btn:hover {
    background: var(--selected-color-hover, #2980b9);
    transform: translateY(-1px);
}

.success-btn.secondary {
    background: #6c757d;
    color: white;
}

.success-btn.secondary:hover {
    background: #5a6268;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .upload-success-modal {
        width: 95%;
        margin: 20px;
    }
    
    .success-content {
        padding: 20px;
    }
    
    .success-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .success-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Upload Error Modal */
.upload-error-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    padding: 15px;
}

.error-content {
    padding: 24px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: shake 0.6s ease;
}

.error-message {
    margin-bottom: 24px;
}

.error-message p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #dc3545;
    color: white;
    min-width: 140px;
}

.error-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.error-btn.secondary {
    background: #6c757d;
    color: white;
}

.error-btn.secondary:hover {
    background: #5a6268;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@media (max-width: 768px) {
    .upload-error-modal {
        width: 95%;
        margin: 20px;
    }
    
    .error-content {
        padding: 20px;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Full Screen Features */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 3000;
    display: none;
    flex-direction: column;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-header {
    background: var(--selected-color, #3498db);
    color: white;
    padding: 16px 8px 0 8px;
    /*display: flex;*/
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    padding-bottom: 0;
}

.fullscreen-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

.fullscreen-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-right: 10px !important;
}

.fullscreen-btn {
    position: static;
    margin: 0;
    width: auto;
    min-width: 36px;
    font-size: 14px;
    padding: 6px 8px;
    height: 32px;
  }


.fullscreen-btn:hover {
    background: var(--selected-color, #3498db);
    color: white;
    /*display: none;*/
}

.fullscreen-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: white;
    padding-top: 0;
}

.fullscreen-lyrics {
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 16px;
    background: white;
    padding: 32px;
    border-radius: 8px;
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
    padding-top: 0;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: 100vh;
        position: relative;
    }
        /* Mobile Navigation Toggle */
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 1001;
        background: var(--selected-color, #3498db);
        color: white;
        border: 1px solid rgb(128, 151, 255);
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 14px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Mobile Controls Toggle */
    .controls-toggle {
        display: flex;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1001;
        background: var(--selected-color, #3498db);
        color: white;
        border: none;
        padding: 12px;
        border-radius: 50%;
        font-size: 18px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        width: 50px;
        height: 50px;
        align-items: center;
        justify-content: center;
    }


    .mobile-nav-toggle:hover {
        background: var(--selected-color-hover, #2980b9);
    }
    
    /* Mobile nav toggle when sidebar is active (showing X) */
    .mobile-nav-toggle.active {
        background: #dc3545 !important;
        border-color: #dc3545 !important;
    }
    
    .mobile-nav-toggle.active:hover {
        background: #c82333 !important;
        border-color: #c82333 !important;
    }
    
    .controls-toggle:hover {
        background: var(--selected-color-hover, #2980b9);
        transform: scale(1.05);
    }
    /* Sidebar as Overlay */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #fafafa;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.active {
        left: 0;
    }
    /* Main Content Full Screen */
    .main-content {
        width: 100%;
        height: 100vh;
        overflow: hidden;
        position: relative;
    }
    /* Controls as Bottom Sheet */
    .controls-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e0e0e0;
        padding: 16px;
        z-index: 999;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .controls-section.active {
        transform: translateY(0);
    }
    /* Lyrics Section Full Screen */
    .lyrics-section {
        height: 100vh;
        padding: 16px;
        padding-bottom: 80px; /* Space for controls */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .lyrics-content {
        padding: 0px;
        font-size: 14px;
        background: white;
        border-radius: 8px;
        /*box-shadow: 0 2px 8px rgba(0,0,0,0.1);*/
    }
    .chord-line, .lyrics-line {
        font-size: 13px;
    }

    .chord {
        font-size: 13px;
    }
    
    /* Song Header */
    .song-header {
        padding: 16px;
        padding-top: 60px; /* Space for hamburger menu */
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .song-title-large {
        font-size: 1.3rem;
    }
    /* Controls Grid - 3 Rows Layout */
    .controls-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    /* Row 1: Transpose and Print together */
    .control-group:first-child {
        display: flex;
        gap: 12px;
        justify-content: space-between;
        align-items: center;
    }
    .control-group:first-child .transpose-controls {
        flex: 1;
    }
    .control-group:first-child .print-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
    /* Row 2: Color Picker */
    .control-group:nth-child(2) {
        display: flex;
        justify-content: center;
    }
    /* Row 3: Columns */
    .control-group:nth-child(3) {
        display: flex;
        justify-content: center;
    }
    .control-group {
        padding: 0;
    }
    /* Color Options */
    .color-options {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .color-option {
        padding: 8px;
        font-size: 12px;
    }
    .color-circle {
        width: 16px;
        height: 16px;
    }
    /* Column Buttons */
    .column-buttons {
        gap: 8px;
        justify-content: center;
    }
    .column-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    /* Upload Modal Mobile Styles */
    .upload-modal {
        margin: 20px;
        padding: 16px;
        max-height: 80vh;
    }
    .upload-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .upload-column:first-child {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 16px;
    }
    .upload-column:last-child {
        padding-left: 0;
        padding-top: 16px;
    }
    .modal-title {
        font-size: 1.3rem;
    }
    .form-input, .form-textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    .upload-btn {
        padding: 16px;
        font-size: 16px;
    }
    /* FullScreen button should be visible on mobile/iPad */
    .lyrics-fullscreen-btn {
        display: block !important;
    }
    /* Alphabet Index */
                .alphabet-index {
                padding: 6px 12px;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
                .letter-btn {
                padding: 5px 8px !important;
                font-size: 11px;
                white-space: nowrap;
            }

                .translit-btn {
                    padding: 6px 10px;
                    font-size: 11px;
                    white-space: nowrap;
            }
    /* Song List */
                .song-item {
                padding: 4px 12px;
                border-bottom: 1px solid #f0f0f0;
            }
                .song-title {
                font-size: 13px;
            }
    /* Status */
                .status {
                margin: 6px 12px;
                padding: 8px;
                border-radius: 6px;
            }
}

@media (max-width: 480px) {
    .lyrics-content {
        padding: 0;
        font-size: 13px;
        border: none;
    }
    .chord-line, .lyrics-line {
        font-size: 12px;
    }

    .chord {
        font-size: 12px;
    }
    .song-title-large {
        font-size: 1.2rem;
    }
    .controls-section {
        padding: 12px;
    }
    .color-option {
        padding: 6px;
        font-size: 11px;
    }
    .color-circle {
        width: 14px;
        height: 14px;
    }
    .column-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
}

@media (max-width: 1200px) {
    .controls-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.toggle-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0 0;
}
.toggle-btn {
    background: #fff;
    color: var(--selected-color, #3498db);
    border: 1.5px solid var(--selected-color, #3498db);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.toggle-btn.active {
    background: var(--selected-color, #3498db);
    color: #fff;
}
.toggle-btn:not(.active):hover {
    background: #f0f8ff;
}
@media (max-width: 768px) {
    .toggle-mode {
        gap: 4px;
    }
    .toggle-btn {
        font-size: 12px;
        padding: 4px 8px;
    }
}
/* Song list under performer: button-like style */
.performer-song-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.performer-song-item {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 6px;
    transition: border-color 0.18s, background 0.18s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.performer-song-item:hover {
    border-color: var(--selected-color, #3498db);
    background: #f0f8ff;
}
.performer-song-link {
    display: block;
    width: 100%;
    padding: 4px 12px;
    color: var(--selected-color, #3498db);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
}
.performer-song-item:hover .performer-song-link {
    color: #222;
}
@media (max-width: 768px) {
    .performer-song-link {
        font-size: 12px;
        padding: 4px 10px;
    }
}
.song-item.performer-active {
    background: var(--selected-color, #3498db);
    color: #fff;
    border-color: var(--selected-color, #3498db);
}
.song-item.performer-active .song-title {
    color: #fff;
}
.performer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.performer-name {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}
.performer-count {
    min-width: 24px;
    text-align: right;
    color: #888;
    font-size: 12px;
    margin-left: 8px;
}
.song-item.performer-active .performer-count {
    color: #fff;
}
.share-btn {
    background: var(--selected-color, #3498db);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
    margin-left: 10px;
}
.share-btn:hover {
    background: var(--selected-color-hover, #2980b9);
}
/* Make icon-only control buttons round and centered */
.print-btn, .share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 0;
}
.site-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #000;
    color: #fff;
    text-align: center;
    line-height: 10px;
    height: 15px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}
@media (max-width: 768px) {
    .site-footer {
        font-size: 10px;
        height: 15px;
    }
}
@media (max-width: 480px) {
    .site-footer {
        font-size: 10px;
        height: 15px;
    }
}
/* Match sidebar-header height to song-header on large screens */
@media (min-width: 769px) {
    .sidebar-header {
        height: var(--song-header-height, auto);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .song-header {
        /* Set a CSS variable for its height after rendering */
    }
} 

.modal-overlay#faithModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #181c24; /* solid dark background */
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: all;
}
.modal-overlay#faithModal:not(.active) {
    display: none;
}
body.modal-active {
    overflow: hidden !important;
} 

#fullscreenOverlay.dark-theme {
    background: #000 !important;
    color: white !important;
}
#fullscreenOverlay.dark-theme .fullscreen-header {
    background: #000 !important;
    color: #ffe082 !important;
}
#fullscreenOverlay.dark-theme .fullscreen-title {
    color: #ffe082 !important;
}
#fullscreenOverlay.dark-theme .fullscreen-controls button {
    background: #000 !important;
    color: #ffe082 !important;
    border: none;
}
#fullscreenOverlay.dark-theme .fullscreen-lyrics {
    background: #000 !important;
    color: white !important;
    border-radius: 8px;
    padding: 16px;
    padding-top: 0;
}
#fullscreenOverlay.dark-theme .fullscreen-content,
#fullscreenOverlay.dark-theme .fullscreen-lyrics {
    background: #000 !important;
    color: white !important;
}

#fullscreenOverlay.dark-theme .lyrics-columns,
#fullscreenOverlay.dark-theme .lyrics-column {
    background: #000 !important;
    color: white !important;
}
#fullscreenOverlay.dark-theme .section-header {
    color: #fff !important;
}

/* Light theme styles for fullscreen */
#fullscreenOverlay.light-theme {
    background: #ffffff !important;
    color: black !important;
}
#fullscreenOverlay.light-theme .fullscreen-header {
    background: #fff !important;
    color: black !important;
    border-bottom: 1px solid #e9ecef !important;
}
#fullscreenOverlay.light-theme .fullscreen-title {
    color: black !important;
}
#fullscreenOverlay.light-theme .fullscreen-controls button {
    background: #ffffff !important;
    color: black !important;
    border: 1px solid #dee2e6 !important;
}
#fullscreenOverlay.light-theme .fullscreen-controls button:hover {
    background: #e9ecef !important;
    color: black !important;
}
#fullscreenOverlay.light-theme .fullscreen-lyrics {
    background: #ffffff !important;
    color: black !important;
    border-radius: 8px;
    padding: 16px;
    padding-top: 0;
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;*/
}
#fullscreenOverlay.light-theme .fullscreen-content,
#fullscreenOverlay.light-theme .fullscreen-lyrics {
    background: #ffffff !important;
    color: black !important;
}

#fullscreenOverlay.light-theme .lyrics-columns,
#fullscreenOverlay.light-theme .lyrics-column {
    background: #ffffff !important;
    color: black !important;
}
#fullscreenOverlay.light-theme .section-header {
    color: var(--selected-color, #3498db) !important;
}
#fullscreenOverlay.light-theme .chord {
    color: var(--selected-color, #3498db) !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s;
}
/* Updated Arrow Rainfall Animation */
.arrow-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    height: 120px;
    width: 40px;
}
.arrow {
    width: 40px;
    height: 40px;
    border-left: 8px solid #007bff;
    border-bottom: 8px solid #007bff;
    transform: rotate(-45deg);
    opacity: 0;
    position: absolute;
    left: 0;
    animation: arrowRain 1.2s infinite;
}
.arrow1 { animation-delay: 0s; }
.arrow2 { animation-delay: 0.2s; }
.arrow3 { animation-delay: 0.4s; }
@keyframes arrowRain {
    0% { top: 0px; opacity: 0; }
    10% { opacity: 1; }
    50% { top: 60px; opacity: 1; }
    80% { opacity: 1; }
    100% { top: 100px; opacity: 0; }
}

@media (max-width: 600px) {
  .arrow-loader {
    width: 28px;
    height: 84px;
    gap: 8px;
  }
  .arrow {
    width: 28px;
    height: 28px;
    border-left-width: 5px;
    border-bottom-width: 5px;
    left: 0;
  }
  @keyframes arrowRain {
    0% { top: 0px; opacity: 0; }
    10% { opacity: 1; }
    50% { top: 40px; opacity: 1; }
    80% { opacity: 1; }
    100% { top: 70px; opacity: 0; }
  }
}

@media (max-width: 768px) {
  /*.search-box {
    margin-left: 44px;
    width: 87%;
  }*/
  .add-song-btn {
    margin-left: 44px;
    width: 50%;
  }
}

@media (min-width: 769px) {
  .controls-collapse-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    top: -18px;
    transform: translateX(-50%);
    background: #fff;
    border: 4px solid var(--selected-color, #3498db);
    border-radius:50%;
    width: 33px;
    height: 33px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
  }
  .controls-collapse-btn:hover {
    background: #f5f5f5;
  }
  .controls-section {
    position: relative;
  }
  .controls-collapse-btn span {
    font-size: 22px;
    display: block;
    transition: transform 0.3s;
  }
  .controls-section.collapsed .controls-grid {
    display: none;
  }
  .controls-section.collapsed .controls-collapse-btn span {
    transform: rotate(180deg);
  }
}

@media (max-width: 768px) {
  #lyricsFullscreenBtn {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    height: 38px !important;
    width: 38px !important;
    z-index: 10010 !important;
    border-radius: 8px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: var(--selected-color, #3498db) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  }
}

@media (max-width: 768px) {
  .fullscreen-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 8px 0 8px;
    text-align: left;
  }
  .fullscreen-controls {
    flex-direction: row;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 0;
    padding-right: 10px;
    width: 100%;
  }
  .fullscreen-btn {
    position: static;
    margin: 0;
    width: auto;
    min-width: 36px;
    font-size: 14px;
    padding: 6px 8px;
    height: 32px;
  }
  .fullscreen-controls {
    display: flex !important;
    z-index: 9999 !important;
    position: relative !important;
  }
  .fullscreen-btn {
    display: flex !important;
    z-index: 10000 !important;
    position: relative !important;
  }
}

.fullscreen-btn, .fullscreen-controls, #lyricsFullscreenBtn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure FullScreen button is always visible on iPad */
@media (max-width: 1024px) and (min-width: 768px) {
  #lyricsFullscreenBtn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    height: 38px !important;
    width: 38px !important;
    z-index: 10010 !important;
    border-radius: 8px !important;
    background: var(--selected-color, #3498db) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  }
}

.btn-border {
  border: 1px solid #ffffff !important;
  border-radius: 8px !important;
  padding: 5px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.favourite-icon {
  cursor: pointer;
  font-size: 18px;
  color: #bbb;
  margin-right: 8px;
  transition: color 0.2s;
  vertical-align: middle;
}
.favourite-icon.favourited {
  color: #ffd700;
  text-shadow: 0 0 2px #bfa100;
}
.favourite-icon:hover {
  color: #ffb300;
}
#showFavouritesBtn {
  background: #fffbbf;
  color: #826800;
  border: 1px solid #ffe082;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#showFavouritesBtn.active, #showFavouritesBtn:active {
  background: #ffd700;
  color: #111;
}
#showFavouritesIcon {
  font-size: 18px;
  color: #ffd700;
  margin-right: 4px;
}
#clearFavouritesBtn {
  background: #ffeaea;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
#clearFavouritesBtn:hover {
  background: #ffcdd2;
  color: #b71c1c;
}

#lyricsFullscreenBtn.fullscreen-btn {
    position: absolute; 
    top: 16px; 
    right: 16px; 
    z-index: 10010 !important;
    font-size: 24px;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.2s ease;
}

#lyricsFullscreenBtn.fullscreen-btn[data-fullscreen-active="true"] {
    background: #dc3545 !important;
    color: white !important;
    border: 2px solid #dc3545 !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
}

#lyricsFullscreenBtn.fullscreen-btn[data-fullscreen-active="true"]:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
    transform: scale(1.05);
}

div.fullscreen-controls {
    display: flex;
    align-items: center;
    justify-content: right;
}

.favourite-order-number {
  font-size: 12px;
  color: #888;
  margin-right: 4px;
  min-width: 18px;
  display: inline-block;
  text-align: right;
}

.fullscreen-nav-btns {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  gap: 12px;
  z-index: 10020;
}

.fullscreen-nav-btn {
  position: static;
  background: #000;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0.98;
  transition: background 0.2s, color 0.2s, border 0.2s;
  z-index: 10010 !important;
}
.fullscreen-nav-btn:hover {
  background: #272727;
  color: #ffffff;
  border-color: #ffffff;
}

@media (min-width: 768px) {
    .fullscreen-content {
        padding: 0 !important;
    }
}

#lyricsFullscreenBtn {
    width: 36px !important;
    height: 36px !important;
    border: solid 1px #ffffff !important;
    box-shadow: none !important;
    border-radius: 4px !important;
}

#mobileNavToggle {
    border: solid 1px #ffffff !important;
}