/* /* =========================================
   1. CORE STYLES & RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
   -webkit-tap-highlight-color: transparent;
   -webkit-touch-callout: none;
   -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    
    /* FLEXBOX LAYOUT: Keeps footer at bottom */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0; 
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    width: 100%;
    flex: 1 0 auto; /* Pushes footer down */
}

/* =========================================
   2. HEADER
   ========================================= */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin-top: 60px; 
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.2rem;
    color: #aaa;
}

/* =========================================
   3. SEARCH SECTION
   ========================================= */
.search-container {
    margin-bottom: 40px;
    position: relative;
    transition: all 0.3s ease;
}

.search-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    transition: all 0.3s;
}

.search-options {
    margin-top: 15px;
    display: flex;
    align-items: center;
}

.toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.toggle-container input { display: none; }

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-container input:checked + .toggle-slider {
    background-color: #4ecdc4;
}

.toggle-container input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #aaa;
    transition: 0.3s;
}

.toggle-container input:checked ~ .toggle-label {
    color: #fff;
}

#search-input:focus {
    border-color: #4ecdc4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

.search-filters {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover { background: rgba(255, 255, 255, 0.2); }
.filter-btn.active { background: linear-gradient(45deg, #ff6b6b, #4ecdc4); }

/* --- CANCEL BUTTON (Hidden by default) --- */
.search-cancel-btn {
    display: none !important; 
    color: #ff6b6b;
    margin-left: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.search-results.hidden { display: none; }

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.search-result-item:hover { background: rgba(78, 205, 196, 0.2); }
.search-result-item h3 { font-size: 1.1rem; margin-bottom: 5px; }
.search-result-item .meta { font-size: 0.9rem; color: #aaa; }

/* =========================================
   4. SONG DISPLAY & LYRICS
   ========================================= */
.song-display {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    animation: fadeIn 0.5s;
    touch-action: manipulation;
}

.song-display.hidden { display: none; }

.song-header { margin-bottom: 20px; }
.song-header h2 { font-size: 2rem; margin-bottom: 10px; color: #4ecdc4; }

.song-meta { display: flex; gap: 10px; }
.language-tag, .category-tag {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
}

.song-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    flex-wrap: wrap;
    align-items: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

.song-lyrics {
    font-size: 1.2rem;
    line-height: 1.8;
    white-space: pre-wrap; 
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* =========================================
   5. SETTINGS MENU (Glass Capsule Design)
   ========================================= */
/* =========================================
   5. SETTINGS MENU (Glass Capsule Design)
   ========================================= */
.settings-menu {
    position: absolute;
    bottom: 130%; /* Move it slightly higher */
    left: 50%;
    transform: translateX(-50%);
    
    /* Glass Effect */
    background: rgba(20, 20, 20, 0.95); /* More opaque for readability */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Border & Glow */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space items evenly */
    gap: 8px; /* Reduce gap slightly */
    padding: 6px 10px; /* Tighter padding */
    z-index: 100;
    
    /* FIX: Stop it from being wider than screen on mobile */
    min-width: 200px; 
    max-width: 90vw; 
    white-space: nowrap;
    
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-menu.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
}

/* Circular -/+ Buttons */
.settings-menu .font-btn {
    width: 42px; /* Fixed width */
    height: 42px; /* Fixed height */
    flex-shrink: 0; /* Prevent shrinking */
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none; 
}

/* Reset Button (Pill Shape) */
.settings-menu .font-btn.reset {
    width: auto;
    height: 36px;
    padding: 0 16px; /* Comfortable padding */
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Arrow */
.settings-menu::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(20, 20, 20, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
/* ✅ NEW — Replace with this */
body.presentation-active > *:not(#presentation-screen) {
    visibility: hidden;
    pointer-events: none;   /* extra safety — blocks stray clicks underneath */
}

/* ✅ Make sure everything INSIDE presentation stays fully interactive */
#presentation-screen,
#presentation-screen * {
    pointer-events: auto;
    visibility: visible;
}


/* =========================================
   6. PRESENTATION MODE (PRO CINEMA STYLE)
   ========================================= */
.presentation-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    
    /* Deep Radial Gradient for Focus (Vignette Effect) */
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: manipulation; 
}

.presentation-mode.hidden { display: none; }

.presentation-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    
    /* Safe Zone: Large bottom padding prevents text from hitting buttons */
    padding: 40px;
    padding-bottom: 150px; 
    
    /* FLUID TYPOGRAPHY: Updated Limits */
    /* Min: 2rem, Preferred: 5vw, Max: 5rem (Stops growing earlier) */
    font-size: clamp(2rem, 5vw, 5rem); 
    
    line-height: 1.3;
    font-weight: 700;
    color: #fff;
    white-space: pre-wrap;
    text-shadow: 0 4px 20px rgba(0,0,0,0.9);
    
    /* Limit width for readability */
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-y: auto;
    
    /* HIDE SCROLLBARS (But allow scrolling) */
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

/* Hide Scrollbar for Chrome, Safari and Opera */
.presentation-content::-webkit-scrollbar {
    display: none;
}

/* Floating Glass Control Deck */
.presentation-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;     /* ✅ Center ALL buttons */
    gap: 10px;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 10;
    flex-wrap: nowrap;      
}

.presentation-controls:hover {
    transform: translateX(-50%) translateY(-5px);
    background: rgba(40, 40, 40, 0.8);
}

.presentation-controls button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.presentation-controls button:hover {
    background: #4ecdc4;
    color: #000;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
    border-color: #4ecdc4;
    transform: scale(1.15);
}

.presentation-controls button:active { transform: scale(0.9); }

.font-btn { font-size: 1rem !important; font-weight: 800; }

#exit-presentation { 
    margin-left: 10px;
    background: rgba(255, 107, 107, 0.15); 
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

#exit-presentation:hover {
    background: #ff6b6b;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

/* =========================================
   7. ANIMATIONS & RESPONSIVE
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    header h1 { font-size: 2rem; }
    .song-controls { flex-direction: column; align-items: stretch; }
    .settings-menu { left: 50%; transform: translateX(-50%); bottom: 100%; width: 100%; margin-bottom: 10px; }
    
    /* Presentation specific mobile tweaks */
    .presentation-content { 
        padding: 20px; 
        padding-bottom: 100px; /* Safe zone */
    }
    .presentation-controls { 
        bottom: 30px; 
        padding: 8px 20px;
        gap: 12px;
        width: 90%; 
        justify-content: space-around;
    }
    .presentation-controls button { width: 45px; height: 45px; font-size: 1.2rem; }
}

/* =========================================
   8. FOOTER (REMOVED)
   ========================================= */
.admin-link {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 50px;
}

.admin-link a {
    color: #4ecdc4;
    text-decoration: none;
    font-size: 1.1rem;
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #4ecdc4;
    border-radius: 10px;
    transition: all 0.3s;
}

.admin-link a:hover { background: rgba(78, 205, 196, 0.1); }

/* =========================================
   9. HOLOGRAPHIC THEME
   ========================================= */
.glow-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4ecdc4;
    color: #4ecdc4;
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.glow-btn:hover {
    background: rgba(78, 205, 196, 0.1);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.4);
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.8);
}

.glass-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    z-index: 2000;
    padding: 30px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.glass-sidebar.active { transform: translateX(0); }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.sidebar-header h3 { margin: 0; color: #fff; font-weight: 300; letter-spacing: 1px; }

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.close-btn:hover { opacity: 1; color: #ff6b6b; transform: rotate(90deg); }

.holo-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.holo-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(78, 205, 196, 0.3);
    transform: translateX(-5px);
}

.holo-card h4 { margin: 0 0 5px 0; color: #e0e0e0; font-size: 1rem; }
.holo-card small { color: #666; display: block; margin-bottom: 10px; }
.holo-actions { display: flex; gap: 10px; margin-top: 10px; }

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-load { background: rgba(78, 205, 196, 0.2); color: #4ecdc4; }
.btn-load:hover { background: #4ecdc4; color: #000; }
.btn-del { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.btn-del:hover { background: #ff6b6b; color: #fff; }

@media (max-width: 600px) {
    .glass-sidebar { width: 100%; }
}

/* =========================================
   10. MOBILE & TABLET SEARCH FOCUS MODE
   ========================================= */

/* UPDATED: Increased to 1400px to catch iPad Pro Landscape (1366px) */
@media (max-width: 1400px) {
    
    body.search-focused {
        overflow: hidden;
    }

    /* Hide everything else when searching */
    body.search-focused header,
    body.search-focused .song-display,
    body.search-focused .admin-link,
    body.search-focused #auth-ui {
        display: none !important;
    }

    /* Move Search Container to Full Screen Top */
    body.search-focused .search-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 5000;
        background: rgba(10, 12, 16, 0.95);
        backdrop-filter: blur(15px);
        padding: 20px;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* FLEXBOX FIX: Organize layout for smaller screens */
    body.search-focused .search-box {
        display: flex;
        flex-wrap: wrap;      
        align-items: center;
        gap: 15px;            
        background: transparent;
        padding: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    /* 1. Input Field (Top Left) */
    body.search-focused #search-input {
        order: 1;
        flex: 1;              
        width: auto !important;
        margin: 0;
        height: 50px;         
    }

    /* 2. Cancel Button (Top Right) */
    body.search-focused .search-cancel-btn {
        order: 2;
        display: block !important;
        white-space: nowrap;
        padding: 10px 15px;   
        margin: 0;
        font-size: 1.1rem;    
    }

    /* 3. Toggle Switch (New Line) */
    body.search-focused .search-options {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }

    /* 4. Filter Buttons (Last Line) */
    body.search-focused .search-filters {
        order: 4;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }

    /* Adjust Search Results Scroll Area */
    body.search-focused .search-results {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 220px); 
        overflow-y: auto;
        margin-top: 25px;
        padding-bottom: 100px; /* Extra padding for bottom safe area */
        box-shadow: none;
        background: transparent;
    }
}

/* =========================================
   11. ADMIN PANEL STYLES
   ========================================= */

/* Back Link (Top Left) */
.back-nav {
    margin-bottom: 20px;
}

.back-nav a {
    color: #4ecdc4;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: transform 0.3s ease, color 0.3s ease;
}

.back-nav a:hover {
    color: #fff;
    transform: translateX(-5px); /* Slide left effect */
}

/* Main Admin Container (Glass Box) */
.admin-wrapper {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.admin-header h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 10px;
}

.admin-header p {
    color: #aaa;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4ecdc4; /* Teal accent */
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit; /* Matches body font */
}

.form-control:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.2);
}

/* Dropdown specific styling */
/* ✅ FIXED */
select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234ecdc4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
}

/* Textarea styling */
textarea.form-control {
    min-height: 250px;
    resize: vertical;
    line-height: 1.6;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Mobile Responsiveness for Admin */
@media (max-width: 768px) {
    .admin-wrapper {
        padding: 20px;
    }
    
    /* Stack the grid columns (Language/Category) on mobile */
    .admin-wrapper div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
}

/* ─────────────────────────────────────────────────
   PRESENTATION SCREEN — Single Full-Screen Layer
───────────────────────────────────────────────── */

/* =====================================================
   PRESENTATION SCREEN — Mobile-First Complete CSS
   ===================================================== */

#presentation-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow: hidden;
    /* ✅ Disable ALL touch zoom inside presentation */
    touch-action: pan-x pan-y;
}

#presentation-screen.active {
    display: flex;
    flex-direction: column;
}

/* ── Canvas (ripple background) ── */
#presentation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* ── Dark overlay ── */
#presentation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
    pointer-events: none;
}

/* ── Content wrapper ── */
#presentation-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* 
      ✅ Use dvh (dynamic viewport height) on mobile so 
      browser chrome (address bar) is accounted for.
      Falls back to 100% for older browsers.
    */
    height: 100%;
    height: 100dvh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* Top pad clears close btn | Bottom pad clears controls */
    padding: 64px 24px 80px;
    overflow: hidden;
    /* ✅ Prevent double-tap zoom on content */
    touch-action: manipulation;
}

/* ── ✕ Close Button ── */
#presentation-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.30);
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
    /* ✅ Prevent zoom on double tap */
    touch-action: manipulation;
    z-index: 20;
}

#presentation-close:hover,
#presentation-close:active {
    background: rgba(220, 60, 60, 0.55);
}

/* ── Lyrics Block ── */
#presentation-lyrics {
    color: #ffffff;
    /* ✅ Center aligned — fixes left-align issue */
    text-align: center;
    line-height: 1.80;
    white-space: pre-wrap;
    word-break: break-word;
    /* ✅ clamp() keeps font readable on all screen sizes */
    font-size: clamp(1.0rem, 4.5vw, 2.0rem);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.92);
    max-width: 820px;
    width: 100%;
    /* 
      ✅ flex-grow so lyrics take all space between
      close button and controls bar 
    */
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 8px;
    touch-action: manipulation;
}

/* ─────────────────────────────────────────────
   CONTROLS BAR — pinned bottom, fully centred
   ───────────────────────────────────────────── */
#presentation-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* 
      ✅ env(safe-area-inset-bottom) handles iPhone 
      home-bar notch so controls aren't hidden 
    */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    min-height: 64px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    background: rgba(0, 0, 0, 0.68);
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 10px;
    z-index: 20;
    /* ✅ Prevent zoom on double tap */
    touch-action: manipulation;
}

/* ── Prev / Next Buttons ── */
#prev-verse,
#next-verse {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.18s;
}

#prev-verse:hover,
#next-verse:hover {
    background: rgba(255, 255, 255, 0.22);
}

#prev-verse:disabled,
#next-verse:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

/* ── Verse Counter "1 / 8" ── */
#verse-counter {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    min-width: 44px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.04em;
}

/* ── Font Buttons  A− / A↺ / A+ ── */
.pres-font-btn {
    flex-shrink: 0;
    background: rgba(78, 205, 196, 0.12);
    border: 1px solid rgba(78, 205, 196, 0.40);
    color: #4ecdc4;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 7px 11px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.18s, transform 0.1s;
}

.pres-font-btn:hover {
    background: rgba(78, 205, 196, 0.26);
    transform: scale(1.06);
}

.pres-font-btn:active {
    transform: scale(0.94);
}

/* ── Very small phones (< 380px wide) ── */
@media (max-width: 380px) {
    #presentation-controls {
        gap: 6px;
        padding-left: 6px;
        padding-right: 6px;
    }

    #prev-verse,
    #next-verse {
        padding: 6px 9px;
        font-size: 0.74rem;
    }

    .pres-font-btn {
        padding: 5px 7px;
        font-size: 0.70rem;
    }

    #verse-counter {
        font-size: 0.72rem;
        min-width: 34px;
    }
}

/* ─────────────────────────────────────────────────
   CONTROLS BAR — pinned to bottom, fully centred
   ───────────────────────────────────────────────── */
#presentation-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    box-sizing: border-box;

    /* ✅ Flexbox centred layout */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;

    background: rgba(0, 0, 0, 0.60);
    padding: 0 24px;
    z-index: 20;
}

/* ── Prev / Next ── */
#prev-verse,
#next-verse {
    flex-shrink: 0;             /* ✅ Never collapse */
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.28);
    color: #ffffff;
    font-size: 0.90rem;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s;
}

#prev-verse:hover,
#next-verse:hover {
    background: rgba(255,255,255,0.22);
}

#prev-verse:disabled,
#next-verse:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

/* ── Verse counter  "1 / 3" ── */
#verse-counter {
    flex-shrink: 0;             /* ✅ Never collapse */
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    min-width: 48px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

/* ── Font size buttons  A− / A↺ / A+ ── */
.pres-font-btn {
    flex-shrink: 0;             /* ✅ Never collapse */
    background: rgba(78, 205, 196, 0.12);
    border: 1px solid rgba(78, 205, 196, 0.40);
    color: #4ecdc4;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s, transform 0.1s;
}

.pres-font-btn:hover {
    background: rgba(78, 205, 196, 0.28);
    transform: scale(1.06);
}

.pres-font-btn:active {
    transform: scale(0.94);
}

/* ── Small screen adjustments ── */
@media (max-width: 500px) {
    #presentation-controls {
        gap: 7px;
        padding: 0 10px;
    }

    #prev-verse,
    #next-verse {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .pres-font-btn {
        padding: 5px 8px;
        font-size: 0.74rem;
    }

    #verse-counter {
        font-size: 0.76rem;
        min-width: 38px;
    }
}

/* ─────────────────────────────────────────────────
   RESPONSIVE — Tablet / iPad / Mobile
───────────────────────────────────────────────── */
@media (max-width: 768px) {
    #presentation-lyrics {
        font-size: clamp(1rem, 4.5vw, 1.5rem);
        padding: 0 0.75rem;
    }

    #presentation-title {
        font-size: clamp(1.2rem, 5vw, 2rem);
        margin-bottom: 1rem;
    }

    #presentation-controls {
        bottom: 1.2rem;
        gap: 1rem;
    }

    #presentation-controls button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ══════════════════════════════════════════════════════
   PRESENTATION SCREEN
   ══════════════════════════════════════════════════════ */

/* Full-screen layer — hidden by default */
#presentation-screen {
    display: none;
    position: fixed;
    inset: 0;                    /* top/right/bottom/left = 0 */
    z-index: 9999;
    overflow: hidden;
}

/* Show when active */
#presentation-screen.active {
    display: block;
}

/* ── Layer 1: Ripple canvas ── */
#presentation-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* ── Layer 2: Dim overlay ── */
#presentation-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
    pointer-events: none;
}

/* ── Layer 3: Content wrapper ── */
#presentation-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;

    /* 
       Top padding clears the close button.
       Bottom padding clears the controls bar.
       Lyrics sit in the flex space in between.
    */
    padding: 70px 5vw 90px;
    box-sizing: border-box;
    overflow: hidden;            /* ✅ Prevents overflow beyond screen */
}

/* ── Close Button ── */
#presentation-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
    -webkit-tap-highlight-color: transparent; /* iPad fix */
}

#presentation-close:hover {
    background: rgba(255, 80, 80, 0.5);
}

/* ── Lyrics Block ── */
#presentation-lyrics {
    color: #ffffff;
    text-align: center;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;

    /*
       ✅ KEY FIX: flex-grow fills space between top padding
          and controls bar. overflow:hidden means it never
          pushes into the controls area.
    */
    flex: 1 1 auto;
    overflow: hidden;            /* ← Clips text that would hit controls */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Default font — JS will override per-verse */
    font-size: clamp(1.1rem, 3.2vw, 2.0rem);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
    padding: 0 2vw;
    max-width: 1100px;
    width: 100%;
}

/* ── Controls Bar (Prev / Counter / Font Btns / Next) ── */
/* ══════════════════════════════════════════════════════
   PRESENTATION CONTROLS BAR — Full Fix
   ══════════════════════════════════════════════════════ */

#presentation-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;     /* ✅ Center ALL buttons */
    gap: 10px;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 10;
    flex-wrap: nowrap;           /* ✅ Keep everything on one line */
}

/* ── Prev / Next Buttons ── */
#prev-verse,
#next-verse {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.30);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    flex-shrink: 0;              /* ✅ Never shrink or disappear */
}

#prev-verse:hover,
#next-verse:hover {
    background: rgba(255, 255, 255, 0.22);
}

#prev-verse:disabled,
#next-verse:disabled {
    opacity: 0.30;
    cursor: not-allowed;
}

/* ── Verse Counter  e.g. "1 / 3" ── */
#verse-counter {
    color: rgba(255, 255, 255, 0.80);   /* ✅ Brighter so it's visible */
    font-size: 0.88rem;
    font-weight: 400;
    min-width: 46px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;                     /* ✅ Never collapse */
    /* ✅ Removed flex:1 — that was pushing Prev off screen */
}

/* ── Presentation Font Buttons  A- / A↺ / A+ ── */
.pres-font-btn {
    background: rgba(78, 205, 196, 0.12);
    border: 1px solid rgba(78, 205, 196, 0.40);
    color: #4ecdc4;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    flex-shrink: 0;              /* ✅ Never shrink */
}

.pres-font-btn:hover {
    background: rgba(78, 205, 196, 0.28);
    transform: scale(1.07);
}

.pres-font-btn:active {
    transform: scale(0.95);
}

/* ── Responsive: smaller screens ── */
@media (max-width: 520px) {
    #presentation-controls {
        gap: 6px;
        padding: 0 8px;
    }

    #prev-verse,
    #next-verse {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .pres-font-btn {
        padding: 5px 8px;
        font-size: 0.74rem;
    }

    #verse-counter {
        font-size: 0.78rem;
        min-width: 36px;
    }
}

