:root {
    --primary: #2e7d32;
    --primary-grad: linear-gradient(135deg, #2e7d32, #1b5e20);
    --bg: #f8f9fa;
    --text: #2c3e50;
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass: rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --filter: none;
}

body.night-mode {
    --bg: #121212;
    --text: #e0e0e0;
    --card-bg: #1e1e1e;
    --glass: rgba(30, 30, 30, 0.9);
    --filter: invert(0.92) hue-rotate(180deg) brightness(0.9) contrast(1.1);
}

body {
    background: var(--bg); color: var(--text);
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0; overflow: hidden;
    user-select: none; -webkit-user-select: none;
}

/* --- GLASSMORPHISM CLASSES --- */
.glass-effect {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
}

/* --- ZEN MODE LOGIC --- */
/* Hide UI elements */
body.zen-active .top-bar, 
body.zen-active .nav-btns, 
body.zen-active .progress-container { display: none !important; }

/* Show Exit Button */
#zenExitBtn { display: none; }
body.zen-active #zenExitBtn { display: flex; }

.zen-exit-btn {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6); color: white;
    border: none; padding: 10px 20px; border-radius: 30px;
    font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
    backdrop-filter: blur(5px);
}

/* --- MAIN CONTAINER & ZOOM --- */
.quran-container {
    width: 100%; height: 100vh; overflow: auto;
    display: flex; justify-content: center; align-items: flex-start;
    padding-top: 60px; padding-bottom: 80px;
    box-sizing: border-box; touch-action: pan-x pan-y;
}

body.zen-active .quran-container { padding: 0; }

.quran-frame { transition: transform 0.3s ease; transform-origin: center top; }
.zoomed { transform: scale(2.0); margin-top: 50px; }

#pdf-render {
    width: 100%; max-width: 600px; height: auto;
    filter: var(--filter); display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* --- NAVIGATION (Swapped) --- */
.nav-btns {
    position: fixed; bottom: 20px; width: 90%; left: 5%;
    display: flex; justify-content: space-between; gap: 15px; z-index: 100;
    border-radius: 20px; padding: 10px; box-sizing: border-box;
    flex-direction: row-reverse; /* SWAP MAGIC */
}

.nav-btn {
    flex: 1; background: var(--primary-grad); color: white;
    border: none; padding: 12px; border-radius: 12px;
    font-weight: 600; font-size: 16px; display: flex; justify-content: center; align-items: center; gap: 10px;
}
.nav-btn:active { transform: scale(0.98); }

/* --- TOP BAR --- */
.top-bar {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; box-sizing: border-box; z-index: 100;
}
.icon-btn { background: none; border: none; font-size: 20px; color: var(--text); padding: 8px; }
.info-box { font-weight: bold; font-size: 18px; }

/* --- SIDEBAR --- */
.sidebar { height: 100%; width: 0; position: fixed; top: 0; left: 0; background: var(--card-bg); overflow-y: auto; transition: 0.3s; z-index: 300; }
.sidebar-header { background: var(--primary-grad); color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.sidebar-content { padding: 20px; display: flex; flex-direction: column; gap: 15px; }

select, input {
    width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #ddd;
    background: var(--bg); color: var(--text); font-size: 16px;
    box-sizing: border-box;
}

/* --- OVERLAYS --- */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 250; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.overlay-card { width: 85%; max-width: 350px; padding: 30px; border-radius: 20px; text-align: center; }
.overlay-card label { display: block; text-align: left; margin-top: 15px; font-weight: 600; }

.btn-primary { background: var(--primary-grad); color: white; border: none; padding: 12px; width: 100%; margin-top: 20px; border-radius: 10px; font-size: 16px; }
.btn-secondary { background: transparent; border: 1px solid #999; color: var(--text); padding: 10px; width: 100%; margin-top: 10px; border-radius: 10px; }

/* Progress Bar */
.progress-container { position: fixed; top: 60px; width: 100%; height: 3px; z-index: 90; }
.progress-bar { height: 100%; background: #2e7d32; width: 0%; transition: 0.3s; }
.progress-track { background: #eee; height: 10px; border-radius: 5px; overflow: hidden; }
.progress-fill { background: #2e7d32; height: 100%; width: 0%; transition: width 0.3s; }

.bookmarks-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.action-btn { background: var(--bg); border: 1px solid #ccc; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
          
