/* ═══════════════════════════════════════════════════════════════════════════════
   SEHAJ PAATH READER — STABLE iOS BOOK-STYLE READING
   No animations • Solid backgrounds • Custom Gurmukhi fonts
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   CUSTOM FONTS — from nitnem/g-fonts
   ═══════════════════════════════════════════════════════════════════════════════ */

@font-face {
    font-family: 'PG Serif';
    src: url('../nitnem/g-fonts/pg_serif_r.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: optional;
}

@font-face {
    font-family: 'PG Serif';
    src: url('../nitnem/g-fonts/pg_serif_s.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: optional;
}

@font-face {
    font-family: 'MFJashan';
    src: url('../nitnem/g-fonts/mffjashan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: optional;
}

@font-face {
    font-family: 'PG Khanna';
    src: url('../nitnem/g-fonts/pg_khanna_c_6.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: optional;
}

@font-face {
    font-family: 'Pixel R';
    src: url('../nitnem/g-fonts/pixel_r_21.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: optional;
}

@font-face {
    font-family: 'Riyasti Naveen';
    src: url('../nitnem/g-fonts/riyasti-naveen.woff2') format('woff2'),
         url('../nitnem/g-fonts/riyasti-naveen.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: optional;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — iOS Book Style, No animations
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Dark Theme — Solid backgrounds, no gradients */
    --bg-primary: #0a0a0c;
    --bg-secondary: #161618;
    --bg-content: #0a0a0c;

    /* UI surfaces — subtle, no blur */
    --ui-bg: rgba(255, 255, 255, 0.05);
    --ui-border: rgba(255, 255, 255, 0.12);
    --ui-bg-light: rgba(0, 0, 0, 0.03);
    --ui-border-light: rgba(0, 0, 0, 0.08);

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.40);

    --text-gurmukhi: #FFE4B5;
    --translation-color: rgba(200, 210, 230, 0.85);
    --transliteration-color: rgba(180, 170, 200, 0.80);

    --accent: #C9A227;
    --accent-light: #B8860B;

    /* Font families - Default to standard Noto Sans Gurmukhi */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    --font-gurmukhi: 'Noto Sans Gurmukhi', 'PG Serif', sans-serif;
    --gurmukhi-size: 24px;
    --line-height: 2.2;

    /* Spacing */
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 34px);
    --header-height: 60px;
    --footer-height: 70px;

    /* Timing */
    --ease-ios: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   THEMES — Only Dark + Light, solid colors
   ═══════════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
    --bg-primary: #0a0a0c;
    --bg-secondary: #161618;
    --bg-content: #0a0a0c;
    --ui-bg: rgba(255, 255, 255, 0.05);
    --ui-border: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.40);
    --text-gurmukhi: #FFE4B5;
    --translation-color: rgba(200, 210, 230, 0.85);
    --transliteration-color: rgba(180, 170, 200, 0.80);
    --accent: #C9A227;
}

[data-theme="light"] {
    --bg-primary: #FAF9F7;
    --bg-secondary: #FFFFFF;
    --bg-content: #FAF9F7;
    --ui-bg: rgba(0, 0, 0, 0.03);
    --ui-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1C1917;
    --text-secondary: rgba(0, 0, 0, 0.55);
    --text-tertiary: rgba(0, 0, 0, 0.35);
    --text-gurmukhi: #1E3A5F;
    --translation-color: #4A5568;
    --transliteration-color: #6B46C1;
    --accent: #B8860B;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BASE RESET — NO FLICKER
   ═══════════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY — Static, no animations
   ═══════════════════════════════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-text {
    font-family: var(--font-gurmukhi);
    color: var(--text-gurmukhi);
    font-size: 18px;
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   READER CONTAINER
   ═══════════════════════════════════════════════════════════════════════════════ */

.reader-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HEADER — Stable, solid background
   ═══════════════════════════════════════════════════════════════════════════════ */

.reader-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding-top: var(--safe-top);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--ui-border);
    transform: translateY(0);
    transition: transform 0.3s var(--ease-ios);
}

.reader-header.hidden {
    transform: translateY(-100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: var(--header-height);
}

.header-btn {
    width: 40px;
    height: 40px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-btn:active {
    opacity: 0.7;
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ang-label {
    font-family: var(--font-gurmukhi);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.ang-number {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SEEK BAR
   ═══════════════════════════════════════════════════════════════════════════════ */

.seek-bar-container {
    padding: 0 16px 12px;
}

.seek-bar {
    width: 100%;
    height: 4px;
    background: var(--ui-border);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════════ */

.gurbani-content {
    flex: 1;
    overflow: hidden;
    padding-top: calc(var(--header-height) + var(--safe-top) + 10px);
    padding-bottom: calc(var(--footer-height) + var(--safe-bottom) + 10px);
}

.reader-container.fullscreen-reading .gurbani-content {
    padding-top: 10px;
    padding-bottom: 10px;
}

.gurbani-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 16px;
    overscroll-behavior: contain;

    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    will-change: scroll-position;
    contain: layout style;
}

/* Minimal scrollbar */
.gurbani-scroll::-webkit-scrollbar {
    width: 3px;
}
.gurbani-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.gurbani-scroll::-webkit-scrollbar-thumb {
    background: var(--ui-border);
    border-radius: 2px;
}

/* Custom Scrollbar */
.gurbani-scroll::-webkit-scrollbar {
    width: 4px;
}
.gurbani-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.gurbani-scroll::-webkit-scrollbar-thumb {
    background: var(--ui-border);
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SECTION HEADER — RAAG NAME
   ═══════════════════════════════════════════════════════════════════════════════ */

.section-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 16px;
    background: var(--ui-bg);
    border-radius: 16px;
    border: 1px solid var(--ui-border);
}

.raag-name {
    font-family: var(--font-gurmukhi);
    font-size: 17px;
    color: var(--accent);
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GURBANI LINES — CLEAN MINIMAL DESIGN (NITNEM-STYLE)
   Simple lines with subtle dividers, no boxy cards
   ═══════════════════════════════════════════════════════════════════════════════ */

.gurbani-lines {
    max-width: 800px;
    margin: 0 auto;
    contain: content;
}

.gurbani-line {
    margin-bottom: 0;
    padding: 20px 20px;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ui-border);
    position: relative;
    overflow: hidden;
    /* No animation - stable reading */
    contain: layout style paint;
}

/* No line animations - stable reading experience */

/* Remove the corner glow decoration */
.gurbani-line::after {
    display: none;
}

/* Content visibility for off-screen verses */
.gurbani-line {
    content-visibility: auto;
    contain-intrinsic-size: 0 120px;
}

/* GURMUKHI TEXT */
.gurmukhi-text {
    font-family: var(--font-gurmukhi);
    font-size: var(--gurmukhi-size);
    line-height: var(--line-height);
    color: var(--text-gurmukhi);
    margin-bottom: 10px;
    word-wrap: break-word;
    text-align: center;
    text-shadow: none;
    letter-spacing: 0.02em;
    font-weight: 400;
}

/* TRANSLATION TEXT */
.translation-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--translation-color);
    font-style: italic;
    text-align: center;
    padding: 8px 8px 0;
    border-top: none;
    margin-top: 8px;
    opacity: 0.85;
}

.translation-text::before {
    display: none;
}

/* TRANSLITERATION TEXT */
.transliteration-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--transliteration-color);
    text-align: center;
    font-family: 'Georgia', serif;
    letter-spacing: 0.03em;
    padding: 0 8px;
    margin-top: 4px;
    opacity: 0.8;
}

/* LINE NUMBER */
.line-number {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CONTINUOUS READING MODE — TRULY FULL SCREEN
   Content fills entire screen. Header/footer hidden by default.
   Lines flow one after another with zero gap.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* CSS visibility toggles for translation/transliteration — avoids full re-render */
.hide-translation .translation-text { display: none !important; }
.hide-transliteration .transliteration-text { display: none !important; }
.hide-hindi .hindi-text { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════════
   ANG INFO / COMPLETION
   ═══════════════════════════════════════════════════════════════════════════════ */

.ang-info {
    text-align: center;
    padding: 32px 20px;
    margin-top: 24px;
    background: var(--ui-bg);
    border-radius: 20px;
    border: 1px solid var(--ui-border);
}

.ang-info::before {
    content: '☬';
    display: block;
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px var(--accent));
}

.ang-info-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: var(--font-gurmukhi);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FOOTER — GPU-COMPOSITED, NO LAYOUT REFLOW
   ═══════════════════════════════════════════════════════════════════════════════ */

.reader-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding-bottom: var(--safe-bottom);
    transform: translateY(0);
    transition: transform 0.35s var(--ease-out-expo), opacity 0.35s;
    will-change: transform;
}

.reader-footer.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.footer-blur {
    position: absolute;
    inset: 0;
    background: var(--ui-bg);
    /* No blur effects - stable performance */
    border-top: 1px solid var(--ui-border);
}

.footer-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    height: var(--footer-height);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-btn:active {
    transform: scale(0.93);
}

.nav-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.reading-stats {
    display: flex;
    gap: 16px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-icon { font-size: 14px; }

.progress-mini {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-mini {
    width: 80px;
    height: 5px;
    background: var(--ui-border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 100%);
    border-radius: 3px;
    transition: width 0.4s ease-out;
}

.progress-text-mini {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 36px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   QUICK ACTIONS OVERLAY
   ═══════════════════════════════════════════════════════════════════════════════ */

.quick-actions-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.quick-actions-overlay.active {
    opacity: 1;
    visibility: visible;
}

.quick-actions-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* No blur effects */
}

.quick-actions-panel {
    position: relative;
    background: var(--ui-bg);
    /* No blur effects */
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    transform: scale(0.9);
    opacity: 0;
    transition: background-color 0.3s var(--ease-spring), color 0.3s var(--ease-spring), transform 0.3s var(--ease-spring);
}

.quick-actions-overlay.active .quick-actions-panel {
    transform: scale(1);
    opacity: 1;
}

.actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s;
}

.action-btn:active { transform: scale(0.93); }
.action-icon { font-size: 26px; }
.action-btn span { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.divider {
    height: 1px;
    background: var(--ui-border);
    margin: 16px 0;
}

.close-actions-btn {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 46px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SETTINGS PANEL
   ═══════════════════════════════════════════════════════════════════════════════ */

.settings-panel {
    position: fixed;
    inset: 0;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.settings-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90%;
    max-width: 360px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--ui-border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-panel.active .settings-content {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ui-border);
    padding-top: calc(20px + var(--safe-top));
    background: var(--ui-bg);
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-settings-btn {
    width: 36px;
    height: 36px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item { margin-bottom: 20px; }

.setting-item label {
    display: block;
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    margin-bottom: 10px;
}

.toggle-item label { margin-bottom: 0; }

/* Toggle Switch — iOS Style */
.toggle {
    position: relative;
    width: 51px;
    height: 31px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--ui-border);
    border-radius: 31px;
    transition: background 0.25s ease;
}

.toggle .toggle-slider::before {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
}

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

/* ═══════════════════════════════════════════════════════════════════════════════
   THEME SELECTOR — 2 THEMES ONLY (Dark + Light)
   ═══════════════════════════════════════════════════════════════════════════════ */

.theme-selector-modern {
    display: flex;
    gap: 8px;
    padding: 5px;
    background: var(--ui-bg);
    border-radius: 16px;
    border: 1px solid var(--ui-border);
    margin-bottom: 12px;
}

.theme-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.theme-pill.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 100%);
    color: #000;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
    font-weight: 700;
}

.theme-emoji { font-size: 16px; }
.theme-name { font-weight: inherit; }

/* Hide extended theme options */
.theme-options-extended { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════════
   DISPLAY MODE PILLS
   ═══════════════════════════════════════════════════════════════════════════════ */

.display-mode-pills {
    display: flex;
    gap: 8px;
    padding: 5px;
    background: var(--ui-bg);
    border-radius: 12px;
    border: 1px solid var(--ui-border);
}

.mode-pill {
    flex: 1;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.mode-pill.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 100%);
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FONT SIZE CONTROL
   ═══════════════════════════════════════════════════════════════════════════════ */

.font-size-control-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 14px;
}

.font-size-control-modern .font-small { font-size: 12px; color: var(--text-tertiary); font-weight: 600; }
.font-size-control-modern .font-large { font-size: 20px; color: var(--text-secondary); font-weight: 600; }

.font-size-control-modern input[type="range"],
.line-spacing-control input[type="range"] {
    flex: 1;
    height: 5px;
    background: var(--ui-border);
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

.font-size-control-modern input::-webkit-slider-thumb,
.line-spacing-control input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    cursor: pointer;
}

.font-size-value,
.line-spacing-value {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    min-width: 36px;
    text-align: center;
    background: var(--glass-bg-hover);
    padding: 4px 8px;
    border-radius: 8px;
}

/* LINE SPACING CONTROL */
.line-spacing-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 14px;
}

/* MODERN SELECT */
.modern-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.modern-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: calc(var(--footer-height) + var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.toast {
    background: var(--ui-bg);
    /* No blur effects */
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    padding: 14px 22px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   KHANDA WATERMARK
   ═══════════════════════════════════════════════════════════════════════════════ */

.khanda-watermark-reader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 250px;
    color: var(--accent);
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    /* NO animation — static watermark prevents full-screen repaints */
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SETTINGS BUTTON ANIMATION
   ═══════════════════════════════════════════════════════════════════════════════ */

.settings-btn-animated svg {
    transition: transform 0.3s ease;
}

.settings-btn-animated:active svg {
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SEARCHED LINE HIGHLIGHT
   ═══════════════════════════════════════════════════════════════════════════════ */

.gurbani-line.searched-highlight {
    background: linear-gradient(135deg,
            rgba(139, 92, 246, 0.12) 0%,
            rgba(102, 126, 234, 0.12) 100%) !important;
    border-left: 4px solid #8B5CF6 !important;
    animation: searchedPulse 1.5s ease-out !important;
}

.gurbani-line.searched-highlight::before {
    content: '🔍';
    position: absolute;
    top: -8px;
    left: 10px;
    font-size: 18px;
}

@keyframes searchedPulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.gurbani-scroll.smooth-scroll-to-search {
    scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FLOATING ACTIONS BAR
   ═══════════════════════════════════════════════════════════════════════════════ */

.floating-actions-bar {
    position: fixed;
    bottom: calc(var(--footer-height) + var(--safe-bottom) + 70px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: var(--ui-bg);
    /* No blur effects */
    border: 1px solid var(--ui-border);
    border-radius: 100px;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.floating-actions-bar.visible {
    opacity: 1;
    visibility: visible;
}

.fab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s;
}

.fab-btn:active { background: rgba(139, 92, 246, 0.12); }
.fab-icon { font-size: 20px; }
.fab-label { font-size: 10px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SEARCH MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    /* No blur effects */
}

.search-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--ui-border);
    border-radius: 22px;
    padding: 22px;
    width: min(90%, 360px);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
    transform: scale(1);
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.search-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.close-search-btn {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
}

.search-modal-body {
    display: flex;
    gap: 10px;
}

.ang-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 18px;
    border: 2px solid var(--ui-border);
    border-radius: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.ang-input:focus { border-color: var(--accent); }
.ang-input::placeholder { color: var(--text-tertiary); }

.go-btn {
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 600;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 14px;
    cursor: pointer;
}

.search-modal-footer {
    margin-top: 14px;
    text-align: center;
}

.advanced-search-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DOWNLOAD MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */

.download-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.download-modal.active {
    opacity: 1;
    visibility: visible;
}

.download-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* No blur effects */
}

.download-modal-content {
    position: relative;
    background: var(--ui-bg);
    /* No blur effects */
    border: 1px solid var(--ui-border);
    border-radius: 20px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    transform: scale(0.9);
    opacity: 0;
    transition: background-color 0.3s var(--ease-spring), color 0.3s var(--ease-spring), transform 0.3s var(--ease-spring);
}

.download-modal.active .download-modal-content {
    transform: scale(1);
    opacity: 1;
}

.download-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.download-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.close-download-btn {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-secondary);
}

.download-modal-body {
    margin-bottom: 16px;
}

.download-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.download-progress-container {
    margin-bottom: 16px;
}

.download-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--ui-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.download-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.download-progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    text-align: center;
}

.download-status {
    font-size: 13px;
    color: var(--accent);
    text-align: center;
    margin-bottom: 12px;
    min-height: 18px;
}

.download-start-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.download-start-btn:hover {
    opacity: 0.9;
}

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

.download-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-modal-footer {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--ui-border);
}

.cached-count {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    :root { --gurmukhi-size: 28px; }
    .gurbani-line { padding: 32px 36px; margin-bottom: 36px; }
    .translation-text { font-size: 16px; }
}

@media (min-width: 1024px) {
    :root { --gurmukhi-size: 32px; }
    .gurbani-lines { max-width: 900px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════════════ */

@media print {
    body { background: white !important; color: black !important; }
    .reader-header, .reader-footer, .settings-panel, .quick-actions-overlay { display: none !important; }
    .gurmukhi-text { color: #1a1a1a !important; text-shadow: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}