/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@400;600;700&display=swap');

:root {
    --primary: #cfaf69;
    --primary-bright: #eedaad;
    --navy: #1a2a3a;
    --navy-dark: #0d151d;
    --bg-light: #f4f5f7;
    --bg-paper: #fffcf5;
    --glass: rgba(255, 255, 255, 0.05);

    --tj-n: #2ecc71;
    --tj-m: #e74c3c;
    --tj-q: #3498db;

    --font-ui: 'Cairo', sans-serif;
    --font-quran: 'Amiri', serif;
}

.footer-info-item {
    font-weight: bold;
    color: var(--navy);
}

.footer-separator {
    color: #ccc;
    margin: 0 5px;
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    background: var(--bg-light);
    color: #333;
    font-family: var(--font-ui);
    direction: rtl;
    overflow-x: hidden;
    cursor: default;
    /* Native app feel */
    user-select: none;
    /* Prevent text selection highlight */
    -webkit-user-select: none;
}

/* Ensure interactive elements show pointer */
a,
button,
.verse,
.bookmark-card,
.list-item,
.nav-btn-rect,
.tool-btn,
.goal-chip,
.tab-btn {
    cursor: pointer;
}

/* --- LANDING PAGE: ROYAL EXPERIENCE --- */
#landingPage {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background: radial-gradient(circle at top, var(--navy-dark) 0%, #000 100%);
    color: white;
    z-index: 10000;
    overflow-y: auto;
    display: block;
    padding-bottom: 50px;
}

#landingPage.hidden {
    display: none;
}

.hero-section {
    height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

.hero-icon {
    font-size: 6rem;
    color: var(--primary);
    filter: drop-shadow(0 0 20px var(--primary));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.welcome-title {
    font-family: var(--font-quran);
    font-size: 4.5rem;
    color: var(--primary-bright);
    margin: 20px 0 10px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.welcome-desc {
    color: #aab7c4;
    font-size: 1.4rem;
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.main-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-royal {
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 1.2rem;
    transition: 0.4s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-gold-fill {
    background: var(--primary);
    color: var(--navy-dark);
}

.btn-gold-fill:hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: 0 15px 30px var(--primary);
}

/* Toolbar Styles */
.toolbar-bar {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
    display: none;
    /* toggled via JS */
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Traditional Mushaf Numbering */
.aya-num {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 36 36' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='18' cy='18' r='16' fill='none' stroke='%23cfaf69' stroke-width='1'/%3E%3Cpath d='M18 2 L18 6 M18 30 L18 34 M2 18 L6 18 M30 18 L34 18' stroke='%23cfaf69' stroke-width='1'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    color: var(--navy);
    font-family: 'Amiri', serif;
    font-size: 0.75em;
    font-weight: bold;
    /* Thicker number */
    margin: 0 5px;
    padding-top: 3px;
    /* Optical center */
    vertical-align: middle;
}

/* Page Footer Decoration */
.page-footer-info {
    margin-top: 40px;
    text-align: center;
    color: var(--navy);
    font-family: var(--font-quran);
    font-size: 1.1rem;
    padding: 15px;
    border-top: 2px solid var(--primary);
    background: linear-gradient(to right, transparent, rgba(207, 175, 105, 0.1), transparent);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.footer-info-item {
    padding: 0 10px;
    position: relative;
    font-weight: bold;
    /* Retained from original */
}

/* Fancy Separators */
.footer-separator {
    color: var(--primary);
    font-size: 1.2rem;
}

.focus-control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.focus-select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    font-family: var(--font-ui);
    cursor: pointer;
}

.action-btn {
    padding: 8px 25px;
    border-radius: 20px;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.start-btn {
    background: var(--navy);
}

.stop-btn {
    background: #c0392b;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Goal Bar */
.goal-bar {
    background: #fdfbf7;
    display: none;
    /* toggled */
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.goal-info,
.goal-status {
    font-weight: bold;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-container {
    flex: 1;
    margin: 0 20px;
    max-width: 400px;
}

.progress-track {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), #e6c88a);
    width: 0%;
    transition: width 0.5s ease;
}

.close-bar-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
}

.close-bar-btn:hover {
    color: red;
}

/* Features Section */
.features-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px;
}

.feature-card {
    background: var(--glass);
    border: 1px solid rgba(207, 175, 105, 0.2);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(207, 175, 105, 0.1);
    border-color: var(--primary);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.feature-card h3 {
    color: var(--primary-bright);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-card p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Prayer Box */
.prayer-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background: linear-gradient(135deg, rgba(207, 175, 105, 0.1), rgba(0, 0, 0, 0.4));
    border-radius: 25px;
    border: 1px solid var(--primary);
    text-align: center;
}

.prayer-item {
    font-family: var(--font-quran);
    font-size: 1.8rem;
    color: var(--primary-bright);
    line-height: 1.8;
}

/* --- MAIN APP INTERFACE (Royal Header) --- */
#mainApp {
    display: flex;
    /* Changed from none for quran.html */
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
}

/* Time Input Wrapper */
.time-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.time-input-wrapper input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--navy);
}


/* --- NEW HORIZONTAL HEADER --- */
.app-header {
    background: linear-gradient(to left, #1a2a3a, #15202b);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
    color: white;
}

.header-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-section.start {
    flex: 1;
}

.header-section.center {
    flex: 0 0 auto;
    justify-content: center;
}

.header-section.end {
    flex: 1;
    justify-content: flex-end;
}

/* Buttons & Nav Items */
.nav-btn-rect {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    height: 40px;
    padding: 0 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.9rem;
}

.nav-btn-rect:hover {
    background: var(--primary);
    color: var(--navy);
    border-color: var(--primary);
}

.page-nav-group {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 3px;
    margin-right: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-arrow {
    background: transparent;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
}

.page-badge {
    color: var(--primary);
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    font-family: monospace;
    font-size: 1.1rem;
}

/* Surah Title Badge */
.surah-title-badge {
    font-family: var(--font-quran);
    font-size: 1.6rem;
    color: var(--primary-bright);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-badge {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    text-shadow: none;
    font-weight: normal;
    letter-spacing: 0;
}

.header-badge.type-meccan {
    border-color: #e6c88a;
    /* Goldish */
    color: #e6c88a;
}

.header-badge.type-medinan {
    border-color: #2ecc71;
    /* Greenish */
    color: #2ecc71;
}

.page-badge-header {
    background: var(--primary);
    color: var(--navy);
    font-weight: bold;
    border: none;
}

/* Tools Group */
.tools-group {
    display: flex;
    gap: 8px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #aab7c4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    height: 50px;
    /* Tall to fit icon+label */
}

.tool-btn i {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.tool-label {
    font-size: 0.7rem;
    font-weight: 600;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

@media (max-width: 900px) {
    .desktop-only {
        display: none;
    }

    .tool-label {
        display: none;
    }

    .tool-btn {
        height: 40px;
        width: 40px;
        padding: 0;
    }

    .surah-title-badge {
        font-size: 1.3rem;
    }
}


/* READER - CENTERED & CLEAN */
.reader-view {
    flex: 1;
    overflow-y: auto;
    padding: 40px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f0f2f5;
}

.mushaf-sheet {
    background: var(--bg-paper);
    width: 100%;
    max-width: 820px;
    border-radius: 5px;
    /* Sharper corners for book feel */
    box-shadow:
        0 0 0 2px #d4b472,
        /* Inner Gold */
        0 0 0 6px #1a2a3a,
        /* Navy band */
        0 0 0 9px #d4b472,
        /* Outer Gold */
        0 15px 50px rgba(0, 0, 0, 0.15);
    /* Depth shadow */
    margin: 20px 0 60px;
    /* Adjust margins */
    position: relative;
    overflow: visible;
    /* Allow content to flow naturally */
}

.sheet-inner {
    border: 4px double #d4b472;
    /* Classic double line */
    border-radius: 2px;
    padding: 40px 30px;
    min-height: 85vh;
    background-image:
        radial-gradient(#d4b472 0.5px, transparent 0.5px),
        linear-gradient(to right, rgba(207, 175, 105, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(207, 175, 105, 0.05) 1px, transparent 1px);
    background-size: 20px 20px, 40px 40px, 40px 40px;
    /* Subtle grid */
    position: relative;
    margin: 10px;
    /* Space from the outer frame */
    outline: 2px solid rgba(26, 42, 58, 0.1);
    /* Subtle inner outline */
    outline-offset: -8px;
}

.quran-text {
    font-family: var(--font-quran);
    font-size: 34px;
    line-height: 2.8;
    text-align: justify;
    text-align-last: center;
    color: #111;
    word-spacing: 5px;
}

.verse {
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 2px 0;
}

.verse.current {
    background-color: rgba(207, 175, 105, 0.3);
    color: #000;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 0 5px rgba(207, 175, 105, 0.1);
}


/* DECORATIONS */
/* Bottom Navigation */
.bottom-nav-area {
    margin-top: 50px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding-top: 30px;
    border-top: 1px dashed rgba(207, 175, 105, 0.3);
}

.bottom-nav-btn {
    flex: 1;
    background: transparent;
    border: 1px solid #e0dfdc;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: 0.3s;
    color: #555;
    text-align: right;
    display: flex;
    align-items: center;
}

.bottom-nav-btn.next {
    justify-content: flex-end;
    text-align: left;
}

.bottom-nav-btn.prev {
    justify-content: flex-start;
    text-align: right;
}

.bottom-nav-btn i {
    font-size: 1.2rem;
    color: var(--primary);
    margin: 0 10px;
}

.bottom-nav-btn:hover {
    background: #fffcf5;
    border-color: var(--primary);
    color: var(--navy);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.sub-text {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
}

.page-divider {
    width: 20px;
}

/* Modals Refined */
.modal-title {
    color: var(--navy);
    margin-bottom: 25px;
    font-size: 1.4rem;
    text-align: center;
}

.modal-tabs {
    display: flex;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.tab-btn.active {
    background: white;
    color: var(--navy);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-family: inherit;
    margin-bottom: 15px;
    transition: 0.3s;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #b8954a;
}

.btn-secondary {
    background: #f0f0f0;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.goal-chip {
    padding: 10px 15px;
    background: #f4f5f7;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}

.goal-chip:hover {
    border-color: var(--primary);
    background: #fffcf5;
}

.quick-goals {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Floating Buttons */
.float-action-btn {
    position: fixed;
    left: 25px;
    bottom: 25px;
    width: 55px;
    height: 55px;
    background: white;
    color: var(--navy);
    border-radius: 50%;
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 900;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-action-btn:hover {
    transform: scale(1.1);
    color: var(--primary);
}

.legend-content {
    padding: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #555;
}

.dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
}

.n-rule {
    background: var(--tj-n);
}

.m-rule {
    background: var(--tj-m);
}

.q-rule {
    background: var(--tj-q);
}

/* TOOLBARS & GOAL BAR */
.toolbar-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
    position: relative;
    width: 100%;
}

.focus-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid #eee;
}

.focus-select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: bold;
    color: var(--navy);
    outline: none;
}

.action-btn {
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
}

.start-btn {
    background: var(--primary);
    color: #fff;
}

.stop-btn {
    background: #e74c3c;
    color: #fff;
}

.goal-bar {
    background: #fffcf5;
    border-bottom: 1px solid #eaddcf;
    padding: 15px;
    flex-wrap: wrap;
}

.goal-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-weight: bold;
}

.progress-container {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
    margin: 0 15px;
}

.progress-track {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

.goal-status {
    font-size: 0.9rem;
    color: #666;
}

.close-bar-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
}

.close-bar-btn:hover {
    color: #e74c3c;
}

/* Ensure bottom nav is visible on desktop */
.bottom-nav-area {
    margin-top: 30px;
    display: flex;
    /* Default flex */
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid #eee;
    width: 100%;
    background: transparent;
    /* Transparent on desktop */
}

.allah-rule {
    background: #d35400;
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    /* Auto layout for landing page on mobile */
    #landingPage {
        display: block !important;
        height: auto !important;
        overflow-y: auto !important;
        background: radial-gradient(circle at top, var(--navy-dark) 0%, #000 100%);
    }

    .hero-section {
        height: auto !important;
        padding: 100px 20px 40px !important;
        min-height: 60vh;
    }

    .features-section {
        height: auto !important;
        padding: 40px 20px !important;
    }

    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-desc {
        font-size: 1rem;
    }

    /* Adjust Header for Mobile */
    .app-header {
        height: 60px;
        padding: 0 10px;
    }

    .surah-title-badge {
        font-size: 1.1rem;
        padding: 0 5px;
        flex-direction: row;
        /* Keep side by side */
        gap: 8px;
    }

    .header-badge {
        display: inline-flex;
        /* Show badges */
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    /* Ensure install button is visible and nice */
    .install-app-btn {
        display: none;
        /* Hidden by default, shown via JS */
        background: linear-gradient(135deg, #cfaf69, #b8954a);
        color: var(--navy);
        border: none;
        padding: 5px 12px;
        border-radius: 20px;
        font-weight: bold;
        font-size: 0.8rem;
        align-items: center;
        gap: 5px;
        box-shadow: 0 4px 10px rgba(207, 175, 105, 0.3);
        margin-left: 10px;
        animation: pulse-btn 2s infinite;
    }

    .install-app-btn i {
        font-size: 1rem;
    }
}

@keyframes pulse-btn {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(207, 175, 105, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(207, 175, 105, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(207, 175, 105, 0);
    }
}

/* Mobile Re-adjustments */
@media (max-width: 768px) {

    /* Header optimization */
    .app-header {
        padding: 0 10px;
        height: 60px;
    }

    .desktop-only {
        display: none !important;
    }

    .nav-btn-rect {
        padding: 0 10px;
        width: 40px;
        justify-content: center;
    }

    .surah-title-badge {
        font-size: 1.1rem;
        padding: 0 5px;
        gap: 8px;
        flex-direction: row;
        /* FORCE ROW */
        align-items: center;
        width: auto;
        justify-content: center;
        line-height: 1;
    }

    .header-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    /* Tools on mobile: collapsed or smaller */
    .tools-group {
        gap: 5px;
    }

    .tool-btn {
        width: 35px;
        height: 35px;
        padding: 0;
    }

    .tool-btn i {
        font-size: 1rem;
        margin: 0;
    }

    .tool-label {
        display: none;
    }

    /* Reader view adjustments */
    .mushaf-sheet {
        width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
        margin-bottom: 80px;
        /* Space for bottom nav */
    }

    .sheet-inner {
        padding: 30px 15px;
        border: none;
        background-size: 20px 20px;
        /* Smaller pattern */
    }

    .quran-text {
        font-size: 30px;
        /* Increased for better visibility */
        line-height: 2.2;
        text-align: justify;
        word-spacing: 2px;
    }

    .page-footer-info {
        font-size: 0.8rem;
    }

    /* Bottom Navigation - Sticky on Mobile */
    .bottom-nav-area {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 10px;
        margin: 0;
        z-index: 900;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #ddd;
    }

    .bottom-nav-btn {
        padding: 10px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .float-action-btn {
        bottom: 85px;
        /* Move above bottom nav */
        width: 45px;
        height: 45px;
        left: 15px;
    }

    /* Landing Page Mobile Fixes */
    .hero-section {
        padding-top: 80px;
    }

    .welcome-title {
        font-size: 2.2rem;
    }

    .top-info-bar {
        padding: 10px;
        font-size: 0.8rem;
    }

    .live-users-badge,
    .dev-credit {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

/* Sidebar Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: 0.2s;
}

.list-item:hover {
    background: #f9f9f9;
    padding-right: 20px;
}

.list-item b {
    color: var(--navy);
    font-size: 1rem;
}

.list-item small {
    color: #999;
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* SIDEBARS & MODALS */
.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 320px;
    height: 100%;
    background: #fff;
    z-index: 2000;
    transition: 0.4s;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: 0.3s;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-overlay.open .modal-box {
    transform: translateY(0);
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-small-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-secondary.full-width {
    width: 100%;
    margin-top: 20px;
}

/* Bookmark Card Styles */
.bookmark-card {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    border-right: 4px solid var(--primary);
}

.bookmark-card:hover {
    background: #fffcf5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateX(-5px);
}

.bm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bm-header b {
    font-size: 1.1rem;
    color: var(--navy);
}

.bm-date {
    font-size: 0.8rem;
    color: #999;
}

.bm-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: #666;
}

.bm-details span {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bm-details i {
    color: var(--primary);
    font-size: 0.8rem;
}

.bm-delete-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: #ffcccb;
    cursor: pointer;
    transition: 0.3s;
}

.bm-delete-btn:hover {
    color: red;
}

/* Toast */
.toast-msg {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary);
    z-index: 9999;
    transition: 0.5s;
    font-weight: bold;
}

@media (max-width: 768px) {
    .welcome-title {
        font-size: 2.8rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .quran-text {
        font-size: 24px;
    }
}