/* 
 * Shrimad Bhagavatam Canto 10 PWA - Main Stylesheet
 * Brand colors: Lord Krishna Theme - Royal Blue & Vibrant Gold
 * Features: Dark mode, glassmorphism, responsive layouts, premium typography
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --header-height: 76px;
    --sub-header-height: 48px;
    --scroll-indicator-height: 4px;
    --bg-primary: #E6A623;       /* Golden Yellow */
    --bg-secondary: #F7C844;     /* Medium Yellow */
    --color-royal-blue: #A5252C;  /* Deep Red */
    --color-electric-blue: #E65100; /* Burnt Orange */
    --color-gold: #A5252C;        /* Deep Red (contrasting against yellow background) */
    --color-light-gold: #A5252C;  /* Deep Red for Sanskrit text */
    --color-amber: #E65100;       /* Burnt Orange */
    --color-saffron-light: #E65100; /* Burnt Orange */
    --color-text-main: #2c2c2c;   /* Dark charcoal text for readability */
    --color-text-muted: #5d4e75;  /* Purple-Grey muted text */
    --glass-bg: rgba(255, 255, 255, 0.45); /* Light glass card background */
    --glass-border: rgba(165, 37, 44, 0.15); /* Light red border */
    --gold-border-glow: rgba(165, 37, 44, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(165, 37, 44, 0.45);
    border-radius: 1.5px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(165, 37, 44, 0.7);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(rgba(230, 166, 35, 0.76), rgba(205, 135, 20, 0.82)), url('../assets/images/Book-Cover.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--color-text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden;
    font-weight: 400;
}

/* Header styles */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: calc(var(--header-height) + var(--safe-top)); /* Responsive height */
    background: #E6A623;
    padding: calc(4px + var(--safe-top)) 20px 4px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: none;
}

header h1 {
    flex: 1;
    text-align: center;
    font-size: 2.0rem;
    color: var(--color-royal-blue);
    font-weight: 300;
    letter-spacing: 0.5px;
}

#header-title-text {
    font-size: 2.0rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--color-royal-blue);
    vertical-align: middle;
}

#header-logo {
    max-height: 68px; /* Fit inside 76px header */
    max-width: 95%;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    transition: var(--transition-smooth);
}

.header-buttons {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-bookmark-btn {
    position: absolute;
    right: 20px;
    top: calc(50% + var(--safe-top) / 2);
    transform: translateY(-50%);
    background: transparent;
    color: var(--color-royal-blue);
    border: none;
    cursor: pointer;
    font-size: 1.7rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    z-index: 1001;
    outline: none;
}

.header-bookmark-btn:hover {
    transform: translateY(-50%) scale(1.1);
    color: var(--color-electric-blue);
}

.header-bookmark-btn.bookmarked {
    color: var(--color-electric-blue);
}

#back-btn {
    position: absolute;
    left: 20px;
    top: calc(50% + var(--safe-top) / 2);
    transform: translateY(-50%);
    background: transparent;
    color: var(--color-royal-blue);
    border: none;
    cursor: pointer;
    font-size: 1.7rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    z-index: 1001;
}

#back-btn:hover {
    transform: translateY(-50%) scale(1.1);
    color: var(--color-electric-blue);
}

#ai-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-radius: 50%;
    padding: 2px;
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 10px var(--gold-border-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}

#ai-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
}

.ai-icon-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Main Content Area */
main {
    flex: 1;
    padding: calc(76px + var(--safe-top)) 15px 95px 15px; /* Spacing for 76px header and footer */
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: none; /* screens are swapped/re-populated via JS, not grown in place — anchoring would fight our own scroll resets */
    -webkit-overflow-scrolling: touch;
}

.screen {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.chapters-header-section {
    text-align: center;
    margin-bottom: 25px;
    padding: 10px 0;
    background: none;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.chapters-header-section h2 {
    color: var(--color-royal-blue);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.chapters-header-section p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.bookmark-resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.45); /* Translucent glass */
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.bookmark-resume-banner:hover {
    transform: translateY(-2px);
    background: rgba(247, 200, 68, 0.22); /* Warm golden tint on hover */
    border-color: rgba(230, 166, 35, 0.45);
    box-shadow: 0 6px 20px rgba(230, 166, 35, 0.12);
}

.bookmark-resume-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bookmark-resume-icon {
    color: var(--color-electric-blue);
    font-size: 1.45rem;
}

.bookmark-resume-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bookmark-resume-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-royal-blue);
    letter-spacing: 0.5px;
}

.bookmark-resume-details {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.bookmark-resume-arrow {
    color: var(--color-royal-blue);
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.bookmark-resume-banner:hover .bookmark-resume-arrow {
    transform: translateX(3px);
}

/* Chapters Screen */
#chapters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0 25px 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Reference Design Golden Glass Card for Chapter Items — exact natural-glass values */
.reference-glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.chapter-card.is-bookmarked {
    border-color: var(--color-royal-blue);
    box-shadow: 0 8px 32px 0 rgba(165, 37, 44, 0.35);
}

.card-bookmark-flag {
    position: absolute;
    top: 0;
    right: 18px;
    background: var(--color-royal-blue);
    color: #fff;
    padding: 4px 10px 6px;
    border-radius: 0 0 8px 8px;
    font-size: 0.85rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.chapter-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.chapter-card-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chapter-card-heading {
    color: #A5252C;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.3px;
}

.chapter-read-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(46, 125, 50, 0.12);
    border: 1px solid rgba(46, 125, 50, 0.3);
    color: #2E7D32;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
    flex-shrink: 0;
}

.chapter-read-count-pill i {
    font-size: 0.62rem;
}

.chapter-verse-pill {
    background: rgba(255, 193, 7, 0.52);
    border: 1px solid rgba(255, 193, 7, 0.7);
    color: #7A141A;
    padding: 4px 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.chapter-card-desc {
    color: #262626;
    font-size: 0.96rem;
    line-height: 1.65;
    margin: 0;
    font-weight: 500;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-card-bg-image {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 168px;
    height: 198px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.32;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    -webkit-mask-image: radial-gradient(circle at right center, #000 25%, transparent 70%);
            mask-image: radial-gradient(circle at right center, #000 25%, transparent 70%);
    transition: var(--transition-smooth);
}

.chapter-card:hover .chapter-card-bg-image {
    transform: translateY(-50%) scale(1.08);
    opacity: 0.5;
}

.chapter-card .chapter-header,
.chapter-card p {
    position: relative;
    z-index: 1;
}

.chapter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.12) 0%, rgba(255, 130, 0, 0.06) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 0;
}

.chapter-card:hover {
    transform: translateY(-5px);
    border-color: rgba(234, 179, 8, 0.4);
    box-shadow: 0 12px 40px rgba(234, 179, 8, 0.15);
}

.chapter-card:hover::after {
    opacity: 1;
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.chapter-number {
    background: var(--color-royal-blue);
    color: #fff;
    border: 1.5px solid var(--color-electric-blue);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(165, 37, 44, 0.25);
    transition: var(--transition-smooth);
}

.chapter-card:hover .chapter-number {
    transform: scale(1.06);
    background: var(--color-electric-blue);
    color: #fff;
    border-color: var(--color-electric-blue);
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-info h3 {
    color: var(--color-gold);
    font-weight: 600;
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.chapter-meaning {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-stats {
    margin-left: auto;
}

.verse-count {
    background: rgba(165, 37, 44, 0.1);
    color: var(--color-electric-blue);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(165, 37, 44, 0.25);
}

.chapter-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text-muted);
    position: relative;
    z-index: 1;
}

/* Verses Screen */
#verses-screen {
    max-width: 800px;
    margin: 0 auto;
}

#chapter-title {
    text-align: center;
    margin-bottom: 25px;
}

.chapter-title-name {
    color: var(--color-gold);
    font-size: 1.6rem;
    font-weight: 700;
}

.chapter-title-meaning {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-style: italic;
    margin-top: 4px;
}

#verses-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

.verse-item {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border-left: 4px solid var(--color-royal-blue);
}

.verse-item:hover {
    transform: translateX(5px);
    border-left-color: var(--color-electric-blue);
    background: rgba(230, 166, 35, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.verse-item .verse-number {
    background: var(--color-royal-blue);
    color: #fff;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 1px solid var(--color-royal-blue);
    margin-top: 3px;
}

.verse-item:hover .verse-number {
    background: var(--color-electric-blue);
    color: #fff;
    border-color: var(--color-electric-blue);
    transform: scale(1.05);
}

.verse-item .verse-text {
    flex: 1;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Verse Detail Screen */
#verse-detail-screen {
    max-width: 800px;
    margin: 0 auto;
}

.sloka-number-pill {
    background: rgba(165, 37, 44, 0.12);
    color: var(--color-royal-blue);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    display: block;
    text-align: center;
    margin: 0 auto 20px auto;
    width: fit-content;
    border: 1px solid rgba(165, 37, 44, 0.35);
}

#verse-sanskrit-card {
    border-color: rgba(255, 130, 0, 0.2);
}

#verse-text {
    font-size: 1.22rem;
    font-weight: 600;
    color: var(--color-royal-blue);
    text-align: center;
    line-height: 1.85;
    margin-bottom: 20px;
}

#verse-transliteration {
    font-style: italic;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.verse-sanskrit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.verse-sanskrit-header .sloka-number-pill {
    margin: 0;
}

.translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    width: 100%;
}

.translation-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-royal-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-dropdown {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(165, 37, 44, 0.25);
    border-radius: 12px;
    padding: 6px 30px 6px 14px;
    color: var(--color-royal-blue);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A5252C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    transition: var(--transition-smooth);
}

.language-dropdown:hover {
    border-color: var(--color-royal-blue);
    box-shadow: 0 0 8px rgba(165, 37, 44, 0.15);
}

.bookmark-btn, .share-btn {
    background: rgba(255, 255, 255, 0.35);
    color: var(--color-royal-blue);
    border: 1px solid rgba(165, 37, 44, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.bookmark-btn:hover, .share-btn:hover {
    background: rgba(165, 37, 44, 0.1);
    border-color: var(--color-royal-blue);
    transform: scale(1.08);
}

.bookmark-btn.bookmarked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

#verse-translation {
    font-size: 1.12rem;
    line-height: 1.65;
    color: #000000;
    font-weight: 500;
    padding: 20px;
    background: rgba(230, 166, 35, 0.25);
    border-radius: 14px;
    border: 1px solid rgba(230, 166, 35, 0.4);
    margin-top: 15px;
}

/* Audio navigation and controls */
#verse-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #E6A623;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    gap: 15px;
}

#prev-verse-btn, #next-verse-btn {
    background: rgba(255, 255, 255, 0.35);
    color: var(--color-royal-blue);
    border: 1px solid rgba(165, 37, 44, 0.25);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.05rem;
}

#prev-verse-btn:hover:not(:disabled), #next-verse-btn:hover:not(:disabled) {
    background: rgba(234, 179, 8, 0.15);
    border-color: var(--color-gold);
    transform: scale(1.08);
}

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

#verse-slider-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#verse-slider {
    width: 100%;
    max-width: 350px;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: rgba(165, 37, 44, 0.2);
    border-radius: 5px;
    outline: none;
}

#verse-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
    transition: var(--transition-smooth);
}

#verse-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#verse-counter {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* Floating Audio Button */
#floating-audio-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1002;
    transition: opacity 0.3s ease;
}

.progress-ring {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
}

.progress-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
    width: 58px;
    height: 58px;
}

.progress-ring-circle {
    stroke-dasharray: 182.21;
    stroke-dashoffset: 182.21;
    transition: stroke-dashoffset 0.1s ease;
    stroke: var(--color-gold);
}

#floating-play-pause {
    background: #E6A623;
    border: 1.5px solid var(--color-royal-blue);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    color: var(--color-royal-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 1;
    transition: var(--transition-smooth);
}

#floating-play-pause:hover {
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
}

#floating-time {
    position: absolute;
    top: -24px;
    background: rgba(15, 2, 3, 0.85);
    border: 1px solid rgba(255, 130, 0, 0.3);
    color: var(--color-gold);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.progress-ring:hover #floating-time {
    opacity: 1;
}


/* Settings Screen */
#settings-screen {
    max-width: 600px;
    margin: 0 auto;
}

.settings-card {
    padding: 25px !important;
}

.settings-header {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
}

.settings-header h2 {
    color: var(--color-gold);
    font-size: 1.4rem;
}

.settings-header p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.setting-item {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 25px;
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-item h3 {
    font-size: 1.05rem;
    color: var(--color-gold);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

.language-preference-group select {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    background: rgba(15, 2, 3, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    color: #fff;
    outline: none;
}

.reset-cache-pill {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.reset-cache-pill:hover {
    background: rgba(239, 68, 68, 0.1);
}

.setting-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.setting-header-row h3 {
    margin-bottom: 0;
}

.setting-toggle {
    display: flex;
    flex-direction: column;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
}

.toggle-checkbox {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: var(--transition-smooth);
    border: 1px solid var(--glass-border);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #94a3b8;
    top: 2px;
    left: 2px;
    transition: var(--transition-smooth);
}

.toggle-checkbox:checked + .toggle-switch {
    background: var(--color-royal-blue);
    border-color: var(--color-electric-blue);
}

.toggle-checkbox:checked + .toggle-switch::after {
    left: 22px;
    background: var(--color-gold);
}

.setting-description {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 5px;
}

.settings-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.settings-footer a {
    color: var(--color-gold);
    text-decoration: none;
}

/* Bookmarks Screen */
#bookmarks-screen {
    max-width: 800px;
    margin: 0 auto;
}

.bookmarks-header {
    text-align: center;
    margin-bottom: 25px;
}

.bookmarks-header h2 {
    color: var(--color-gold);
    font-size: 1.5rem;
}

.bookmarks-header p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 30px;
}

.bookmark-item {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition-smooth);
    border-left: 4px solid var(--color-gold);
}

.bookmark-item:hover {
    transform: translateY(-2px);
    background: rgba(230, 166, 35, 0.2);
}

.bookmark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bookmark-sloka-number {
    color: var(--color-gold);
    font-weight: 600;
    font-size: 0.85rem;
}

.remove-bookmark-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.remove-bookmark-btn:hover {
    color: #ef4444;
}

.bookmark-text {
    font-size: 1.15rem;
    color: var(--color-light-gold);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 12px;
}

.bookmark-translation {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-main);
    background: rgba(230, 166, 35, 0.15);
    padding: 12px;
    border-radius: 10px;
}

/* Floating Navigation/Settings Menu */
.floating-settings-btn {
    position: fixed;
    bottom: 75px;
    right: 20px;
    z-index: 1002;
}

.main-floating-btn {
    background: #E6A623;
    border: 1.5px solid var(--color-royal-blue);
    color: var(--color-royal-blue);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

.main-floating-btn:hover {
    transform: scale(1.08) rotate(15deg);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
}

.main-floating-btn.opened {
    transform: scale(1.08) rotate(90deg);
}

.floating-menu {
    position: absolute;
    bottom: 62px;
    right: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(15px) scale(0.9);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.floating-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-option-btn {
    background: #E6A623;
    border: 1.5px solid var(--color-royal-blue);
    color: var(--color-royal-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.floating-option-btn:hover {
    transform: scale(1.08);
    background: var(--color-royal-blue);
    color: #fff;
    box-shadow: 0 0 12px var(--gold-border-glow);
}

/* Footer styling */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #E6A623;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px 12px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 998;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

footer p {
    color: var(--color-gold);
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.footer-sloka {
    font-size: 0.68rem;
    line-height: 1.4;
    letter-spacing: 0.3px;
    color: var(--color-gold);
    opacity: 0.85;
    margin: 0;
    display: block;
}

/* Video tabs within verse screen */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    border: 1.5px solid rgba(234, 179, 8, 0.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Media Queries for Responsiveness */
@media (max-width: 600px) {
    :root {
        --header-height: 60px;
    }

    header {
        padding: calc(3px + var(--safe-top)) 15px 3px 15px;
        height: calc(var(--header-height) + var(--safe-top));
    }

    header h1 {
        font-size: 1.55rem;
        font-weight: 300;
    }
    
    #header-title-text {
        font-size: 1.55rem;
        font-weight: 300;
    }
    
    #header-logo {
        max-height: 54px; /* Fit inside 60px header */
        max-width: 90%;
    }
    
    .chapters-header-section {
        padding: 5px 0;
        margin-bottom: 15px;
    }
    
    .chapters-header-section h2 {
        font-size: 1.25rem;
    }
    
    .chapters-header-section p {
        font-size: 0.82rem;
    }
    
    main {
        padding: calc(var(--header-height) + var(--safe-top)) 10px 85px 10px;
    }
    
    #chapters-list {
        grid-template-columns: 1fr;
    }
    
    /* Make Sanskrit text smaller and highly legible on mobile */
    #verse-text {
        font-size: 1.15rem !important;
        line-height: 1.7 !important;
        margin-bottom: 16px !important;
        letter-spacing: 0.3px;
    }
    
    #verse-transliteration {
        font-size: 0.86rem !important;
        line-height: 1.6 !important;
    }
    
    #verse-translation {
        font-size: 1.0rem !important;
        line-height: 1.65 !important;
        padding: 15px !important;
        margin-top: 10px !important;
    }
    
    .sloka-number-pill {
        padding: 4px 12px !important;
        font-size: 0.75rem !important;
        margin-bottom: 16px !important;
    }
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 22px;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(165, 37, 44, 0.08);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(165, 37, 44, 0.4), transparent);
    opacity: 0.7;
}

/* Custom Share Toast Notification */
#toast {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(165, 37, 44, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 10005;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Styling overrides for long/multi-sloka detail pages */
.multi-sloka-layout #verse-text {
    font-size: 1.08rem !important;
    line-height: 1.75 !important;
}

.multi-sloka-layout #verse-transliteration {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
}

.multi-sloka-layout #verse-translation {
    font-size: 0.98rem !important;
    line-height: 1.55 !important;
}

/* Mobile responsive multi-sloka layout overrides */
@media (max-width: 600px) {
    .multi-sloka-layout #verse-text {
        font-size: 1.02rem !important;
    }
    
    .multi-sloka-layout #verse-transliteration {
        font-size: 0.8rem !important;
    }
    
    .multi-sloka-layout #verse-translation {
        font-size: 0.88rem !important;
        padding: 12px !important;
    }
}

/* Chapter Reader Mode & Controls */
.reader-sticky-header {
    position: sticky;
    top: -2px; /* Pull up by 2px to eliminate subpixel gap between sticky header and navbar */
    height: 48px;
    box-sizing: border-box;
    z-index: 99;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid transparent;
    border-radius: 0 !important; /* Flat edges to blend naturally */
    padding: 12px 15px;
    margin: -1px -15px 15px -15px !important; /* Negative margins to span full screen width, -1px top to eliminate gap */
    width: calc(100% + 30px) !important;
    max-width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.reader-sticky-header.stuck {
    background: #E6A623; /* Solid golden yellow to match the header */
    border-bottom: 1.5px solid rgba(165, 37, 44, 0.18); /* Red theme border to separate stuck bar from scrolling verses */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06); /* Soft shadow when stuck */
}

#timeline-sticky-controls {
    margin-bottom: 0 !important;
}

#timeline-sticky-controls.stuck {
    border-bottom: none !important;
    box-shadow: none !important;
}

@media (min-width: 830px) {
    .reader-sticky-header {
        margin: -1px calc(-50vw + 50%) 15px calc(-50vw + 50%) !important;
        width: 100vw !important;
        max-width: 100vw;
        padding: 12px calc(50vw - 400px + 20px) !important;
    }
}

.reader-sticky-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-royal-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reader-sticky-title i {
    font-size: 0.95rem;
}

.reader-sticky-header .language-dropdown {
    background-color: rgba(255, 255, 255, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    color: var(--color-royal-blue) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.reader-sticky-header .language-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.view-toggle-group {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2px;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.view-mode-btn {
    background: transparent;
    border: none;
    border-radius: 15px;
    padding: 4px 10px;
    color: var(--color-royal-blue);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
    outline: none;
}

.view-mode-btn i {
    font-size: 0.9rem;
}

.view-mode-btn.active {
    background: var(--color-royal-blue);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(165, 37, 44, 0.2);
}

.view-mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.4);
    color: var(--color-electric-blue);
}

.reader-verse-card {
    margin: 0 0 10px 0 !important;
    border-radius: 12px !important;
    border: 1px solid var(--glass-border) !important;
    padding: 24px !important;
}

.reader-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    width: 100%;
}

.reader-card-header .sloka-number-pill {
    margin: 0 !important;
}

.reader-card-actions {
    display: flex;
    gap: 10px;
}

.reader-action-btn {
    background: rgba(255, 255, 255, 0.35);
    color: var(--color-royal-blue);
    border: 1px solid rgba(165, 37, 44, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-smooth);
    outline: none;
}

.reader-action-btn:hover {
    background: rgba(165, 37, 44, 0.1);
    border-color: var(--color-royal-blue);
    transform: scale(1.08);
}

.reader-action-btn.favorite-btn.bookmarked {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.reader-action-btn.bookmark-btn.bookmarked {
    color: var(--color-electric-blue);
    background: rgba(230, 166, 35, 0.15);
    border-color: rgba(230, 166, 35, 0.4);
}

.reader-sanskrit {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-royal-blue);
    text-align: center;
    line-height: 1.85;
    margin-bottom: 18px;
}

.reader-transliteration {
    font-style: italic;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.65;
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.reader-translation {
    font-size: 1.1rem;
    line-height: 1.65;
    color: #000000;
    font-weight: 500;
    padding: 18px;
    background: rgba(230, 166, 35, 0.22);
    border-radius: 12px;
    border: 1px solid rgba(230, 166, 35, 0.35);
    text-align: justify;
}

/* Reader view mobile adjustments */
@media (max-width: 600px) {
    .reader-sticky-header {
        top: -2px; /* Pull up by 2px on mobile as well to eliminate subpixel gap */
        height: 38px;
        box-sizing: border-box;
        padding: 6px 15px;
        margin: -1px -10px 10px -10px !important;
        width: calc(100% + 20px) !important;
        max-width: 100vw;
        border-radius: 0 !important;
    }
    
    .reader-sticky-title {
        font-size: 0.78rem;
    }
    
    .reader-sticky-header .language-dropdown {
        padding: 4px 24px 4px 10px;
        font-size: 0.78rem;
        background-size: 10px;
    }

    .reader-verse-card {
        padding: 16px 18px !important;
        margin: 0 0 6px 0 !important;
        border-radius: 12px !important;
    }
    
    .reader-sanskrit {
        font-size: 1.08rem;
        line-height: 1.75;
    }
    
    .reader-transliteration {
        font-size: 0.85rem;
        line-height: 1.55;
    }
    
    .reader-translation {
        font-size: 0.92rem;
        line-height: 1.55;
        padding: 14px;
    }
}

/* ===== Header timeline button ===== */
#header-timeline-btn {
    background: transparent;
    color: var(--color-royal-blue);
    border: none;
    cursor: pointer;
    font-size: 1.45rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    outline: none;
}
#header-timeline-btn:hover {
    transform: scale(1.1);
    color: var(--color-electric-blue);
}

/* ===== Krishna Timeline screen ===== */
#timeline-screen {
    padding-bottom: 60px;
}
.timeline-header {
    text-align: center;
    padding: 18px 16px 14px; /* Reduced bottom padding to fit controls nicely */
}
.timeline-header h2 {
    color: var(--color-royal-blue);
    font-size: 1.85rem;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.timeline-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Timeline Controls and Search Bar styling */
.timeline-search-wrapper input:focus {
    border-color: var(--color-royal-blue) !important;
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 4px 20px rgba(165, 37, 44, 0.08) !important;
}

/* Merged Sticky Header: Title + Scrollbar Ribbon */
.timeline-merged-header {
    position: sticky;
    top: 45px; /* Overlap by 1px to close any subpixel gaps */
    z-index: 99;
    background: transparent;
    border-bottom: 1.5px solid transparent;
    border-radius: 0 !important;
    padding: 6px 15px;
    margin: -1px -15px 15px -15px !important;
    width: calc(100% + 30px) !important;
    max-width: 100vw;
    display: none; /* Hide scrollbar when not sticky */
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.timeline-merged-header.stuck {
    display: flex !important; /* Show scrollbar ribbon when stuck/scrolled */
    background: #E6A623; /* Same color as navbar header to blend seamlessly */
    border-bottom: 1.5px solid rgba(165, 37, 44, 0.18);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

@media (min-width: 830px) {
    .timeline-merged-header {
        margin: -1px calc(-50vw + 50%) 15px calc(-50vw + 50%) !important;
        width: 100vw !important;
        max-width: 100vw;
        padding: 6px calc(50vw - 400px + 20px) !important;
    }
}

@media (max-width: 600px) {
    .timeline-merged-header {
        top: 35px; /* Overlap by 1px to close any subpixel gaps on mobile */
        padding: 4px 10px;
        margin: -1px -10px 10px -10px !important;
        width: calc(100% + 20px) !important;
        gap: 8px;
    }
}

.timeline-active-phase-title {
    flex: 0 0 auto;
    max-width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 3.5px solid var(--phase-tint, var(--color-royal-blue));
    padding-left: 8px;
    transition: border-color 0.3s ease;
}

.timeline-active-phase-title h3 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-royal-blue);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-active-phase-title span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-text-muted);
    line-height: 1.1;
    transition: color 0.25s ease;
}

.timeline-merged-header.stuck .timeline-active-phase-title span {
    color: rgba(165, 37, 44, 0.8);
}

.timeline-ribbon-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.timeline-ribbon-fade-left {
    position: absolute;
    top: 0;
    left: -2px;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.85));
    transition: background 0.25s ease;
    z-index: 2;
}

.timeline-merged-header.stuck .timeline-ribbon-fade-left {
    background: linear-gradient(to left, transparent, #E6A623);
}

.timeline-ribbon-fade-right {
    position: absolute;
    top: 0;
    right: -2px;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.85));
    transition: background 0.25s ease;
    z-index: 2;
}

.timeline-merged-header.stuck .timeline-ribbon-fade-right {
    background: linear-gradient(to right, transparent, #E6A623);
}

/* Timeline navigation ribbon styling */
.timeline-nav-ribbon {
    background: transparent;
    border: none;
    padding: 0 20px; /* Padding for smooth scrolling under left/right fades */
    margin: 0 !important;
    width: 100% !important;
    max-width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    box-shadow: none;
}
.timeline-nav-ribbon::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* Timeline Navigation Pills */
.timeline-nav-pill {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    color: var(--color-royal-blue);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.timeline-nav-pill:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(165, 37, 44, 0.35);
}

.timeline-nav-pill.active {
    background: var(--color-royal-blue) !important;
    color: white !important;
    border-color: var(--color-royal-blue) !important;
    box-shadow: 0 4px 12px rgba(165, 37, 44, 0.2) !important;
}

/* Ambient glow backgrounds for timeline phases */
.tl-phase-glow {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, var(--phase-tint-glow) 0%, transparent 70%);
    filter: blur(65px);
    opacity: 0.28;
    pointer-events: none;
    z-index: 1;
}

.tl-phase {
    position: relative;
    margin-bottom: 40px;
}

/* Static phase header - no emojis and clean red/yellow styling */
.tl-phase-header {
    position: relative; /* Normal non-sticky flow */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: 280px; /* Taller card height to showcase illustration nicely */
    margin: 0 12px 20px;
    background: color-mix(in srgb, var(--phase-tint) 8%, var(--glass-bg)); /* Tinted natural glass card background */
    border: 1px solid var(--glass-border);
    border-left: 5px solid var(--phase-tint, var(--color-royal-blue));
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    padding: 0;
    transition: var(--transition-smooth);
}

.tl-phase-header:hover {
    box-shadow: 0 10px 25px rgba(165, 37, 44, 0.12); /* Accent glow on hover */
}

.tl-phase-header:hover .tl-phase-header-bg-image {
    transform: scale(1.05); /* Parallax hover zoom */
}

.tl-phase-header-bg-image {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center; /* Center the illustration as requested */
    background-repeat: no-repeat;
    opacity: 0.95; /* Highly visible illustration */
    pointer-events: none;
    z-index: 0;
    user-select: none;
    /* Soft gradient top finish for natural blend with glass background */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.15) 15%, #000 50%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.15) 15%, #000 50%);
    transition: transform 0.4s ease;
}

.tl-phase-text {
    position: relative;
    z-index: 1;
    padding: 16px 20px 32px 20px; /* More bottom padding for natural gradient transition */
    background: linear-gradient(to bottom, 
        color-mix(in srgb, var(--phase-tint) 15%, rgba(255, 255, 255, 0.55)) 0%, 
        color-mix(in srgb, var(--phase-tint) 8%, rgba(255, 255, 255, 0.25)) 55%, 
        transparent 100%
    ); /* Soft tinted natural glass gradient, avoiding solid white */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Phase image inside chapter summary card on the reading screen */
#chapter-summary-card {
    position: relative;
    overflow: hidden;
}
.chapter-summary-bg-image {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 240px;
    height: 240px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    -webkit-mask-image: radial-gradient(circle at right center, #000 25%, transparent 72%);
            mask-image: radial-gradient(circle at right center, #000 25%, transparent 72%);
}
.chapter-summary-header,
#chapter-summary-text {
    position: relative;
    z-index: 1;
}

.tl-phase-text h3 {
    color: var(--color-royal-blue); /* Rich deep red matching theme */
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}
.tl-phase-range {
    font-size: 0.76rem;
    color: var(--color-text-muted); /* Purple-grey matching theme */
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

/* Mobile responsive adjustments for taller phase header cards */
@media (max-width: 600px) {
    .tl-phase-header {
        height: 210px; /* Taller on mobile as well */
        margin: 0 8px 16px;
    }
    .tl-phase-text {
        padding: 12px 16px 24px 16px;
    }
    .tl-phase-text h3 {
        font-size: 1.05rem;
    }
    .tl-phase-range {
        font-size: 0.72rem;
    }
}

.tl-nodes {
    position: relative;
    padding: 8px 0;
    z-index: 2; /* Sits above the ambient background glow */
}
.tl-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
    opacity: 0.25;
    border-radius: 2px;
}
.tl-node {
    position: relative;
    display: flex;
    width: 100%;
    padding: 12px 0;
}
.tl-node-left { justify-content: flex-start; }
.tl-node-right { justify-content: flex-end; }
.tl-dot {
    position: absolute;
    top: 22px;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--phase-tint, var(--color-royal-blue));
    z-index: 2;
}

/* Premium glowing glassmorphic card design */
.tl-card {
    position: relative;
    overflow: hidden; /* clip the background emoji */
    width: 47%;
    padding: 14px 16px;
    cursor: default; /* no longer expandable */
    background: var(--glass-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background-color 0.3s ease;
}
.tl-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px var(--phase-tint-shadow);
    background: rgba(255, 255, 255, 0.58);
}
.tl-card-bg-image {
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 260px;
    height: 260px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    -webkit-mask-image: radial-gradient(circle at bottom right, #000 30%, transparent 75%);
            mask-image: radial-gradient(circle at bottom right, #000 30%, transparent 75%);
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.tl-card:hover .tl-card-bg-image {
    transform: scale(1.12) rotate(-4deg);
    opacity: 0.55;
}
.tl-card-head,
.tl-sanskrit,
.tl-summary-text {
    position: relative;
    z-index: 2;
}
.tl-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    width: 100%;
    position: relative;
    z-index: 2;
}
.tl-card-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}
.tl-chapter-pill {
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.5px;
}
.tl-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-royal-blue);
    line-height: 1.25;
}
.tl-sanskrit {
    font-size: 0.8rem;
    color: var(--color-text-main);
    margin-bottom: 8px;
    font-weight: 500;
    opacity: 0.85;
}
.tl-meaning {
    color: var(--color-text-muted);
    font-size: 0.74rem;
    font-weight: 500;
}
.tl-summary-text {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--color-text-main);
    margin-bottom: 8px;
    text-align: justify;
}
.tl-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-royal-blue);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(165, 37, 44, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
}
.tl-read-btn:hover {
    background: var(--color-electric-blue);
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.25);
    transform: translateY(-1px);
}

/* Mobile: single column, spine on the left */
@media (max-width: 720px) {
    .tl-phase-glow {
        width: 220px;
        height: 220px;
        filter: blur(50px);
        opacity: 0.22;
    }
    .tl-spine {
        left: 10px;
        margin-left: 0;
    }
    .tl-node {
        justify-content: flex-start !important;
        padding: 8px 0 8px 22px;
    }
    .tl-dot {
        left: 10px;
        margin-left: -7px;
        top: 18px;
    }
    .tl-card {
        width: 100%;
        margin-right: 0px;
        padding: 12px 14px;
    }
    .tl-title { font-size: 0.9rem; }
    .tl-summary-text { font-size: 0.82rem; }
}

@media (max-width: 600px) {
    body.timeline-active main {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* ==========================================================================
   Bhagavatam Reader Experience
   ========================================================================== */
#verses-screen {
    position: relative;
    max-width: 780px;
    margin: 0 auto 40px auto;
    padding: 0 10px;
    z-index: 1;
}

@media (max-width: 600px) {
    body.reader-active main {
        padding-left: 6px;
        padding-right: 6px;
    }

    #verses-screen {
        padding: 0 4px;
    }

    .kadi-block {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Slim Reader Header Card with Chapter Summary */
.slim-title-card {
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none;
    border-radius: 16px;
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.title-card-top-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.chapter-title-name {
    color: var(--color-royal-blue);
    font-size: 0.88rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.2px;
    opacity: 0.85;
}

.chapter-meta-badge {
    color: var(--color-text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    background: rgba(165, 37, 44, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

.chapter-summary-box {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--glass-border);
}

/* Faded Thakorji Maharaj watermark behind the prasang-katha summary — fills full card height and right edge naturally */
.summary-bg-image {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 170px;
    background-size: cover;
    background-position: center 12%;
    background-repeat: no-repeat;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 45%, transparent 100%);
            mask-image: linear-gradient(to left, rgba(0,0,0,1) 45%, transparent 100%);
}

.summary-text {
    position: relative;
    z-index: 1;
    color: #2c2c2c;
    font-size: calc(1.08rem * var(--reader-font-scale, 1));
    line-height: 1.65;
    margin: 0;
    font-weight: 400;
}

/* Full-Width Sub-Header Bar (Attached seamlessly right below top navbar) */
.sticky-reader-bar {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top) - 1.5px); /* 1.5px overlap eliminates sub-pixel gap lines completely */
    left: 0;
    width: 100%;
    height: calc(var(--sub-header-height) + 1.5px);
    background: #E6A623; /* Same golden color as #header top navbar */
    border-top: none;
    border-bottom: 1.5px solid rgba(165, 37, 44, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    z-index: 999;
    display: flex;
    align-items: center;
}

body.reader-active main {
    padding-top: calc(var(--header-height) + var(--safe-top) + var(--sub-header-height) + var(--scroll-indicator-height) + 10px);
}

/* Reading progress line, pinned directly under the sticky reader bar */
.reader-scroll-indicator {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-top) + var(--sub-header-height));
    left: 0;
    width: 100%;
    height: var(--scroll-indicator-height);
    background: rgba(165, 37, 44, 0.12);
    z-index: 998;
}

.reader-scroll-indicator-fill {
    height: 100%;
    width: 0%;
    background: #A5252C;
    transition: width 0.1s linear, background-color 0.2s ease;
}

.reader-scroll-indicator-fill.at-end {
    background: #2E7D32;
}

body.reader-active,
body.yellow-bg-active,
body.reader-theme-yellow {
    background: linear-gradient(rgba(230, 166, 35, 0.55), rgba(205, 135, 20, 0.62)), url('../assets/images/yellow_bg.png') no-repeat center center fixed;
    background-size: cover;
}

.sticky-reader-inner {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sticky-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.sticky-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.sticky-section-title-plain {
    color: var(--color-royal-blue);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
    transition: var(--transition-smooth);
}

.reader-tool-btn {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--glass-border);
    color: var(--color-royal-blue);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.reader-tool-btn.bookmarked {
    background: var(--color-royal-blue);
    color: #ffffff;
    border-color: var(--color-royal-blue);
}

.reader-tool-btn.favourited {
    background: #d81b3f;
    color: #ffffff;
    border-color: #d81b3f;
}

.reader-tool-btn:hover {
    background: var(--color-royal-blue);
    color: #ffffff;
    border-color: var(--color-royal-blue);
    transform: translateY(-1px);
}

.reader-font-indicator {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-royal-blue);
    min-width: 36px;
    text-align: center;
}

.reader-tool-divider {
    width: 1px;
    height: 18px;
    background: var(--glass-border);
    margin: 0 2px;
}

.sticky-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.reader-theme-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3px 8px;
}

.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    padding: 0;
    outline: none;
}

.theme-dot:hover {
    transform: scale(1.15);
}

.theme-dot.active {
    border-color: var(--color-royal-blue);
    transform: scale(1.18);
    box-shadow: 0 0 0 2px rgba(165, 37, 44, 0.3);
}

.theme-dot.theme-yellow {
    background: #FFE696;
}

.theme-dot.theme-light {
    background: #FFFFFF;
}

.theme-dot.theme-dark {
    background: #1A1C1E;
}

.reader-lang-group {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2px;
}

.reader-lang-btn {
    background: transparent;
    border: none;
    color: var(--color-royal-blue);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.reader-lang-btn.active {
    background: var(--color-royal-blue);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Verse Panel Box Color Variations (Purvachhayo & Chopai Boxes Only)
   ========================================================================== */

/* Base Style for Purvachhayo & Chopai Verse Boxes (Default Golden Theme - Translucent Glassmorphism) */
.bhagavatam-section-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: background 0.25s ease, border 0.25s ease, box-shadow 0.25s ease;
}

.bhagavatam-section-header {
    background: rgba(165, 37, 44, 0.05);
    border-bottom: none;
    padding: 6px 12px;
    text-align: center;
    line-height: 1.2;
}

/* Yellow / Golden Theme (Translucent Glassmorphism matching screenshot) */
body.reader-theme-yellow .bhagavatam-section-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.reader-theme-yellow .bhagavatam-section-header {
    background: rgba(165, 37, 44, 0.05);
    border-bottom: none;
}

body.reader-theme-yellow .bhagavatam-section-title {
    color: var(--color-royal-blue);
}

body.reader-theme-yellow .kadi-lines {
    color: #1e1e1e;
}

/* Light / Pure White Theme */
body.reader-theme-light {
    background: url('../assets/images/reading-bg.png') no-repeat center center fixed !important;
    background-size: cover !important;
}

body.reader-theme-light .summary-bg-image,
body.reader-theme-light .chapter-summary-bg-image,
body.reader-theme-light .note-bg-image,
body.reader-theme-light .kadi-bg-num {
    display: none !important;
}

body.reader-theme-light .reader-header-card.slim-title-card {
    background: #FFFFFF;
    border: 1.5px dashed rgba(165, 37, 44, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

body.reader-theme-light .reader-header-card.slim-title-card h2,
body.reader-theme-light .reader-header-card.slim-title-card p,
body.reader-theme-light .summary-text {
    color: #1e1e1e;
}

body.reader-theme-light .bhagavatam-section-panel {
    background: #FFFFFF;
    border: 1.5px dashed rgba(165, 37, 44, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

body.reader-theme-light .bhagavatam-section-header {
    background: rgba(165, 37, 44, 0.06);
    border-bottom: 1px dashed rgba(165, 37, 44, 0.15);
}

body.reader-theme-light .bhagavatam-section-title {
    color: var(--color-royal-blue);
}

body.reader-theme-light .kadi-lines {
    color: #1e1e1e;
}

body.reader-theme-light .bhagavatam-section-panel[data-meter="નોંધ"],
body.reader-theme-light .bhagavatam-section-panel[data-meter="Note"] {
    background: #FFFFFF;
    border: 1.5px dashed rgba(217, 119, 6, 0.35);
}

/* Dark Charcoal & Gold Theme */
body.reader-theme-dark {
    background: url('../assets/images/reading-bg-dark.png') no-repeat center center fixed !important;
    background-size: cover !important;
}
body.reader-theme-dark .summary-bg-image,
body.reader-theme-dark .chapter-summary-bg-image,
body.reader-theme-dark .note-bg-image,
body.reader-theme-dark .kadi-bg-num {
    display: none !important;
}

body.reader-theme-dark .reader-header-card.slim-title-card {
    background: #1C1917;
    border: 1.5px dashed rgba(230, 166, 35, 0.45);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

body.reader-theme-dark .reader-header-card.slim-title-card h2,
body.reader-theme-dark .reader-header-card.slim-title-card .prakaran-num-tag {
    color: #E6A623;
}

body.reader-theme-dark .reader-header-card.slim-title-card p,
body.reader-theme-dark .summary-text {
    color: #F1F5F9;
}

body.reader-theme-dark .bhagavatam-section-panel {
    background: #1C1917;
    border: 1.5px dashed rgba(230, 166, 35, 0.45);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

body.reader-theme-dark .bhagavatam-section-header {
    background: rgba(230, 166, 35, 0.14);
    border-bottom: 1px dashed rgba(230, 166, 35, 0.25);
}

body.reader-theme-dark .bhagavatam-section-title {
    color: #E6A623;
}

body.reader-theme-dark .kadi-lines {
    color: #F1F5F9;
}

body.reader-theme-dark .kadi-bg-num {
    color: #E6A623;
    opacity: 0.08;
}

body.reader-theme-dark .kadi-block {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.reader-theme-dark .bhagavatam-section-panel[data-meter="નોંધ"],
body.reader-theme-dark .bhagavatam-section-panel[data-meter="Note"] {
    background: #1C1917;
    border: 1.5px dashed rgba(230, 166, 35, 0.45);
}

.note-lines {
    color: #334155;
}

body.reader-theme-dark .note-lines {
    color: #F1F5F9 !important;
}

.bhagavatam-section-title {
    color: var(--color-royal-blue);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.kadi-block {
    position: relative;
    padding: 10px 14px;
    border-bottom: 1px dashed var(--glass-border);
    overflow: hidden;
    transition: background 0.2s ease;
}

.kadi-block:last-child {
    border-bottom: none;
}

.kadi-block:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Gujarati verse number watermark in background on the right */
.kadi-bg-num {
    position: absolute;
    right: 14px;
    bottom: 4px;
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--color-royal-blue);
    opacity: 0.06;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.verse-num-suffix {
    color: inherit;
    font-weight: inherit;
    font-size: 1em;
    margin-left: 0.4em;
    display: inline-block;
}

.kadi-lines {
    position: relative;
    z-index: 1;
    font-size: calc(1.15rem * var(--reader-font-scale, 1));
    line-height: 1.85;
    color: #1e1e1e;
    letter-spacing: 0.2px;
}

/* Tappable glossary words inlined within verse text */
.glossary-term {
    cursor: pointer;
    color: var(--color-royal-blue, #1A365D);
    border-bottom: 1.5px dotted rgba(26, 54, 93, 0.55);
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease;
}

.glossary-term:active {
    opacity: 0.6;
}

body.reader-theme-dark .glossary-term {
    color: #E6A623;
    border-bottom-color: rgba(230, 166, 35, 0.55);
}

body.lang-en .kadi-lines {
    font-size: calc(0.94rem * var(--reader-font-scale, 1));
    line-height: 1.72;
    letter-spacing: 0.1px;
}

/* Faded Guruji watermark on the right of each nondh (note) box */
.note-bg-image {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 170px;
    height: 144px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.32;
    pointer-events: none;
    z-index: 0;
    user-select: none;
    -webkit-mask-image: radial-gradient(circle at right center, #000 30%, transparent 78%);
            mask-image: radial-gradient(circle at right center, #000 30%, transparent 78%);
}

.verse-lines-body {
    font-size: calc(1.15rem * var(--reader-font-scale, 1));
    line-height: 2.1;
    color: #1e1e1e;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.verse-line-item {
    margin-bottom: 4px;
}

/* Notes & Unparsed Card */
.bhagavatam-note-card {
    background: rgba(247, 200, 68, 0.2);
    border: 1px solid rgba(230, 166, 35, 0.4);
    border-left: 4.5px solid #E65100;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 16px;
    font-size: calc(0.96rem * var(--reader-font-scale, 1));
    line-height: 1.8;
    color: #3d2f0a;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    pointer-events: none;
}

.toast {
    background: rgba(44, 44, 44, 0.92);
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    animation: toastFadeIn 0.3s ease-out;
}

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

/* ==========================================================================
   Header Action Buttons & Badges
   ========================================================================== */
.header-actions {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1002;
}

.header-actions button {
    position: relative;
    background: rgba(255, 255, 255, 0.75);
    border: 1.5px solid var(--glass-border);
    color: var(--color-royal-blue);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-actions button:hover {
    background: var(--color-royal-blue);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(165, 37, 44, 0.35);
}

.header-actions button.bookmarked {
    background: var(--color-royal-blue);
    color: #ffffff;
}

.reference-footer-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: #FF9800;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.4px;
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.reference-footer-banner p {
    margin: 0;
    text-align: center;
}

/* ==========================================================================
   Sticky Bottom Navigation Bar & Slider
   ========================================================================== */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(230, 166, 35, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 2px solid rgba(165, 37, 44, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.15);
}

.nav-btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--color-royal-blue);
    background: var(--color-royal-blue);
    color: #ffffff;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(165, 37, 44, 0.35);
    transition: var(--transition-smooth);
    flex-shrink: 0;
    user-select: none;
}

.nav-btn-icon:hover:not(:disabled) {
    background: #801b21;
    transform: scale(1.1);
}

.nav-btn-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.slider-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.slider-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-badge {
    background: transparent;
    color: var(--color-royal-blue);
    padding: 0 4px;
    border-radius: 0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

input[type="range"]#nav-prakaran-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(165, 37, 44, 0.25);
    outline: none;
    transition: background 0.3s;
}

input[type="range"]#nav-prakaran-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-royal-blue);
    border: 2.5px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}

input[type="range"]#nav-prakaran-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #801b21;
}

/* ==========================================================================
   Modals (Bookmarks & Settings)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.modal-card {
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    background: linear-gradient(135deg, #F7C844 0%, #E6A623 100%);
    border-radius: 20px;
    border: 2px solid var(--color-royal-blue);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.3);
}

.modal-header h3 {
    color: var(--color-royal-blue);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--color-royal-blue);
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.modal-close-btn:hover {
    transform: scale(1.2) rotate(90deg);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.bookmarks-list-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favourites-page-card {
    max-width: 700px;
}

.favourites-kadi-block {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--glass-border);
    text-align: center;
}

.favourites-kadi-text {
    font-family: Georgia, 'Noto Serif Gujarati', 'Noto Serif', serif;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--color-royal-blue);
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.favourites-kadi-source {
    margin-top: 10px;
    font-family: Georgia, 'Noto Serif Gujarati', 'Noto Serif', serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-electric-blue);
    font-style: italic;
    letter-spacing: 0.2px;
}

.favourites-kadi-en {
    display: none;
}

body.lang-en .favourites-kadi-gu {
    display: none;
}

body.lang-en .favourites-kadi-en {
    display: block;
}

.bookmark-item {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-royal-blue);
    transform: translateX(4px);
    box-shadow: 0 4px 14px rgba(165, 37, 44, 0.15);
}

.bookmark-info h4 {
    color: var(--color-royal-blue);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.bookmark-info p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.remove-bookmark-btn {
    background: transparent;
    border: none;
    color: #c62828;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-smooth);
}

.remove-bookmark-btn:hover {
    transform: scale(1.25);
}

/* Settings Card with Author background */
.settings-card {
    position: relative;
    overflow: hidden;
}

.settings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/images/author.png') no-repeat right bottom;
    background-size: 260px auto;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

.settings-body {
    position: relative;
    z-index: 1;
}

/* Standalone Settings Card Panel — same translucent glass look as the home page chapter tiles */
.settings-card-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--glass-border);
    border-radius: 22px;
    padding: 24px 20px;
    max-width: 650px;
    margin: 0 auto 30px auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.settings-card-panel::before {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 55%;
    aspect-ratio: 1 / 1;
    min-width: 260px;
    max-width: 460px;
    background: url('../assets/images/thakorjiMaharaj.png') no-repeat bottom right;
    background-size: contain;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
    -webkit-mask-image: radial-gradient(circle at bottom right, #000 45%, transparent 78%);
            mask-image: radial-gradient(circle at bottom right, #000 45%, transparent 78%);
}

/* Navigation Tabs Bar */
.settings-tab-nav {
    display: flex;
    gap: 6px;
    background: rgba(165, 37, 44, 0.08);
    padding: 4px;
    border-radius: 13px;
    border: 1px solid var(--glass-border);
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}

.settings-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-tab-btn i {
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.settings-tab-btn:hover {
    color: var(--color-royal-blue);
    background: rgba(255, 255, 255, 0.5);
}

.settings-tab-btn:hover i {
    transform: scale(1.15);
}

.settings-tab-btn.active {
    background: linear-gradient(135deg, var(--color-royal-blue) 0%, #7a151b 100%);
    color: #ffffff;
    border-color: rgba(230, 166, 35, 0.4);
    box-shadow: 0 4px 16px rgba(165, 37, 44, 0.28);
}

.settings-tab-btn.active i {
    color: #FFD700;
}

/* Tab Content Visibility & Animations */
.settings-tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.settings-tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Parichay Cards Container (Lekhak & Prakashak) */
.parichay-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.parichay-card {
    background: transparent;
    border: 1.5px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.parichay-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(165, 37, 44, 0.12);
}

/* Photo Circle Styling */
.parichay-avatar-wrap {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    position: relative;
    padding: 4px;
    background: linear-gradient(135deg, var(--color-royal-blue), #E6A623);
    box-shadow: 0 8px 24px rgba(165, 37, 44, 0.25);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.parichay-card:hover .parichay-avatar-wrap {
    transform: scale(1.05);
}

.parichay-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    display: block;
}

.parichay-avatar.author-photo {
    object-position: center 20%;
}

.parichay-avatar.publisher-photo {
    object-position: center center;
}

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

.parichay-role-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(165, 37, 44, 0.09);
    color: var(--color-royal-blue);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(165, 37, 44, 0.18);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.parichay-person-name {
    color: var(--color-royal-blue);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.45;
    margin-top: 4px;
}

.parichay-person-desc {
    color: var(--color-text-main);
    font-size: 0.92rem;
    font-weight: 500;
    opacity: 0.88;
}

.parichay-card-divider {
    text-align: center;
    position: relative;
    margin: 4px 0;
    color: rgba(165, 37, 44, 0.4);
    font-size: 0.85rem;
}

.parichay-card-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(165, 37, 44, 0.25), transparent);
    z-index: 0;
}

.parichay-card-divider i {
    position: relative;
    z-index: 1;
    background: rgba(255, 248, 235, 0.95);
    padding: 0 12px;
}

/* Settings Library Navigation (Journey / Favourites quick-access rows) */
.settings-section {
    margin-bottom: 20px;
    text-align: left;
}

.settings-section-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-royal-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-row-item {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-row-item.toggle-row {
    cursor: pointer;
    transition: transform 0.15s ease, background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.settings-row-item.toggle-row:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.15);
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.settings-row-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(165, 37, 44, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-row-icon-wrapper i {
    color: var(--color-royal-blue);
    font-size: 15px;
}

.settings-row-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-row-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.settings-row-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.settings-row-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-row-badge {
    background: rgba(165, 37, 44, 0.12);
    color: var(--color-royal-blue);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
}

.settings-row-chevron {
    color: #999;
    font-size: 12px;
}

/* Language Toggle Pill Control */
.lang-toggle-group {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 3px;
    gap: 3px;
}

.lang-toggle-btn {
    background: transparent;
    border: none;
    outline: none;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.lang-toggle-btn:hover {
    color: var(--color-text-main);
}

.lang-toggle-btn.active {
    background: var(--color-royal-blue);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(165, 37, 44, 0.3);
}

/* Custom Confirmation Modal */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

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

.custom-modal-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 235, 0.92));
    border: 1.5px solid var(--glass-border);
    border-radius: 20px;
    padding: 26px 22px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.active .custom-modal-card {
    transform: scale(1);
}

.custom-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(192, 38, 45, 0.12);
    color: #c0262d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 14px auto;
    border: 1px solid rgba(192, 38, 45, 0.2);
}

.custom-modal-title {
    color: var(--color-royal-blue);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.custom-modal-msg {
    color: var(--color-text-main);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 22px;
    opacity: 0.9;
}

.custom-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.custom-modal-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.custom-modal-btn.cancel-btn {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text-main);
    border-color: rgba(0, 0, 0, 0.1);
}

.custom-modal-btn.cancel-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

.custom-modal-btn.danger-confirm-btn {
    background: linear-gradient(135deg, #c0262d, #8f1b20);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(192, 38, 45, 0.25);
}

.custom-modal-btn.danger-confirm-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #9a1c22);
}

.font-size-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.font-ctrl-btn {
    padding: 8px 18px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
}

.font-preview-box {
    background: rgba(255, 255, 255, 0.8);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    text-align: center;
}

#font-preview-text {
    color: var(--color-royal-blue);
    font-weight: 600;
    font-size: calc(1rem * var(--reader-font-scale, 1));
    transition: font-size 0.2s ease;
}

.app-info-card {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    margin-top: 20px;
}

.app-info-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-info-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.app-info-brand h5 {
    color: var(--color-royal-blue);
    font-size: 0.95rem;
    font-weight: 700;
}

.app-version {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.danger-btn {
    width: 100%;
    padding: 12px;
    background: #c62828;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.danger-btn:hover {
    background: #a71d1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

/* ==========================================================================
   Home Screen Floating Action Button (FAB) Speed Dial (Compact)
   ========================================================================== */
.fab-container {
    position: fixed;
    bottom: 112px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.fab-container .fab-main-btn {
    pointer-events: auto;
}

/* .fab-item-btn only becomes clickable once the menu is actually open —
   see ".fab-container.open .fab-menu" below, which re-enables pointer-events
   for the whole menu (and its children) at that point. */

/* Floating search button — sits just below the settings FAB */
/* Floating Action Buttons (Search & Settings FABs) */
.fab-search-btn {
    position: fixed;
    bottom: 50px;
    right: 20px;
    z-index: 1050;
}

.fab-main-btn,
.fab-search-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none !important;
    color: var(--color-royal-blue);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.fab-main-btn:hover,
.fab-search-btn:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.75);
}

.fab-container.open .fab-main-btn,
.fab-search-btn.active {
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-royal-blue);
    transform: rotate(90deg);
}

/* Toggleable search bar on the chapters screen */
.search-bar-wrap {
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
}

.search-bar-wrap.open {
    max-height: 70px;
    opacity: 1;
    margin: 20px auto;
}

.search-bar-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: none !important;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--color-text-main);
    font-weight: 500;
    font-size: 0.92rem;
    outline: none;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.fab-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-container.open .fab-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fab-item-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none !important;
    color: var(--color-royal-blue);
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.fab-item-btn:hover {
    background: rgba(255, 255, 255, 0.75);
    color: var(--color-royal-blue);
    transform: translateX(-4px) scale(1.04);
}

.fab-item-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c62828;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1.5px solid #ffffff;
    line-height: 1;
}

/* ===========================================================
   Journey / Reading Progress Screen
   =========================================================== */
.journey-page-card {
    max-width: 560px;
}

.journey-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.journey-ring-wrap {
    position: relative;
    width: 100%;
    max-width: 440px;
    flex-shrink: 0;
    margin: 0 auto;
}

.journey-ring-svg {
    display: block;
    width: 100%;
    height: auto;
}

.journey-ring-track {
    fill: none;
    stroke: var(--glass-border);
    stroke-width: 8;
    stroke-linecap: round;
}

.journey-ring-fill {
    fill: none;
    stroke: var(--color-royal-blue);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.journey-ring-center {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.journey-ring-pct {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--color-royal-blue);
    line-height: 1.0;
}

.journey-ring-sub {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.journey-ring-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 6px;
    text-align: center;
}

.journey-continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    background: none;
    color: var(--color-royal-blue);
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: underline;
    transition: color 0.15s ease, transform 0.15s ease;
    margin-top: 8px;
}

.journey-continue-btn:hover {
    color: var(--color-electric-blue);
    transform: translateY(-1px);
}

.journey-continue-btn:active {
    transform: translateY(0);
}

.journey-continue-btn > i {
    color: inherit;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.journey-continue-target {
    font-weight: 700;
}

.journey-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-royal-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 22px 0 10px;
}

.journey-streak-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 16px;
}

.journey-week-dots {
    display: flex;
    gap: 8px;
}

.journey-week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.journey-week-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
}

.journey-week-day.active .journey-week-dot {
    background: var(--color-royal-blue);
}

.journey-week-letter {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--color-text-muted);
}

.journey-streak-count {
    text-align: center;
    flex-shrink: 0;
}

.journey-streak-count span:first-child {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-royal-blue);
    line-height: 1.1;
}

.journey-streak-unit {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.journey-chips {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.journey-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-main);
    font-family: inherit;
}

.journey-chip i {
    color: var(--color-royal-blue);
    font-size: 0.8rem;
}

.journey-chip b {
    font-weight: 800;
}

.journey-chip-link {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.journey-chip-link:active {
    transform: scale(0.97);
}

.journey-milestones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.journey-milestone {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 12px;
    opacity: 0.55;
}

.journey-milestone.done {
    opacity: 1;
    border-color: rgba(165, 37, 44, 0.25);
    box-shadow: 0 3px 10px rgba(165, 37, 44, 0.08);
}

.journey-milestone-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.journey-milestone-icon i {
    color: var(--color-text-muted);
    font-size: 14px;
}

.journey-milestone.done .journey-milestone-icon {
    background: rgba(165, 37, 44, 0.12);
}

.journey-milestone.done .journey-milestone-icon i {
    color: var(--color-royal-blue);
}

.journey-milestone-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.25;
}

.journey-milestone-desc {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    line-height: 1.2;
}

.journey-milestone-check {
    color: var(--color-royal-blue);
    font-size: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

.app-reset-row {
    text-align: center;
    margin-top: 22px;
}

.app-reset-link {
    background: none;
    border: none;
    color: #999;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 10px;
}

.app-reset-link:hover {
    color: #C62828;
}

@media (max-width: 480px) {
    .journey-milestones {
        grid-template-columns: 1fr;
    }
}

/* Global Screen Transition Loader */
.app-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(230, 166, 35, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.app-loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.app-loader-content {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--glass-border);
    padding: 14px 24px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-loader-icon {
    color: var(--color-royal-blue);
    font-size: 1.3rem;
}

.app-loader-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-royal-blue);
}

/* ==========================================================================
   English Mode Settings Screen Typography & Layout Scaling
   ========================================================================== */
body.lang-en .parichay-person-name {
    font-size: 1.05rem;
    line-height: 1.35;
}

body.lang-en .parichay-person-desc {
    font-size: 0.84rem;
}

body.lang-en .parichay-role-tag {
    font-size: 0.74rem;
    letter-spacing: 0.2px;
}

body.lang-en .settings-section-header {
    font-size: 0.78rem;
    letter-spacing: 0.3px;
}

body.lang-en .settings-row-title {
    font-size: 0.85rem;
    line-height: 1.3;
}

body.lang-en .settings-row-desc {
    font-size: 0.72rem;
    line-height: 1.25;
}

body.lang-en .settings-header-subtitle {
    font-size: 0.82rem;
}

body.lang-en .settings-tab-btn {
    font-size: 0.84rem;
}

body.lang-en .app-info-brand h5 {
    font-size: 0.88rem;
    line-height: 1.3;
}

body.lang-en .app-version {
    font-size: 0.72rem;
}

@media (max-width: 480px) {
    body.lang-en .parichay-person-name {
        font-size: 0.94rem;
        line-height: 1.3;
    }
    
    body.lang-en .parichay-person-desc {
        font-size: 0.78rem;
    }

    body.lang-en .settings-row-item {
        padding: 9px 12px;
        gap: 8px;
    }

    body.lang-en .settings-row-title {
        font-size: 0.81rem;
    }

    body.lang-en .settings-row-desc {
        font-size: 0.69rem;
    }

    body.lang-en .lang-toggle-btn {
        padding: 4px 10px;
        font-size: 0.74rem;
    }

    body.lang-en .settings-section-header {
        font-size: 0.74rem;
    }

    body.lang-en .settings-tab-btn {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    body.lang-en .settings-header-subtitle {
        font-size: 0.78rem;
    }
}

/* ==========================================================================
   Shabdardh (Glossary) Modal — matches app theme
   ========================================================================== */

.info-modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    background: rgba(255, 249, 230, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-royal-blue, #A5252C);
    border-radius: 20px;
    border: 1.5px solid var(--glass-border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header-titles {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-header-titles h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-royal-blue, #A5252C);
}

.modal-subtitle {
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.5);
    margin: 0;
}

.close-modal-btn {
    background: rgba(165, 37, 44, 0.12);
    border: 1.5px solid var(--color-royal-blue, #A5252C);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--color-royal-blue, #A5252C);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.close-modal-btn:hover {
    background: rgba(165, 37, 44, 0.22);
    transform: scale(1.08);
}

.info-modal-body {
    padding: 12px 14px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(165, 37, 44, 0.3) transparent;
}

.info-modal-body::-webkit-scrollbar {
    width: 4px;
}

.info-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.info-modal-body::-webkit-scrollbar-thumb {
    background: rgba(165, 37, 44, 0.3);
    border-radius: 4px;
}

/* Glossary cards */
.glossary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glossary-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1.5px solid rgba(165, 37, 44, 0.25);
    border-radius: 14px;
    padding: 12px 14px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.glossary-card:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.glossary-word-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.glossary-word-gu {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-royal-blue, #A5252C);
}

.glossary-word-en {
    font-size: 0.88rem;
    font-weight: 600;
    color: #6b1f23;
    font-style: italic;
}

.glossary-word-sub {
    font-size: 0.78rem;
    color: rgba(0, 0, 0, 0.4);
    font-style: normal;
}

.glossary-meaning,
.glossary-meaning-gu,
.glossary-meaning-en {
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(0, 0, 0, 0.72);
}

.glossary-empty {
    text-align: center;
    padding: 28px 20px;
    color: rgba(0, 0, 0, 0.38);
    font-style: italic;
    font-size: 0.9rem;
}

/* Dark reader theme override — solid charcoal to match app theme */
body.reader-theme-dark .info-modal-content {
    background: rgba(28, 25, 23, 0.96);
    border-color: rgba(230, 166, 35, 0.45);
    color: #f7c844;
}

body.reader-theme-dark .info-modal-content .modal-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(230, 166, 35, 0.25);
}

body.reader-theme-dark .modal-header-titles h2 {
    color: #f7c844;
}

body.reader-theme-dark .modal-subtitle {
    color: rgba(255, 255, 255, 0.45);
}

body.reader-theme-dark .close-modal-btn {
    border-color: #f7c844;
    color: #f7c844;
    background: rgba(247, 200, 68, 0.1);
}

body.reader-theme-dark .close-modal-btn:hover {
    background: rgba(247, 200, 68, 0.22);
}

body.reader-theme-dark .glossary-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(247, 200, 68, 0.25);
}

body.reader-theme-dark .glossary-card:hover {
    background: rgba(255, 255, 255, 0.14);
}

body.reader-theme-dark .glossary-word-gu {
    color: #f7c844;
}

body.reader-theme-dark .glossary-word-en {
    color: #ffd580;
}

body.reader-theme-dark .glossary-word-sub {
    color: rgba(255, 255, 255, 0.5);
}

body.reader-theme-dark .glossary-meaning,
body.reader-theme-dark .glossary-meaning-gu,
body.reader-theme-dark .glossary-meaning-en {
    color: rgba(255, 255, 255, 0.78);
}

body.reader-theme-dark .glossary-empty {
    color: rgba(255, 255, 255, 0.35);
}

/* Light reader theme override — solid white to match the app's white cards */
body.reader-theme-light .info-modal-content {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(165, 37, 44, 0.25);
}

/* Yellow/sepia reader theme — solid parchment tone to match the reader background */
body.reader-theme-yellow .info-modal-content {
    background: rgba(250, 224, 138, 0.96);
    border-color: rgba(122, 32, 0, 0.35);
}

body.reader-theme-yellow .modal-header-titles h2,
body.reader-theme-yellow .close-modal-btn,
body.reader-theme-yellow .glossary-word-gu {
    color: #7a2000;
}

body.reader-theme-yellow .glossary-card {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(122, 32, 0, 0.25);
}


