/* ============================================
   Quran Companion — Ramadan Edition
   Premium Islamic Design System
   ============================================ */

:root {
    /* Light Theme — Warm Parchment Palette */
    --bg-primary: #f8f5f0;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0ebe3;
    --bg-hover: #ece6db;
    --text-primary: #1a1612;
    --text-secondary: #5c5347;
    --text-tertiary: #8a7f72;
    --accent: #0d6b3f;
    --accent-rgb: 13, 107, 63;
    --accent-light: #e6f4ec;
    --accent-lighter: #f0faf5;
    --accent-dark: #0a5632;
    --gold: #c8a84e;
    --gold-rgb: 200, 168, 78;
    --gold-light: #faf6e8;
    --gold-dark: #a68a2e;
    --border: #e2ddd4;
    --border-light: #eee9e0;
    --shadow-sm: 0 1px 3px rgba(26, 22, 18, 0.05), 0 1px 2px rgba(26, 22, 18, 0.03);
    --shadow-md: 0 4px 16px rgba(26, 22, 18, 0.07), 0 2px 4px rgba(26, 22, 18, 0.04);
    --shadow-lg: 0 8px 40px rgba(26, 22, 18, 0.1), 0 4px 8px rgba(26, 22, 18, 0.05);
    --shadow-glow: 0 0 20px rgba(13, 107, 63, 0.1);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --font-arabic: 'Amiri', serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --verse-highlight: rgba(13, 107, 63, 0.06);
    --verse-playing: rgba(200, 168, 78, 0.1);
    --danger: #c53030;
    --danger-light: #fff5f5;
    --streak-color: #e8590c;
    --header-height: 60px;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-hover: #2e2e2e;
    --text-primary: #e8e0d4;
    --text-secondary: #a89f93;
    --text-tertiary: #7a7268;
    --accent: #3dd68c;
    --accent-rgb: 61, 214, 140;
    --accent-light: rgba(61, 214, 140, 0.1);
    --accent-lighter: rgba(61, 214, 140, 0.05);
    --accent-dark: #2ebd78;
    --gold: #e8c96a;
    --gold-rgb: 232, 201, 106;
    --gold-light: rgba(232, 201, 106, 0.08);
    --gold-dark: #c8a84e;
    --border: #2a2a2a;
    --border-light: #222222;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 20px rgba(61, 214, 140, 0.08);
    --verse-highlight: rgba(61, 214, 140, 0.06);
    --verse-playing: rgba(232, 201, 106, 0.08);
    --danger: #fc8181;
    --danger-light: rgba(252, 129, 129, 0.08);
    --glass-bg: rgba(26, 26, 26, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ============================================
   Loading Screen — Premium
   ============================================ */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0d6b3f 0%, #0a5632 40%, #073d24 100%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(200, 168, 78, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(200, 168, 78, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(200, 168, 78, 0.3) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px, 30px 30px;
    animation: pattern-drift 20s linear infinite;
}

@keyframes pattern-drift {
    from { transform: translate(0, 0); }
    to { transform: translate(30px, 30px); }
}

.loading-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.loading-ornament {
    margin-bottom: 2rem;
}

.loading-geometric {
    width: 100px;
    height: 100px;
    animation: gentle-spin 8s linear infinite;
}

.loading-geometric .star-outer {
    animation: star-pulse 3s ease-in-out infinite;
}

.loading-geometric .star-inner {
    animation: star-pulse 3s ease-in-out infinite reverse;
}

@keyframes gentle-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes star-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

.loading-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.loading-subtitle {
    font-size: 1rem;
    opacity: 0.7;
    margin-bottom: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.loading-bar {
    width: 180px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), #f0d060);
    border-radius: 2px;
    animation: loading-fill 1.5s ease-in-out forwards;
    box-shadow: 0 0 8px rgba(200, 168, 78, 0.5);
}

@keyframes loading-fill {
    0% { width: 0%; }
    60% { width: 70%; }
    100% { width: 100%; }
}

/* ============================================
   Header — Glass Morphism
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.05);
}

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

.icon-btn.active {
    color: var(--accent);
    background: var(--accent-light);
}

/* ============================================
   Search Bar — Enhanced
   ============================================ */

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slide-down 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease;
    min-width: 28px;
    min-height: 28px;
}
.search-clear-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}
.search-clear-btn.hidden { display: none; }

.search-bar input {
    width: 100%;
    height: 42px;
    padding: 0 2.5rem 0 2.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.25s ease;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.search-bar input::placeholder {
    color: var(--text-tertiary);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.view {
    animation: fade-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ============================================
   Hero Section — Premium
   ============================================ */

.hero {
    position: relative;
    margin: 1rem;
    padding: 1.5rem 1.25rem 1.25rem;
    background: linear-gradient(145deg, #0d6b3f 0%, #0a5632 50%, #073d24 100%);
    border-radius: var(--radius-2xl);
    color: white;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 8px 32px rgba(13, 107, 63, 0.25), 0 2px 8px rgba(0,0,0,0.1);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(200,168,78,0.8) 1px, transparent 1px),
        radial-gradient(circle at 80% 50%, rgba(200,168,78,0.8) 1px, transparent 1px),
        radial-gradient(circle at 50% 20%, rgba(200,168,78,0.8) 1px, transparent 1px),
        radial-gradient(circle at 50% 80%, rgba(200,168,78,0.8) 1px, transparent 1px);
    background-size: 40px 40px;
}

.hero-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(200,168,78,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
}

/* Top row: greeting + Ramadan badge */
.hero-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.hero-greeting {
    font-size: 0.82rem;
    opacity: 0.85;
    font-weight: 500;
    text-align: left;
}

.hero-ramadan-badge {
    display: none;
}

.hero-ramadan-badge.visible {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: rgba(200, 168, 78, 0.2);
    border: 1px solid rgba(200, 168, 78, 0.35);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #f0d78c;
    white-space: nowrap;
}

.hero-ramadan-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Bismillah */
.hero-bismillah {
    font-family: var(--font-arabic);
    font-size: 1.75rem;
    line-height: 1.8;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Daily verse */
.hero-daily-verse {
    margin-bottom: 0.75rem;
}

.hero-daily-verse:empty {
    display: none;
}

.hero-verse-text {
    font-family: var(--font-arabic);
    font-size: 1.05rem;
    line-height: 1.9;
    opacity: 0.9;
    margin-bottom: 0.2rem;
    direction: rtl;
}

.hero-verse-ref {
    font-size: 0.7rem;
    opacity: 0.55;
    font-weight: 500;
}

/* Continue reading button inside hero */
.hero-continue {
    margin-bottom: 0.75rem;
}

.hero-continue:empty {
    display: none;
}

.hero-continue-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.hero-continue-btn:hover {
    background: rgba(255,255,255,0.18);
}

.hero-continue-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.hero-continue-text {
    flex: 1;
    min-width: 0;
}

.hero-continue-title {
    font-size: 0.82rem;
    font-weight: 600;
}

.hero-continue-sub {
    font-size: 0.7rem;
    opacity: 0.65;
}

.hero-continue-arrow {
    opacity: 0.5;
    flex-shrink: 0;
}

/* Divider */
.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.hero-divider-line {
    display: block;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
}

/* Progress row: ring + stats */
.hero-progress-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-progress-ring {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.hero-progress-ring .progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.hero-progress-ring .progress-track {
    fill: none;
    stroke: rgba(255,255,255,0.12);
    stroke-width: 5;
}

.hero-progress-ring .progress-fill {
    fill: none;
    stroke: #c8a84e;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 213.6;
    stroke-dashoffset: 213.6;
    transition: stroke-dashoffset 0.8s ease;
}

.progress-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-pct {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.1;
}

.progress-label {
    font-size: 0.55rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Stats grid */
.hero-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.hero-stat {
    text-align: center;
    padding: 0.35rem 0;
}

.hero-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.hero-stat-label {
    font-size: 0.6rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.hero-stat-icon {
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

/* ============================================
   Sections
   ============================================ */

.section {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ============================================
   Continue Reading Card
   ============================================ */

.continue-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-sm);
}

.continue-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.continue-card .card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-lighter));
    color: var(--accent);
    border-radius: var(--radius-md);
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.continue-card .card-text {
    flex: 1;
    min-width: 0;
}

.continue-card .card-title {
    font-weight: 600;
    font-size: 1rem;
}

.continue-card .card-subtitle {
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.continue-card .card-arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.continue-card:hover .card-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* ============================================
   Streak Widget
   ============================================ */

.streak-widget {
    margin-top: 0;
}

.streak-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.streak-flame {
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.streak-flame.active {
    color: var(--streak-color);
    animation: flame-pulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(232, 89, 12, 0.3));
}

@keyframes flame-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.streak-count {
    font-size: 1.05rem;
    font-weight: 700;
}

.streak-count span {
    color: var(--streak-color);
    font-size: 1.35rem;
}

.streak-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* ============================================
   Filter Tabs — Pill Style
   ============================================ */

.filter-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.filter-tab {
    padding: 0.35rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.filter-tab.active {
    background: var(--bg-secondary);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.filter-tab:hover:not(.active) {
    color: var(--text-secondary);
}

/* ============================================
   Surah List — Refined Cards
   ============================================ */

.surah-list {
    display: grid;
    gap: 0.4rem;
}

.surah-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.surah-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    transition: width 0.3s ease;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.surah-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.surah-card:hover::before {
    width: 3px;
}

.surah-card:active {
    transform: translateY(0);
}

.surah-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
    position: relative;
}

.surah-number::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1.5px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 50%;
    transform: rotate(45deg);
}

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

.surah-name-en {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
}

.surah-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.surah-name-ar {
    font-family: var(--font-arabic);
    font-size: 1.35rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.surah-card:hover .surah-name-ar {
    color: var(--accent);
}

/* ============================================
   Reader View — Clean & Focused
   ============================================ */

.reader-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.reader-info {
    flex: 1;
    min-width: 0;
    text-align: center;
    line-height: 1.3;
}

.reader-surah-name {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-surah-meta {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    line-height: 1.2;
}

.reader-actions {
    display: flex;
    gap: 0.25rem;
}

/* Reader Controls */

.reader-controls {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.control-group label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.control-group select {
    padding: 0.4rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    min-width: 0;
    transition: border-color 0.2s ease;
}

.control-group select:focus {
    border-color: var(--accent);
}

.font-size-control {
    flex: 0 0 auto;
}

.font-size-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.small-btn {
    padding: 0.3rem 0.65rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.small-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

#font-size-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 1.5rem;
    text-align: center;
}

/* Bismillah — Decorated */

.reader-bismillah {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

.bismillah-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.bismillah-line {
    display: block;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.bismillah-arabic {
    font-family: var(--font-arabic);
    font-size: 1.8rem;
    color: var(--accent);
    line-height: 2;
}

/* Verses — Elevated */

.verses-container {
    padding: 0.5rem 0;
}

.verse {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
}

.verse:hover {
    background: var(--verse-highlight);
}

.verse.playing {
    background: var(--verse-playing);
}

.verse.playing::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(var(--gold-rgb), 0.3);
}

.verse-arabic {
    font-family: var(--font-arabic);
    font-size: 28px;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    word-spacing: 0.1em;
}

.verse-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    font-size: 0.65em;
    color: var(--accent);
    margin: 0 0.25rem;
    vertical-align: middle;
    opacity: 0.6;
}

.verse-translation {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.verse-actions {
    display: flex;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.verse:hover .verse-actions {
    opacity: 1;
}

.verse-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-family: var(--font-ui);
    font-size: 0.73rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.verse-action-btn:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.verse-action-btn.bookmarked {
    color: var(--gold);
    background: var(--gold-light);
}

.verse-action-btn svg {
    width: 14px;
    height: 14px;
}

/* Surah Navigation */

.surah-nav {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    gap: 1rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
    box-shadow: var(--shadow-sm);
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    border-color: var(--border);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    box-shadow: none;
}

/* ============================================
   Bookmarks View
   ============================================ */

.page-header {
    padding: 1.5rem 1rem 1rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 0.2rem;
}

.bookmarks-list {
    padding: 0 1rem;
    display: grid;
    gap: 0.5rem;
}

.bookmark-card {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.bookmark-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bookmark-card:hover {
    border-color: rgba(var(--gold-rgb), 0.3);
    box-shadow: var(--shadow-sm);
}

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

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

.bookmark-surah {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--accent);
}

.bookmark-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookmark-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.bookmark-arabic {
    font-family: var(--font-arabic);
    font-size: 1.35rem;
    line-height: 2;
    direction: rtl;
    text-align: right;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-translation {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-icon {
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.empty-state p {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.empty-hint {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    margin-top: 0.15rem !important;
    opacity: 0.6;
}

/* ============================================
   Ramadan Plan View
   ============================================ */

.ramadan-progress {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    margin: 0 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.progress-ring-container {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    stroke: var(--border);
}

.progress-ring-fill {
    stroke: var(--accent);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.progress-stats {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.stat {
    text-align: center;
}

.stat span {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.ramadan-days {
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.45rem;
}

.day-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.day-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.day-card.completed {
    background: var(--accent-light);
    border-color: rgba(var(--accent-rgb), 0.25);
}

.day-number {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.day-card.completed .day-number {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

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

.day-juz {
    font-weight: 600;
    font-size: 0.88rem;
}

.day-range {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.day-check {
    color: var(--accent);
    opacity: 0;
    transition: all 0.25s ease;
    transform: scale(0.8);
}

.day-card.completed .day-check {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   Settings — Clean Cards
   ============================================ */

.settings-list {
    padding: 0 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin: 0 1rem;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
}

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

.setting-info h3 {
    font-size: 0.92rem;
    font-weight: 600;
}

.setting-info p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 26px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

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

.danger-btn {
    padding: 0.5rem 1.15rem;
    border: 1.5px solid var(--danger);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--danger);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.danger-btn:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(197, 48, 48, 0.25);
}

/* ============================================
   Audio Player — Elevated Glass
   ============================================ */

.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    animation: slide-up 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.audio-progress-bar {
    height: 3px;
    background: var(--border);
    cursor: pointer;
    position: relative;
}

.audio-progress-bar:hover {
    height: 5px;
}

.audio-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    transition: width 0.1s linear;
    position: relative;
}

.audio-progress::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.audio-progress-bar:hover .audio-progress::after {
    opacity: 1;
}

.audio-controls {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 1rem;
}

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

.audio-verse-info {
    font-size: 0.83rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-btn:hover {
    background: var(--bg-tertiary);
}

.audio-btn:active {
    transform: scale(0.92);
}

.audio-btn.play-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.3);
}

.audio-btn.play-btn:hover {
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4);
    transform: scale(1.05);
}

.audio-btn.small {
    width: 32px;
    height: 32px;
}

.audio-btn.active {
    color: var(--accent);
}

.audio-extra {
    display: flex;
    gap: 0.15rem;
}

/* ============================================
   Toast Notifications — Refined
   ============================================ */

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.7rem 1.5rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-xl);
    font-size: 0.83rem;
    font-weight: 500;
    z-index: 300;
    animation: toast-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), toast-out 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.1s forwards;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    white-space: nowrap;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    to { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.95); }
}

/* ============================================
   Responsive — Mobile-first
   ============================================ */

@media (max-width: 600px) {
    .hero-bismillah { font-size: 1.4rem; }
    .hero-stat-value { font-size: 1rem; }
    .hero-progress-ring { width: 64px; height: 64px; }
    .progress-pct { font-size: 0.82rem; }

    .reader-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .control-group { flex: unset; }

    .verse-arabic { font-size: 24px; line-height: 2; }

    .ramadan-progress {
        flex-direction: column;
        text-align: center;
    }

    .progress-stats { justify-content: center; }

    .ramadan-days {
        grid-template-columns: 1fr;
    }

    .audio-controls {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .audio-extra { display: none; }

    .goals-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .goal-card {
        padding: 0.75rem 0.5rem;
    }

    .goal-value {
        font-size: 1.1rem;
    }

    .header-title { font-size: 1rem; }

    .settings-list {
        margin: 0 0.5rem;
    }

    .hero {
        margin: 0.75rem;
        border-radius: var(--radius-xl);
    }
}

@media (min-width: 601px) {
    .verse-actions {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .verse-actions {
        opacity: 1;
    }
}

/* ============================================
   Scrollbar — Minimal
   ============================================ */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============================================
   Selection
   ============================================ */

::selection {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--text-primary);
}

/* ============================================
   Focus Styles — Accessibility
   ============================================ */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   Ramadan Countdown
   ============================================ */

.ramadan-countdown {
    margin-top: 0;
}

.countdown-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.countdown-before {
    border-color: rgba(var(--gold-rgb), 0.3);
    background: var(--gold-light);
}

.countdown-during {
    border-color: rgba(var(--accent-rgb), 0.3);
    background: var(--accent-light);
}

.countdown-moon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--gold);
    flex-shrink: 0;
}

.countdown-moon.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.countdown-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.countdown-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ============================================
   Daily Goals
   ============================================ */

.daily-goals {
    margin-top: 0;
}

.goals-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.goal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.goal-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.goal-icon-recite {
    background: var(--accent-light);
    color: var(--accent);
}

.goal-icon-listen {
    background: var(--gold-light);
    color: var(--gold);
}

.goal-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.goal-adjuster {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goal-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-ui);
    line-height: 1;
}

.goal-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.goal-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 1.5rem;
}

.goal-unit {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.goal-remaining {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    min-height: 1.1em;
}

.goal-remaining.goal-complete {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   Reader Timer Bar
   ============================================ */

.reader-timer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: calc(var(--header-height) + 42px);
    z-index: 45;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.timer-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.timer-item svg {
    flex-shrink: 0;
}

.timer-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.timer-time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    min-width: 3rem;
}

.timer-ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-ctrl:hover {
    background: var(--accent);
    color: white;
}

/* ==========================================
   Tajweed Color Rules
   ========================================== */

/* Tajweed toggle button in controls */
.tajweed-toggle {
    flex: 0 0 auto;
}

.tajweed-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tajweed-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.tajweed-btn .tajweed-dot {
    display: flex;
    gap: 2px;
}

.tajweed-dot span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.tajweed-dot span:nth-child(1) { background: #DD0008; }
.tajweed-dot span:nth-child(2) { background: #169777; }
.tajweed-dot span:nth-child(3) { background: #537FFF; }

/* Tajweed color classes — applied to <tajweed> elements from API */
tajweed {
    font-style: normal;
}

tajweed.ham_wasl {
    color: #AAAAAA;
}

tajweed.laam_shamsiyah {
    color: #AAAAAA;
}

tajweed.madda_normal {
    color: #537FFF;
}

tajweed.madda_permissible {
    color: #4050FF;
}

tajweed.madda_obligatory {
    color: #2144C1;
}

tajweed.madda_necessary {
    color: #000EBC;
}

tajweed.ghunnah {
    color: #FF7E1E;
}

tajweed.ikhafa {
    color: #D500B7;
}

tajweed.ikhafa_shafawi {
    color: #D500B7;
}

tajweed.idghaam_shafawi {
    color: #58B800;
}

tajweed.idghaam_ghunnah {
    color: #169777;
}

tajweed.idghaam_no_ghunnah {
    color: #169777;
}

tajweed.idghaam_mutajanisayn {
    color: #A1A1A1;
}

tajweed.idghaam_mutaqaribayn {
    color: #A1A1A1;
}

tajweed.iqlab {
    color: #26BFFD;
}

tajweed.qalqalah {
    color: #DD0008;
}

tajweed.silent {
    color: #AAAAAA;
}

/* Dark mode adjustments — brighten tajweed colors for contrast */
[data-theme="dark"] tajweed.madda_normal { color: #7BA3FF; }
[data-theme="dark"] tajweed.madda_permissible { color: #7B8BFF; }
[data-theme="dark"] tajweed.madda_obligatory { color: #5B7AE6; }
[data-theme="dark"] tajweed.madda_necessary { color: #4466E6; }
[data-theme="dark"] tajweed.ghunnah { color: #FFA04E; }
[data-theme="dark"] tajweed.ikhafa,
[data-theme="dark"] tajweed.ikhafa_shafawi { color: #E94ED4; }
[data-theme="dark"] tajweed.idghaam_ghunnah,
[data-theme="dark"] tajweed.idghaam_no_ghunnah { color: #2BD4A0; }
[data-theme="dark"] tajweed.iqlab { color: #4ED4FF; }
[data-theme="dark"] tajweed.qalqalah { color: #FF4D54; }
[data-theme="dark"] tajweed.idghaam_shafawi { color: #7BD44E; }
[data-theme="dark"] tajweed.ham_wasl,
[data-theme="dark"] tajweed.laam_shamsiyah,
[data-theme="dark"] tajweed.silent,
[data-theme="dark"] tajweed.idghaam_mutajanisayn,
[data-theme="dark"] tajweed.idghaam_mutaqaribayn { color: #888; }

/* Tajweed legend */
.tajweed-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.tajweed-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.tajweed-legend-item .swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ==========================================
   PWA — Native App Polish
   ========================================== */

/* Prevent pull-to-refresh & overscroll bounce */
html {
    overscroll-behavior-y: contain;
}

/* Safe area insets for notched devices */
body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.audio-player {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Disable text selection on interactive elements for native feel */
.header, .icon-btn, .surah-card, .filter-tab, .goal-btn,
.nav-btn, .audio-btn, .day-card, .bookmark-card, .continue-card,
.install-banner, .toggle, .small-btn, .danger-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* Tap highlight — subtle instead of browser default */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth momentum scrolling */
.main-content, .surah-list, .verses-container, .bookmarks-list, .ramadan-days {
    -webkit-overflow-scrolling: touch;
}

/* Standalone mode — adjust header when there's no browser chrome */
@media (display-mode: standalone) {
    .header {
        padding-top: env(safe-area-inset-top);
    }

    body {
        padding-top: 0;
    }
}

/* Install banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.35s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.install-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.install-banner-text strong {
    font-size: 0.88rem;
    color: var(--text-primary);
}

.install-banner-text span {
    font-size: 0.73rem;
    color: var(--text-tertiary);
}

.install-banner-btn {
    padding: 0.5rem 1.1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.install-banner-btn:active {
    opacity: 0.8;
}

.install-banner-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

/* Settings select dropdown */
.setting-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-ui);
    cursor: pointer;
}

/* ============================================
   RTL (Arabic) Layout
   ============================================ */
[dir="rtl"] {
    font-family: 'Amiri', var(--font-ui), sans-serif;
}

[dir="rtl"] .header-left,
[dir="rtl"] .header-right {
    flex-direction: row-reverse;
}

[dir="rtl"] .header { flex-direction: row-reverse; }

[dir="rtl"] .hero-top-row { flex-direction: row-reverse; }
[dir="rtl"] .hero-greeting { text-align: right; }
[dir="rtl"] .hero-continue-btn { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .hero-continue-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .hero-progress-row { flex-direction: row-reverse; }

[dir="rtl"] .surah-card {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .surah-name-ar {
    order: -1;
}

[dir="rtl"] .section-header { flex-direction: row-reverse; }

[dir="rtl"] .setting-item { flex-direction: row-reverse; }
[dir="rtl"] .setting-info { text-align: right; }

[dir="rtl"] .streak-info { flex-direction: row-reverse; text-align: right; }

[dir="rtl"] .continue-card { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .continue-card .card-arrow svg { transform: scaleX(-1); }

[dir="rtl"] .countdown-card { flex-direction: row-reverse; text-align: right; }

[dir="rtl"] .bookmark-card { text-align: right; }
[dir="rtl"] .bookmark-header { flex-direction: row-reverse; }

[dir="rtl"] .page-header { text-align: right; }

[dir="rtl"] .verse-actions { flex-direction: row-reverse; }

[dir="rtl"] .nav-btn svg { transform: scaleX(-1); }
[dir="rtl"] .surah-nav { flex-direction: row-reverse; }

[dir="rtl"] .reader-header { flex-direction: row-reverse; }
[dir="rtl"] .reader-info { text-align: right; }
[dir="rtl"] #btn-back svg { transform: scaleX(-1); }

[dir="rtl"] .control-group { text-align: right; }

[dir="rtl"] .timer-item { flex-direction: row-reverse; }

[dir="rtl"] .goal-card { text-align: right; }

[dir="rtl"] .ramadan-progress { flex-direction: row-reverse; }

[dir="rtl"] .search-input-wrapper { flex-direction: row-reverse; }

[dir="rtl"] .empty-state { text-align: right; }

[dir="rtl"] .install-banner { flex-direction: row-reverse; text-align: right; }

[dir="rtl"] .ramadan-banner-content { flex-direction: row-reverse; }
[dir="rtl"] .ramadan-banner-left { flex-direction: row-reverse; }
[dir="rtl"] .day-juz-row { flex-direction: row-reverse; }
[dir="rtl"] .day-card { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .day-actions { flex-direction: row-reverse; }

/* ============================================
   Reader Ramadan Progress Banner
   ============================================ */

.reader-ramadan-banner {
    z-index: 44;
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--gold-rgb), 0.06));
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ramadan-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    max-width: 800px;
    margin: 0 auto;
}

.ramadan-banner-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    color: var(--accent);
}

.ramadan-banner-juz {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
}

.ramadan-banner-today {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 999px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ramadan-banner-done {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
}

.ramadan-banner-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 200px;
}

.ramadan-banner-bar {
    flex: 1;
    height: 5px;
    background: rgba(var(--accent-rgb), 0.12);
    border-radius: 5px;
    overflow: hidden;
}

.ramadan-banner-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ramadan-banner-fill.completed {
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.ramadan-banner-pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 2rem;
    text-align: right;
}

/* ============================================
   Surah Card — Today's Juz Badge
   ============================================ */

.surah-card.todays-juz {
    border-color: rgba(var(--accent-rgb), 0.2);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(var(--accent-rgb), 0.03));
}

.surah-card.todays-juz::before {
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--gold));
}

.surah-juz-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.08rem 0.35rem;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 0.35rem;
}

[dir="rtl"] .surah-juz-badge {
    margin-left: 0;
    margin-right: 0.35rem;
}

[dir="rtl"] .sunnah-header { flex-direction: row-reverse; }
[dir="rtl"] .sunnah-header-left { text-align: right; }
[dir="rtl"] .sunnah-task { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .sunnah-reward-task { direction: rtl; }

/* ============================================
   Enhanced Day Cards — Progress Bars + Actions
   ============================================ */

.day-card.today {
    border-color: rgba(var(--accent-rgb), 0.35);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.06), rgba(var(--gold-rgb), 0.04));
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.1), var(--shadow-sm);
}

.day-card.in-progress {
    border-color: rgba(var(--gold-rgb), 0.3);
}

.day-card.today .day-number {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
}

.day-juz-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.day-today-badge {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.day-progress-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.day-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-width: 0;
}

.day-progress-fill.done {
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
}

.day-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.day-read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-read-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
    transform: scale(1.08);
}

.day-check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.day-check-btn:hover {
    border-color: var(--accent);
    color: rgba(var(--accent-rgb), 0.3);
}

.day-check-btn.checked {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.3);
}

.day-check {
    display: none;
}

/* ============================================
   Milestone Celebration Overlay
   ============================================ */

.milestone-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: milestone-fade-in 0.4s ease;
}

@keyframes milestone-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.milestone-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(var(--gold-rgb), 0.15);
    max-width: 320px;
    width: 90%;
    animation: milestone-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes milestone-pop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.milestone-stars {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.75rem;
    letter-spacing: 0.3rem;
    text-shadow: 0 2px 10px rgba(var(--gold-rgb), 0.3);
    animation: milestone-sparkle 1.5s ease-in-out infinite;
}

@keyframes milestone-sparkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.milestone-message {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.milestone-btn {
    padding: 0.6rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.3);
}

.milestone-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4);
}

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

/* ============================================
   Sunnah Tasks
   ============================================ */

.sunnah-tasks-section {
    margin-bottom: 1.5rem;
}

.sunnah-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.sunnah-header-left {
    flex: 1;
}

.sunnah-subtitle {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.sunnah-counter {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.sunnah-all-done {
    text-align: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--accent-lighter), var(--gold-light));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
    animation: sunnah-all-done-glow 2s ease-in-out infinite;
}

.sunnah-all-done-icon {
    font-size: 1rem;
}

@keyframes sunnah-all-done-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(var(--accent-rgb), 0); }
    50% { box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.12); }
}

.sunnah-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sunnah-task {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-sm);
}

.sunnah-task:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-1px);
}

.sunnah-task:active {
    transform: translateY(0);
}

.sunnah-task.completed {
    opacity: 0.7;
    cursor: default;
    border-color: var(--border);
    background: var(--bg-tertiary);
}

.sunnah-task.completed:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.sunnah-task-icon {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.sunnah-task-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.sunnah-task.completed .sunnah-task-name {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.sunnah-task-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.1rem;
    line-height: 1.3;
}

.sunnah-task-action {
    flex-shrink: 0;
}

.sunnah-read-btn {
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
    white-space: nowrap;
}

.sunnah-read-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.35);
}

.sunnah-read-btn:active {
    transform: translateY(0);
}

.sunnah-done-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Sunnah Reward Animation */

.sunnah-reward-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: sunnah-reward-fade-in 0.4s ease;
}

@keyframes sunnah-reward-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sunnah-reward-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(var(--gold-rgb), 0.2);
    max-width: 320px;
    width: 90%;
    position: relative;
    overflow: hidden;
    animation: sunnah-reward-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sunnah-reward-pop {
    from { transform: scale(0.7) rotate(-3deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.sunnah-reward-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--gold-rgb), 0.08) 0%, transparent 60%);
    animation: sunnah-glow-spin 4s linear infinite;
    pointer-events: none;
}

@keyframes sunnah-glow-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sunnah-reward-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: sunnah-icon-bounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes sunnah-icon-bounce {
    from { transform: scale(0) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.sunnah-reward-stars {
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    letter-spacing: 0.3rem;
    text-shadow: 0 2px 10px rgba(var(--gold-rgb), 0.3);
    animation: sunnah-stars-twinkle 1.5s ease-in-out infinite;
}

@keyframes sunnah-stars-twinkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

.sunnah-reward-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.sunnah-reward-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.sunnah-reward-task {
    font-size: 0.82rem;
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding: 0.3rem 0.8rem;
    background: var(--gold-light);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.sunnah-reward-btn {
    padding: 0.6rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.3);
}

.sunnah-reward-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4);
}

.sunnah-reward-btn:active {
    transform: translateY(0);
}

/* ============================================
   Daily Challenges
   ============================================ */

.challenges-section {
    margin-bottom: 1.5rem;
}

.challenge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.challenge-header-left {
    flex: 1;
}

.challenge-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.challenge-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.challenge-counter {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.challenge-all-done {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--accent-light), rgba(var(--accent-rgb), 0.15));
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
}

.challenge-all-done-icon {
    font-size: 1.2rem;
}

.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.challenge-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
}

.challenge-item.completed {
    opacity: 0.7;
}

.challenge-item.completed .challenge-label {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.challenge-check {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.challenge-item.completed .challenge-check {
    background: var(--accent);
    border-color: var(--accent);
}

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

.challenge-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.challenge-progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 0.4rem;
    overflow: hidden;
}

.challenge-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.challenge-progress-text {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

/* Challenge Reward Overlay */
.challenge-reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    animation: sunnah-overlay-in 0.3s ease;
}

.challenge-reward-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 340px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: sunnah-card-pop 0.4s ease;
    overflow: hidden;
}

.challenge-reward-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.challenge-reward-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.challenge-reward-sub {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* RTL support */
[dir="rtl"] .challenge-header { flex-direction: row-reverse; }
[dir="rtl"] .challenge-header-right { flex-direction: row-reverse; }
[dir="rtl"] .challenge-item { flex-direction: row-reverse; }

/* ============================================
   Responsive additions
   ============================================ */

@media (max-width: 600px) {
    .ramadan-banner-right {
        max-width: 140px;
    }

    .day-card {
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }

    .day-read-btn {
        width: 28px;
        height: 28px;
    }

    .day-check-btn {
        width: 24px;
        height: 24px;
    }

    .day-read-btn svg {
        width: 14px;
        height: 14px;
    }

    .day-check-btn svg {
        width: 14px;
        height: 14px;
    }

    .milestone-card {
        padding: 2rem 1.5rem;
    }

    .sunnah-task {
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }

    .sunnah-task-icon {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .sunnah-read-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .sunnah-reward-card {
        padding: 2rem 1.5rem;
    }
}

/* Print */
@media print {
    .header, .audio-player, .search-bar, .reader-controls, .verse-actions, .surah-nav, .reader-timer-bar, .install-banner, .reader-ramadan-banner, .sunnah-tasks-section, .bottom-nav { display: none; }
    .verse { break-inside: avoid; }
}

/* ============================================
   UI/UX Improvements — Phase 2
   ============================================ */

/* === Skip Link (Accessibility) === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* === Offline Banner === */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: center;
    animation: slide-down 0.3s ease;
}

.offline-banner.hidden {
    display: none !important;
}

.offline-banner ~ .app .header {
    top: 32px;
}

/* === Bottom Navigation Bar === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    display: none;
    align-items: stretch;
    background: var(--glass-bg);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 600px) {
    .bottom-nav {
        display: flex;
    }

    /* Hide header nav buttons on mobile (use bottom nav instead) */
    .header-right #btn-bookmarks,
    .header-right #btn-ramadan,
    .header-right #btn-leaderboard,
    .header-right #btn-settings {
        display: none;
    }

    /* Adjust padding for bottom nav */
    .main-content {
        padding-bottom: 140px;
    }

    /* Move toast above bottom nav */
    .toast {
        bottom: 120px;
    }

    /* Move audio player above bottom nav */
    .audio-player {
        bottom: 56px;
    }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 56px;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.bottom-nav-item svg {
    transition: all 0.25s ease;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item.active svg {
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
}

/* === Active View Indicator (Header) === */
.icon-btn[data-active="true"] {
    color: var(--accent);
    background: var(--accent-light);
}

/* === Loading Skeletons === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-surah-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }

.skeleton-verse {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.skeleton-verse .skeleton-line {
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-verse .skeleton-line:last-child {
    height: 10px;
    margin-bottom: 0;
}

/* === Reset Confirmation Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: milestone-fade-in 0.3s ease;
    padding: 1rem;
}

.modal-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
    width: 100%;
    animation: milestone-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
    margin-bottom: 1rem;
}

.modal-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.modal-btn-cancel:hover {
    background: var(--bg-hover);
}

.modal-btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(197, 48, 48, 0.3);
}

.modal-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.4);
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
}

/* === Notes Modal === */
.notes-modal-card {
    text-align: left;
    max-width: 420px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.modal-header h3 {
    margin-bottom: 0;
}

.notes-verse-ref {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.notes-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    margin-bottom: 1rem;
    min-height: 120px;
}

.notes-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

/* === Verse Actions Discoverability === */
.verse-actions-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 1.2rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-xl);
    font-size: 0.78rem;
    font-weight: 500;
    z-index: 250;
    animation: toast-in 0.35s ease, toast-out 0.35s ease 4s forwards;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* === Smooth View Transitions === */
.view-enter {
    animation: view-slide-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes view-slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.surah-transition {
    animation: surah-slide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes surah-slide {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.surah-transition-prev {
    animation: surah-slide-prev 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes surah-slide-prev {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* === Bookmark Controls === */
.bookmark-controls {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.bookmark-search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.bookmark-search-wrapper svg {
    position: absolute;
    left: 0.7rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.bookmark-search-wrapper input {
    width: 100%;
    height: 38px;
    padding: 0 0.75rem 0 2.25rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.bookmark-search-wrapper input:focus {
    border-color: var(--accent);
}

.bookmark-sort-wrapper select {
    height: 38px;
    padding: 0 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
}

/* === Reading Statistics Section === */
.reading-stats-section {
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.stat-card {
    padding: 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.stat-card-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-card-icon {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.stats-chart {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stats-chart-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stats-week-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    height: 60px;
}

.stats-day-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.stats-day-fill {
    width: 100%;
    min-height: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
}

.stats-day-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* === Verse Sharing === */
.verse-action-btn.btn-share-verse,
.verse-action-btn.btn-note-verse {
    display: inline-flex;
}

/* === Swipe Hint === */
.swipe-hint {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.swipe-hint.visible {
    opacity: 1;
}

.swipe-hint-left {
    left: 8px;
}

.swipe-hint-right {
    right: 8px;
}

/* === Ramadan Share Progress === */
.ramadan-share-section {
    padding: 1rem;
    text-align: center;
}

.share-progress-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.3);
}

.share-progress-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4);
}

.share-progress-btn:active {
    transform: translateY(0);
}

/* === Tajweed Legend Auto-Show Indicator === */
.tajweed-legend-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 0.65rem;
    color: var(--text-secondary);
    animation: fade-in 0.3s ease;
}

/* === Verse Reference Format === */
.verse-ref-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-sm);
    margin-top: 0.25rem;
    font-family: var(--font-ui);
    direction: ltr;
}

/* === Notes Indicator on Verse === */
.verse-note-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--gold-dark);
    background: var(--gold-light);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.verse-note-indicator:hover {
    background: rgba(var(--gold-rgb), 0.15);
}

/* === Keyboard Shortcut Hint === */
.keyboard-hint {
    position: fixed;
    bottom: 80px;
    right: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    color: var(--text-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    animation: fade-in 0.3s ease;
    display: none;
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0.15rem;
}

@media (min-width: 601px) {
    .keyboard-hint {
        display: block;
    }
}

/* === Touch Target Improvements === */
@media (max-width: 600px) {
    .icon-btn {
        width: 44px;
        height: 44px;
    }

    .goal-btn {
        width: 32px;
        height: 32px;
    }

    .audio-btn {
        width: 44px;
        height: 44px;
    }

    .audio-btn.play-btn {
        width: 52px;
        height: 52px;
    }

    .verse-action-btn {
        min-height: 36px;
        padding: 0.4rem 0.75rem;
    }
}

/* === RTL for new elements === */
[dir="rtl"] .bottom-nav { flex-direction: row-reverse; }
[dir="rtl"] .bookmark-controls { flex-direction: row-reverse; }
[dir="rtl"] .bookmark-search-wrapper svg { left: auto; right: 0.7rem; }
[dir="rtl"] .bookmark-search-wrapper input { padding: 0 2.25rem 0 0.75rem; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }
[dir="rtl"] .notes-modal-card { text-align: right; }
[dir="rtl"] .offline-banner { flex-direction: row-reverse; }
[dir="rtl"] .lb-entry { flex-direction: row-reverse; }
[dir="rtl"] .lb-my-card { flex-direction: row-reverse; }
[dir="rtl"] .lb-my-stats { flex-direction: row-reverse; }
[dir="rtl"] .lb-you-badge { margin-left: 0; margin-right: auto; }

/* ============================================
   Anonymous Leaderboard / Community
   ============================================ */

/* My Rank Card */
.lb-my-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--gold-rgb), 0.06));
    border: 1.5px solid rgba(var(--accent-rgb), 0.15);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.lb-my-card.lb-no-activity {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.lb-my-rank-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lb-no-activity .lb-my-rank-circle {
    background: var(--bg-hover);
}

.lb-my-rank-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-ui);
}

.lb-no-activity .lb-my-rank-num {
    color: var(--text-tertiary);
}

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

.lb-my-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.lb-my-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.lb-my-stats {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.lb-my-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.lb-my-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-ui);
}

.lb-my-stat-label {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Section Title */
.lb-section-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Leaderboard Entries */
.lb-entries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lb-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lb-entry:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.lb-entry-me {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.06), rgba(var(--gold-rgb), 0.04));
    border-color: rgba(var(--accent-rgb), 0.2);
    box-shadow: var(--shadow-sm);
}

/* Rank number / medal */
.lb-rank {
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lb-rank-num {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
}

.lb-medal {
    font-size: 1.2rem;
    line-height: 1;
}

/* Bar area */
.lb-bar-area {
    flex: 1;
    min-width: 0;
}

.lb-bar-track {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.lb-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width 0.6s ease;
}

.lb-gold .lb-bar-fill {
    background: linear-gradient(90deg, #ffd700, #ffaa00);
}

.lb-silver .lb-bar-fill {
    background: linear-gradient(90deg, #c0c0c0, #a0a0a0);
}

.lb-bronze .lb-bar-fill {
    background: linear-gradient(90deg, #cd7f32, #a05820);
}

.lb-entry-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lb-verses {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: var(--font-ui);
}

.lb-you-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
}

/* Loading state */
.lb-loading {
    padding: 1rem 0;
}

/* Leaderboard list padding for bottom nav */
.leaderboard-list {
    padding-bottom: 1rem;
}

.leaderboard-my-rank {
    padding: 0 1rem;
}

@media (max-width: 600px) {
    .lb-my-card {
        flex-wrap: wrap;
    }
    .lb-my-stats {
        width: 100%;
        justify-content: center;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light);
        margin-top: 0.25rem;
    }
}
