* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    margin: 0;
    color: #333;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    display: flex;
    height: 100vh;
    background: white;
    position: relative;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar - Section 1 (Left) */
.sidebar {
    width: 280px;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

/* Middle Section Wrapper - contains button and section */
.middle-section-wrapper {
    position: relative;
    display: flex;
    flex-shrink: 0;
}

/* Middle Section - Section 2 (New) */
.middle-section {
    width: 400px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    transition: width 0.3s ease;
}

/* Toggle button on right border */
.toggle-middle-section-btn {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 60px;
    padding: 0;
    background: #313131;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #ccc;
    flex-shrink: 0;
}

.toggle-middle-section-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* Triangle icon using CSS (pointing left by default - click to hide) */
.toggle-middle-section-btn::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 8px solid currentColor;
    transition: transform 0.3s ease;
}

/* When middle-section is hidden */
.middle-section.hidden {
    width: 0;
    border-right: none;
    overflow: hidden;
    padding: 0;
    margin-right: 0;
}

.toggle-middle-section-btn.hidden::before {
    transform: rotate(180deg);
}

.middle-section.hidden .toggle-middle-section-btn {
    right: -24px;
}

.middle-section .song-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

.middle-content {
    padding: 20px;
}

.sidebar-header {
    padding: 16px;
    background: var(--selected-color, #000);
    color: white;
    position: relative;
    flex-shrink: 0;
}

.sidebar-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.sidebar-logo {
    width: 80px;
    height: auto;
}

.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, #000);
    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;
    position: relative;
    flex-shrink: 0;
}

.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;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.translit-btn {
    background: #fff;
    color: var(--selected-color, #000);
    border: 1.5px solid var(--selected-color, #000);
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.letter-btn:hover {
    background: var(--selected-color, #000);
    color: white;
}

.translit-btn:not(.active):hover {
    background: #f0f8ff;
}

.letter-btn.active {
    background: var(--selected-color, #000) !important;
    color: white !important;
}

.translit-btn.active {
    background: var(--selected-color, #000);
    color: #fff;
}

.alphabet-index {
    background-color: #fff;
    color: #fff;
    /*border-color: var(--selected-color, #000);*/
}

.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[draggable="true"] {
    cursor: grab;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.song-item[draggable="true"]:active {
    cursor: grabbing;
}

.song-item:hover {
    background: #f8f9fa;
}

.song-item.active {
    background: var(--selected-color, #000);
    color: white;
}

.song-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.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;
    min-width: 0;
    overflow-x: hidden;
}

.song-header {
    padding: 20px 24px;
    background: var(--selected-color, #000);
    color: white;
}

.song-title-large {
    font-size: 1.8rem;
    margin: 0 0 8px 0;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Apply selected color only in dark mode */
body.dark-mode .song-title-large {
    color: var(--selected-color, #000000);
}

.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;
}

/* Hide mobile audio player on desktop */
.mobile-audio-player {
    display: none;
}

.controls-section {
    padding: 16px;
    background: #f8f9fa;
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar .controls-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    width: 100%;
}

.sidebar .control-group {
    width: 100%;
}

.transpose-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.transpose-arrow-btn {
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.transpose-arrow-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
}

#transposeUpBtn,
#transposeDownBtn {
    border-radius: 50%;
}

#targetKey {
    flex: 1;
    min-width: 60px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
}

.btn {
    background: var(--selected-color, #000);
    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;
}

#darkModeBtn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    cursor: pointer;
    transition: all 0.3s;
}

#darkModeBtn i { color: #000000; }

#darkModeBtn:hover {
    background: #f2f2f2;
    transform: scale(1.1);
}

#darkModeBtn.active {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .container {
    background: #1a1a1a;
}

body.dark-mode .sidebar {
    background: #000000;
    border-right: 1px solid #444;
}

body.dark-mode .middle-section {
    background: #000000;
    border-right: 1px solid #444;
}

body.dark-mode .main-content {
    background: #1a1a1a;
}

body.dark-mode .song-item {
    border-bottom: 1px solid #444;
    color: #e0e0e0;
}

/* Keep notes the same color in dark mode as in light mode */
body.dark-mode .song-item.note-item {
    color: #000;
}
body.dark-mode .song-item.note-item .song-title {
    color: #000 !important;
}

body.dark-mode .song-item:hover {
    background: #3a3a3a;
}

body.dark-mode .song-item.active {
    background: #4a4a4a;
    color: white;
}

body.dark-mode .lyrics-section {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .lyrics-content {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .font-size-btn {
    background: #000000;
    color: #ffffff;
    border: 1px solid #ffffff;
}

body.dark-mode .font-size-btn:hover {
    background: #333333;
    color: #ffffff;
}

body.dark-mode .chord {
    color: #ffd700;
}

body.dark-mode .control-group {
    background: #2c2c2c;
    border: 1px solid #444;
}

body.dark-mode .controls-section {
    background: #000000;
    border-top: 1px solid #444;
}

body.dark-mode .alphabet-index {
    background: #000000;
    border-bottom: 1px solid #444;
}

body.dark-mode .letter-btn {
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .letter-btn:hover {
    background: var(--selected-color, #000);
    color: white;
}

body.dark-mode .letter-btn.active {
    background: var(--selected-color, #000);
    color: white;
}

body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.85);
}

body.dark-mode .upload-modal,
body.dark-mode .faith-modal,
body.dark-mode .upload-success-modal,
body.dark-mode .upload-error-modal {
    background: #2c2c2c;
    color: #e0e0e0;
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
    background: #1a1a1a;
    border: 1px solid #555;
    color: #e0e0e0;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    border-color: var(--selected-color, #000);
}

body.dark-mode .status {
    background: #3a3a3a;
    border: 1px solid #555;
}

body.dark-mode .section-header {
    color: var(--selected-color, #ffd700);
}

body.dark-mode .toggle-btn {
    background: #2c2c2c;
    color: #e0e0e0;
    border: 1.5px solid #555;
}

body.dark-mode .toggle-btn.active {
    background: var(--selected-color, #000);
    color: #fff;
}

body.dark-mode .translit-btn {
    background: #2c2c2c;
    color: #e0e0e0;
    border: 1.5px solid #555;
}

body.dark-mode .translit-btn.active {
    background: var(--selected-color, #000);
    color: #fff;
}

/* Additional dark mode text elements */
body.dark-mode .song-title {
    color: #e0e0e0;
}

body.dark-mode .song-title-large {
    color: var(--selected-color, #e0e0e0);
}

body.dark-mode .song-header {
    background: #000000;
    color: #e0e0e0;
}

body.dark-mode .sidebar-header {
    background: #000000;
    color: #e0e0e0;
}

body.dark-mode .sidebar-header h1 {
    color: #e0e0e0;
}

body.dark-mode .search-box {
    background: #1a1a1a;
    border: 1px solid #555;
    color: #e0e0e0;
}

body.dark-mode .search-box::placeholder {
    color: #888;
}

body.dark-mode .add-song-btn {
    background: var(--selected-color, #000);
    color: white;
    border: 2px solid #555;
}

body.dark-mode .btn {
    background: var(--selected-color, #000);
    color: white;
}

body.dark-mode .lyrics-line {
    color: #e0e0e0;
}

body.dark-mode .chord-line {
    color: #ffd700 !important;
}

body.dark-mode .meta-item {
    color: #b0b0b0;
}

body.dark-mode .tag {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .column-btn {
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .column-btn.active {
    background: var(--selected-color, #000);
    color: white;
}

body.dark-mode .modal-title {
    color: #e0e0e0;
}

body.dark-mode .form-label {
    color: #e0e0e0;
}

body.dark-mode .faith-title {
    color: #e0e0e0;
}

body.dark-mode .faith-question {
    color: #b0b0b0;
}

body.dark-mode .success-message p,
body.dark-mode .error-message p {
    color: #b0b0b0;
}

body.dark-mode .close-modal {
    color: #e0e0e0;
}

body.dark-mode .close-modal:hover {
    color: #fff;
}

body.dark-mode .file-input-label {
    background: #1a1a1a;
    border: 2px dashed #555;
    color: #e0e0e0;
}

body.dark-mode .file-input-label:hover {
    border-color: var(--selected-color, #000);
    background: #2c2c2c;
}

body.dark-mode select.btn {
    background: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode select.btn option {
    background: #2c2c2c;
    color: #e0e0e0;
}

body.dark-mode .performer-song-item {
    background: #2c2c2c;
    border: 1px solid #555;
    color: #e0e0e0;
}

body.dark-mode .performer-song-item:hover {
    background: #3a3a3a;
    border-color: var(--selected-color, #000);
}

body.dark-mode .performer-song-link {
    color: #ffd700;
}

body.dark-mode .performer-song-item:hover .performer-song-link {
    color: #ffed4e;
}

body.dark-mode .performer-name {
    color: #e0e0e0;
}

body.dark-mode .performer-count {
    color: #888;
}

body.dark-mode .song-item.performer-active .performer-count {
    color: #fff;
}

body.dark-mode .favourite-icon {
    color: #888;
}

body.dark-mode .favourite-icon.favourited {
    color: #ffd700;
}

body.dark-mode #showFavouritesBtn {
    background: #3a3a14;
    color: #ffd700;
    border: 1px solid #555;
}

body.dark-mode #shareFavouritesBtn {
    background: #1a2a3a;
    color: #ffd700;
    border: 1px solid #555;
}

body.dark-mode #clearFavouritesBtn {
    background: #3a1414;
    color: #ff6b6b;
    border: 1px solid #555;
}

body.dark-mode .loading-overlay {
    background: rgba(26, 26, 26, 0.95);
}

body.dark-mode .spinner {
    border-color: rgba(100, 181, 246, 0.1);
    border-top-color: #ffd700;
}

body.dark-mode .site-footer {
    background: #000;
    color: #888;
}

body.dark-mode #lyricsSectionTitle {
    color: var(--selected-color, #ffd700);
}

body.dark-mode .fullscreen-overlay {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .fullscreen-header {
    background: #2c2c2c;
    color: #e0e0e0;
}

body.dark-mode .fullscreen-title {
    color: #e0e0e0;
}

body.dark-mode .fullscreen-lyrics {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .fullscreen-content {
    background: #1a1a1a;
}

/* Dark mode with black color selected - use yellow text for better visibility */
body.dark-mode-black .song-title-large {
    color: #ffd700 !important;
}

body.dark-mode-black #lyricsSectionTitle {
    color: #ffd700 !important;
}

body.dark-mode-black .chord {
    color: #ffd700 !important;
}

body.dark-mode-black .section-header {
    color: #ffd700 !important;
}

body.dark-mode-black .lyrics-line {
    color: #e0e0e0 !important;
}

body.dark-mode-black .chord-line {
    color: #ffd700 !important;
}

body.dark-mode-black .song-header {
    background: #000000 !important;
}

body.dark-mode-black .lyrics-content {
    color: #e0e0e0 !important;
}

body.dark-mode-black .font-size-btn {
    background: #000000;
    color: #ffffff;
    border: 1px solid #ffffff;
}

body.dark-mode-black .font-size-btn:hover {
    background: #333333;
    color: #ffffff;
}

.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, #000);
}

/* Lyrics Section */
.lyrics-section {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.lyrics-section #lyricsSectionTitle {
    display: block;
    margin: 0 0 16px 0;
    padding: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--selected-color, #000);
    text-transform: uppercase;
}

.lyrics-content {
    line-height: 1.6;
    font-size: 15px;
    background: white;
    padding: 0 20px 20px 20px;
    position: relative;
    overflow-x: auto;
    /*border-radius: 6px;
    border: 1px solid #e9ecef;*/
}

/* Font size controls */
.font-size-controls {
    position: fixed;
    top: 80px;
    right: 15px;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

body.fullscreen-active #fontSizeControls {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.font-size-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.font-size-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.font-size-btn:active {
    transform: scale(0.95);
}

/* Chord selector button */
.chord-selector-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chord-selector-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.chord-selector-btn:active {
    transform: scale(0.95);
}

/* Chord selector dropdown */
.chord-selector-dropdown {
    background: rgba(255, 255, 255, 0) !important;
    border: 1px solid #000000;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 101;
    padding: 6px;
    display: none; /* toggled via JavaScript */
    gap: 8px;
    flex-wrap: wrap;
}

/* Increase specificity in case other rules override */
.font-size-controls .chord-selector-dropdown {
    background: rgba(255, 255, 255, 0) !important;
}

.chord-selector-dropdown .chord-option {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.chord-selector-dropdown .chord-option:hover {
    transform: scale(1.05);
    background-color: #f2f2f2;
}

.chord-selector-dropdown .chord-option.active {
    background-color: #000000;
}

/* Chord selector button */
.chord-selector-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: 1px solid #000000;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chord-selector-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.chord-selector-btn:active {
    transform: scale(0.95);
}

/* Chord selector dropdown */
.chord-selector-dropdown {
    position: absolute;
    top: 10px;
    right: 55px;
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 101;
    max-height: 300px;
    overflow-y: auto;
    min-width: 60px;
}

.chord-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    font-weight: bold;
    color: #000000;
    transition: background-color 0.2s;
}

.chord-option:last-child {
    border-bottom: none;
}

.chord-option:hover {
    background-color: #f0f0f0;
}

.chord-option.active {
    background-color: #000000;
    color: white;
}

/* Mobile styles for font size controls */
@media (max-width: 768px) {
    .font-size-controls {
        right: 10px;
        top: 100px;
        gap: 4px;
    }
    
    .font-size-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 18px;
    }
    
    .chord-selector-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 14px;
        font-weight: 700 !important;
    }
    
    .chord-selector-dropdown {
        right: 40px;
        top: 5px;
        min-width: 50px;
    }
    
    .chord-option {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .chord-selector-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 12px;
    }
    
    .chord-selector-dropdown .chord-option {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 12px;
    }
}

.chord {
    font-weight: bold;
    color: #000;
    font-size: 13px;
}

.chord-line {
    line-height: 1.2;
    /*margin-bottom: 0.1em;*/
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding-left: 15px;
}

.lyrics-line {
    line-height: 1.2;
    /*margin-bottom: 0.5em;*/
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding-left: 15px;
}

.section-header {
    font-weight: 600;
    font-size: 16px;
    margin: 16px 0 8px 0;
    color: var(--selected-color, #000);
}

.lyrics-columns {
    display: grid;
    gap: 20px;
    width: fit-content;
    justify-content: start;
}

.lyrics-column {
    /*background: #f8f9fa;*/
    padding: 16px;
    padding-top: 0;
    /*border-radius: 4px;*/
    min-width: 0;
    width: max-content;
}

/* 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: #000;
    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: 20050;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.upload-modal {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 1600px;
    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: 12px;
    margin-top: 10px;
}

.upload-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-column:first-child {
    border-right: 1px solid #e0e0e0;
    padding-right: 12px;
}

.upload-column:last-child {
    padding-left: 12px;
}

.upload-btn {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    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: 8px;
}

.form-label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.form-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--selected-color, #000);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-textarea {
    width: 100%;
    height: 300px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    min-height: 100px;
    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: 6px;
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s;
    background: #f8f9fa;
    font-size: 12px;
}

.file-input-label:hover {
    border-color: var(--selected-color, #000);
    background: #f0f8ff;
}

.file-input-label.has-file {
    border-color: var(--selected-color, #000);
    background: #e3f2fd;
}

.upload-btn {
    width: 100%;
    background: var(--selected-color, #000);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

.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, #000);
    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, #000);
    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, #000);
    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: 2rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    text-align: center;
}

.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, #000);
    color: white;
    /*display: none;*/
}

.fullscreen-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: white;
    padding-top: 0;
}

.fullscreen-lyrics {
    width: 100%;
    max-width: 100%;
    margin: 0;
    line-height: 2;
    font-size: 3.5rem;
    font-weight: 600;
    background: white;
    padding: 60px;
    border-radius: 0;
    padding-top: 0;
    text-align: center;
}

/* Mobile-First Responsive Design */
/* Mobile and Portrait Tablets - Single column layout */
/* Applies to phones and tablets in portrait mode */
@media (max-width: 1024px) and (orientation: portrait) {
    .container {
        flex-direction: column;
        height: 100vh;
        position: relative;
    }
    
    /* Hide middle section on mobile, but move song list to sidebar */
    .middle-section {
        display: none !important;
    }
    
    /* Move song list and favorite buttons to sidebar on mobile */
    .sidebar .song-list {
        display: block !important;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        padding-bottom: 110px; /* Space for mobile audio player (40px) + bottom nav (56px) + extra buffer (14px) */
    }
    
    /* Show favorite buttons in sidebar on mobile */
    .sidebar #showFavouritesBtn {
        display: block !important;
    }
    
    /* Show favourite actions container in sidebar on mobile */
    .sidebar #favouriteActionsContainer {
        display: flex !important;
    }
    
    /* Show note input container in sidebar on mobile when it's set to flex by JavaScript */
    .sidebar #noteInputContainer[style*="display: flex"] {
        display: flex !important;
    }
    
    /* Share and Clear buttons visibility controlled by JavaScript based on favourites mode */
    
    /* Mobile Navigation Toggle */
    /* Hide mobile buttons when they're in container (not in bottom nav) */
    .container > .mobile-nav-toggle:not(.moved),
    .container > .controls-toggle:not(.moved) {
        display: none !important;
    }
    
    /* Show buttons when they're in bottom nav */
    .mobile-bottom-nav .mobile-nav-toggle,
    .mobile-bottom-nav .controls-toggle {
        display: flex !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        right: auto !important;
    }


    .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;
        max-width: 100vw;
        box-sizing: border-box;
    }
    /* Controls as Bottom Sheet */
    .controls-section {
        position: fixed !important;
        bottom: 96px !important; /* Space for: audio player (40px) + bottom nav (34px + 22px padding = 56px) */
        left: 0 !important;
        right: 0 !important;
        background: #000000 !important;
        border-top: 1px solid #444 !important;
        padding: 16px !important;
        padding-bottom: 20px !important;
        z-index: 999 !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s ease !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    .controls-section.active {
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Dark mode - white background for controls section */
    body.dark-mode .controls-section {
        background: #ffffff !important;
        border-top: 1px solid #e0e0e0 !important;
    }
    /* Lyrics Section Full Screen */
    .lyrics-section {
        height: 100vh;
        padding: 0 16px 16px 16px;
        padding-bottom: 116px; /* Space for: audio player (40px) + bottom nav (56px) + safety margin (20px) */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    
    /* Hide original button positions on mobile when in bottom nav */
    .mobile-bottom-nav ~ .container #lyricsFullscreenBtn,
    .mobile-bottom-nav ~ .container #playerBtn {
        display: none !important;
    }
    
    .fullscreen-nav-btns {
        display: none !important;
    }
    .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;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .song-title-large {
        font-size: 1.3rem;
    }
    
    /* Fixed lyrics title on mobile */
    #lyricsSectionTitle.song-title-large {
        position: sticky;
        top: 0;
        background: var(--selected-color, #000) !important;
        color: white !important;
        margin: -16px -16px 16px -16px;
        padding: 12px 16px;
        z-index: 100;
        font-size: 1.2rem;
    }
    
    /* Mobile audio player styling - attached to top of bottom nav */
    .mobile-audio-player {
        display: block !important;
        position: fixed;
        bottom: 56px; /* Bottom nav total height: 34px buttons + 11px top padding + 11px bottom padding */
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw;
        margin: 0;
        padding: 6px 8px;
        background: var(--selected-color, #000);
        z-index: 9999;
        box-shadow: none;
        border-bottom: none;
        box-sizing: border-box;
    }
    
    .mobile-audio-player audio {
        width: 100%;
        height: 28px;
        border-radius: 4px;
        max-width: 100%;
    }
    /* 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 12px;
    }
    /* 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 */
    .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px;
    }
    .upload-modal {
        margin: 0px;
        padding: 10px;
        max-height: calc(100dvh - 16px);
        padding-bottom: 90px; /* Keep submit button above fixed mobile audio/nav bars */
    }
    .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;
        position: static;
    }
    /* 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;
    }
}

/* Desktop - Reset controls section to normal (1024px and above) */
@media (min-width: 1024px) {
    .controls-section {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-height: none !important;
        transition: none !important;
    }
    
    .controls-section.active {
        transform: none !important;
    }
}

@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;
    position: relative;
    flex-shrink: 0;
}
.toggle-btn {
    background: #fff;
    color: var(--selected-color, #000);
    border: 1.5px solid var(--selected-color, #000);
    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, #000);
    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, #000);
    background: #f0f8ff;
}
.performer-song-link {
    display: block;
    width: 100%;
    padding: 4px 12px;
    color: var(--selected-color, #000);
    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, #000);
    color: #fff;
    border-color: var(--selected-color, #000);
}
.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, #000);
    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 same size (square) */
.print-btn, .share-btn, #fullscreenSaveBtn, #fullscreenShareFavoritesBtn, #toggleChordsBtn, #exportXmlBtn, #exportPptxBtn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding: 0;
    margin: 0;
}

/* Control group with buttons - two rows layout */
.control-group:has(#printBtn) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 12px;
}

.control-group:has(#printBtn) .btn {
    flex: 0 0 calc(33.33% - 6px);
    max-width: 40px;
}
.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;
        display: none; /* Hide on mobile as we have bottom nav */
    }
}
@media (max-width: 480px) {
    .site-footer {
        font-size: 10px;
        height: 15px;
    }
}
/* Sidebar header layout for mobile - two column layout */
@media (max-width: 1024px) {
    .sidebar-header {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        align-items: start;
    }
    
    .sidebar-logo-container {
        grid-row: 1 / 3;
        margin-bottom: 0;
        align-self: center;
    }
    
    .sidebar-logo {
        width: 60px;
        height: auto;
    }
    
    .add-song-btn {
        grid-column: 2;
        grid-row: 1;
        margin-bottom: 0;
    }
    
    .search-box {
        grid-column: 2;
        grid-row: 2;
    }
}

/* Sidebar header layout for large screens */
@media (min-width: 1025px) {
    .sidebar-header {
        display: flex;
        flex-direction: column;
    }
} 

.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: 0;
    padding: 60px 0;
    padding-top: 0;
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 2;
    text-align: center;
    width: 100%;
    max-width: 100%;
}
#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: #ffe082 !important;
    font-size: 2.5vw !important;
    font-weight: 700 !important;
    margin: 40px 0 30px 0 !important;
}
#fullscreenOverlay.dark-theme .chord-line {
    display: none !important;
}
#fullscreenOverlay.dark-theme .lyrics-line {
    font-size: 3.2vw !important; /* 20% smaller: 4vw * 0.8 = 3.2vw */
    font-weight: 600 !important;
    line-height: 1.2 !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: 0;
    padding: 60px 0;
    padding-top: 0;
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 2;
    text-align: center;
    width: 100%;
    max-width: 100%;
}
#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, #000) !important;
    font-size: 2.5vw !important;
    font-weight: 700 !important;
    margin: 40px 0 30px 0 !important;
}
#fullscreenOverlay.light-theme .chord-line {
    display: none !important;
}
#fullscreenOverlay.light-theme .lyrics-line {
    font-size: 3.2vw !important; /* 20% smaller: 4vw * 0.8 = 3.2vw */
    font-weight: 600 !important;
    line-height: 1.2 !important;
}
#fullscreenOverlay.light-theme .chord {
    color: var(--selected-color, #000) !important;
}

/* Responsive fullscreen for tablets and mobile devices */
@media (max-width: 1024px) and (orientation: portrait) {
    #fullscreenOverlay.dark-theme .lyrics-line,
    #fullscreenOverlay.light-theme .lyrics-line {
        font-size: 4vw !important; /* 20% smaller: 5vw * 0.8 = 4vw */
    }
    #fullscreenOverlay.dark-theme .section-header,
    #fullscreenOverlay.light-theme .section-header {
        font-size: 3vw !important;
        margin: 30px 0 20px 0 !important;
    }
}

@media (max-width: 1024px) and (orientation: portrait) {
    #fullscreenOverlay.dark-theme .lyrics-line,
    #fullscreenOverlay.light-theme .lyrics-line {
        font-size: 4.8vw !important; /* 20% smaller: 6vw * 0.8 = 4.8vw */
        padding: 0 !important;
    }
    #fullscreenOverlay.dark-theme .section-header,
    #fullscreenOverlay.light-theme .section-header {
        font-size: 4vw !important;
        margin: 20px 0 15px 0 !important;
    }
    .fullscreen-lyrics {
        padding: 20px 0 !important;
    }
    #fullscreenOverlay .fullscreen-content {
        padding: 0 0 110px 0 !important; /* Bottom padding for mobile audio player + bottom nav */
    }
}

@media (max-width: 480px) {
    #fullscreenOverlay.dark-theme .lyrics-line,
    #fullscreenOverlay.light-theme .lyrics-line {
        font-size: 5.6vw !important; /* 20% smaller: 7vw * 0.8 = 5.6vw */
        padding: 0 !important;
    }
    #fullscreenOverlay.dark-theme .section-header,
    #fullscreenOverlay.light-theme .section-header {
        font-size: 5vw !important;
        margin: 15px 0 10px 0 !important;
    }
    .fullscreen-lyrics {
        padding: 15px 0 !important;
    }
    #fullscreenOverlay .fullscreen-content {
        padding: 0 0 110px 0 !important; /* Bottom padding for mobile audio player + bottom nav */
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loading-logo {
    width: 144px;
    height: auto;
    opacity: 0.9;
}

.loading-animation {
    width: 80px;
    height: auto;
}

/* Modern Spinner Animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 123, 255, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }
}

@media (max-width: 768px) {
  /*.search-box {
    margin-left: 44px;
    width: 87%;
  }*/
  /*.add-song-btn {
    margin-left: 44px;
    width: 50%;
  }
    */
}

@media (min-width: 1025px) {
  .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, #000);
    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 (min-width: 306px) and (max-width: 768px) {
  /* Hide these buttons in their original positions */
  .container #lyricsFullscreenBtn,
  .container #playerBtn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  /* Show them when inside mobile bottom nav - same as tablet range */
  .mobile-bottom-nav #lyricsFullscreenBtn,
  .mobile-bottom-nav #playerBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    min-height: 34px !important;
    max-height: 34px !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, #playerBtn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Hide these buttons in tablet range (769-1023px) - they appear in mobile bottom nav instead */
@media (min-width: 769px) and (max-width: 1023px) {
  .container #lyricsFullscreenBtn,
  .container #playerBtn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  /* But show them in mobile bottom nav */
  .mobile-bottom-nav #lyricsFullscreenBtn,
  .mobile-bottom-nav #playerBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    min-height: 34px !important;
    max-height: 34px !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: #888;
    margin-right: 8px;
    transition: color 0.2s;
    vertical-align: middle;
}
.favourite-icon.favourited {
    color: #28a745;
    text-shadow: 0 0 2px rgba(40, 167, 69, 0.5);
}
.favourite-icon:hover {
    color: #666;
}
#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: #888;
    margin-right: 4px;
}
.count-badge {
  background: white;
  color: black;
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
#shareFavouritesBtn {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#addNoteBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
#shareFavouritesBtn:hover {
  background: #bbdefb;
  color: #1976d2;
}
#clearFavouritesBtn {
  background: #ffeaea;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#clearFavouritesBtn:hover {
  background: #ffcdd2;
  color: #b71c1c;
}

/* Style add note button with light green background and dark green text */
#addNoteBtn {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
    font-weight: 600;
}
#addNoteBtn:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Ensure addNoteBtn keeps its style in dark mode */
body.dark-mode #addNoteBtn {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}
body.dark-mode #addNoteBtn:hover {
    background: #c8e6c9;
}

/* Favourite actions container - ensure proper display on all devices */
#favouriteActionsContainer {
  width: 100%;
  box-sizing: border-box;
}

/* Ensure both buttons are equal width and visible when shown */
#favouriteActionsContainer #shareFavouritesBtn,
#favouriteActionsContainer #clearFavouritesBtn {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}

#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;
}

#playerBtn.fullscreen-btn {
    position: absolute; 
    top: 16px; 
    right: 60px; 
    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;
    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 !important;
  bottom: 30px !important;
  right: 32px !important;
  display: flex !important;
  gap: 12px !important;
  z-index: 5001 !important;
  pointer-events: none !important;
}

#fullscreenPrevBtn,
#fullscreenNextBtn,
.fullscreen-nav-btn {
  position: relative !important;
  background: var(--selected-color, #000) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  border-radius: 50% !important;
  width: 56px !important;
  height: 56px !important;
  font-size: 32px !important;
  font-weight: bold !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  transition: all 0.2s !important;
  z-index: 5002 !important;
  pointer-events: auto !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: visible !important;
}

#fullscreenPrevBtn:hover,
#fullscreenNextBtn:hover,
.fullscreen-nav-btn:hover {
  background: var(--selected-color-hover, #2980b9) !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  transform: scale(1.1) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
}

/* Ensure buttons have higher z-index when fullscreen is active */
#fullscreenOverlay.active ~ .fullscreen-nav-btns {
  z-index: 10020 !important;
}

#fullscreenOverlay.dark-theme.active ~ .fullscreen-nav-btns #fullscreenPrevBtn,
#fullscreenOverlay.dark-theme.active ~ .fullscreen-nav-btns #fullscreenNextBtn {
  background: rgba(0, 0, 0, 0.8) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

#fullscreenOverlay.light-theme.active ~ .fullscreen-nav-btns #fullscreenPrevBtn,
#fullscreenOverlay.light-theme.active ~ .fullscreen-nav-btns #fullscreenNextBtn {
  background: rgba(0, 0, 0, 0.8) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

/* Mobile responsive positioning */
@media (max-width: 1024px) and (orientation: portrait) {
  .fullscreen-nav-btns {
    bottom: 160px !important;
    right: 20px !important;
    flex-direction: column !important;
    gap: 10px !important;
    transition: bottom 0.3s ease !important;
  }
  
  /* Move buttons up when controls panel is active */
  .fullscreen-nav-btns.controls-active {
    bottom: calc(60vh + 20px) !important;
  }
  
  #fullscreenPrevBtn,
  #fullscreenNextBtn,
  .fullscreen-nav-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 28px !important;
  }
}

@media (min-width: 1024px) and (orientation: landscape), (min-width: 1200px) {
    .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;
}

#playerBtn {
    width: 36px !important;
    height: 36px !important;
    border: solid 1px #ffffff !important;
    box-shadow: none !important;
    border-radius: 4px !important;
}

#mobileNavToggle {
    border: solid 2px #ffffff !important;
}

.add-sign {
    font-size: 20px;
    font-weight: bold;
}

/* Mobile Bottom Navigation Panel */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    padding: 12px 16px; /* Increased horizontal padding */
    display: none; /* Hidden by default, shown only on mobile/tablet */
    justify-content: center;
    align-items: center;
    gap: 20px; /* Increased from 10px to 20px for much better touch targets */
    z-index: 10000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

.mobile-bottom-nav button,
.mobile-bottom-nav .mobile-nav-toggle,
.mobile-bottom-nav .controls-toggle,
.mobile-bottom-nav .fullscreen-btn,
.mobile-bottom-nav .fullscreen-nav-btn,
.mobile-bottom-nav #fullscreenPrevBtn,
.mobile-bottom-nav #fullscreenNextBtn,
.mobile-bottom-nav #lyricsFullscreenBtn,
.mobile-bottom-nav #playerBtn {
    background: var(--selected-color, #000) !important;
    color: white !important;
    border: 2px solid white !important;
    border-radius: 8px !important;
    padding: 0 !important;
    font-size: 18px !important;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.mobile-bottom-nav button:hover {
    opacity: 0.9 !important;
}

.mobile-bottom-nav button:active {
    opacity: 0.8 !important;
}

.mobile-bottom-nav button.active {
    opacity: 1 !important;
}

/* Dark mode for bottom nav */
body.dark-mode .mobile-bottom-nav {
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .mobile-bottom-nav button {
    background: var(--selected-color, #000) !important;
    color: white !important;
    border: 2px solid white !important;
}

body.dark-mode .mobile-bottom-nav button:hover {
    opacity: 0.9 !important;
}

body.dark-mode .mobile-bottom-nav button:active {
    opacity: 0.8 !important;
}

body.dark-mode .mobile-bottom-nav button.active {
    opacity: 1 !important;
}

/* Show mobile bottom nav on mobile and portrait tablets */
@media (max-width: 1024px) and (orientation: portrait) {
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10000 !important;
    }
    
    .mobile-audio-player {
        display: block !important;
        position: fixed !important;
        bottom: 56px !important; /* button height (34px) + nav padding (11px top + 11px bottom = 22px) */
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 6px 8px !important;
        background: var(--selected-color, #000) !important;
        box-shadow: none !important;
        border-bottom: none !important;
        box-sizing: border-box !important;
    }
    
    .mobile-audio-player audio {
        width: 100% !important;
        height: 28px !important;
        border-radius: 4px !important;
        max-width: 100% !important;
    }
}

/* Mobile and Tablet range (306px - 1023px) - Consistent button spacing */
@media (min-width: 306px) and (max-width: 1023px) {
    .mobile-bottom-nav {
        padding: 11px 15px !important;
        gap: 20px !important;
        justify-content: center !important;
    }
    
    .mobile-bottom-nav button {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        font-size: 15px !important;
        border-radius: 8px !important;
        border: 2px solid white !important;
        background: var(--selected-color, #000) !important;
        color: white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    /* Override specific button classes to match consistent styling */
    .mobile-bottom-nav .mobile-nav-toggle,
    .mobile-bottom-nav .controls-toggle,
    .mobile-bottom-nav .fullscreen-btn,
    .mobile-bottom-nav .fullscreen-nav-btn,
    .mobile-bottom-nav #fullscreenPrevBtn,
    .mobile-bottom-nav #fullscreenNextBtn,
    .mobile-bottom-nav #lyricsFullscreenBtn,
    .mobile-bottom-nav #playerBtn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        max-width: 34px !important;
        min-height: 34px !important;
        max-height: 34px !important;
        font-size: 15px !important;
        border-radius: 8px !important;
        border: 2px solid white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/* Extra small screens - prevent button overflow */
@media (max-width: 305px) {
    .mobile-bottom-nav {
        padding: 8px 4px !important;
        gap: 8px !important;
    }
    
    .mobile-bottom-nav button {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        font-size: 14px !important;
        border-radius: 6px !important;
        border: 2px solid white !important;
        background: var(--selected-color, #000) !important;
        color: white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    /* Override specific button classes to match consistent styling */
    .mobile-bottom-nav .mobile-nav-toggle,
    .mobile-bottom-nav .controls-toggle,
    .mobile-bottom-nav .fullscreen-btn,
    .mobile-bottom-nav .fullscreen-nav-btn,
    .mobile-bottom-nav #fullscreenPrevBtn,
    .mobile-bottom-nav #fullscreenNextBtn,
    .mobile-bottom-nav #lyricsFullscreenBtn,
    .mobile-bottom-nav #playerBtn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        font-size: 14px !important;
        border-radius: 6px !important;
        border: 2px solid white !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    /* Adjust audio player position for smaller bottom nav */
    .mobile-audio-player {
        bottom: calc(32px + 16px) !important; /* button height (32px) + nav padding (8px top + 8px bottom) */
    }
}

/* Landscape tablets and desktop - Show desktop layout when width > height */
/* This catches iPad mini/iPad landscape (1024x768), iPad landscape (1080x810), etc. */
@media (min-width: 1024px) and (max-height: 768px) and (orientation: landscape) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .mobile-audio-player {
        display: none !important;
    }
    
    .container {
        flex-direction: row !important;
    }
    
    .sidebar {
        position: relative !important;
        left: 0 !important;
        width: 280px !important;
    }
    
    .middle-section {
        display: flex !important;
    }
}

/* iPad Air and iPad Pro Portrait - Force mobile layout for portrait orientation */
/* iPad Air: 820x1180, iPad Pro: 1024x1366 */
@media (min-width: 820px) and (max-width: 1024px) and (min-height: 1100px) and (orientation: portrait) {
    .container {
        flex-direction: column !important;
    }
    
    .middle-section {
        display: none !important;
    }
    
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 14px 12px !important; /* Slightly more padding for tablets */
        gap: 20px !important;
    }
    
    .mobile-bottom-nav button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        font-size: 20px !important;
    }
    
    .mobile-audio-player {
        display: block !important;
        position: fixed !important;
        bottom: 72px !important; /* 44px buttons + 28px padding (14px top + 14px bottom) */
        left: 0 !important;
        right: 0 !important;
        padding: 8px 12px !important;
    }
    
    .lyrics-section {
        padding-bottom: 130px !important; /* More space for larger buttons */
    }
    
    .controls-section {
        bottom: 116px !important; /* Adjust for larger bottom nav */
    }
}

/* Large screens (desktops) - Always show desktop layout */
@media (min-width: 1200px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .mobile-audio-player {
        display: none !important;
    }
    
    .container {
        flex-direction: row !important;
    }
    
    .sidebar {
        position: relative !important;
        left: 0 !important;
        width: 280px !important;
    }
    
    .middle-section {
        display: flex !important;
    }
}
