:root {
    --primary: #0b3b2d;
    --primary-mid: #145a45;
    --accent: #c59b27;
    --accent-light: #fef3c7;
    --bg-body: #f4f6f5;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --quran-bg: #fffdf8;
    --ayah-highlight: #fef08a;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 20px rgba(11, 59, 45, 0.08);
}

body.dark-mode {
    --primary: #10b981;
    --primary-mid: #059669;
    --accent: #fbbf24;
    --accent-light: rgba(251, 191, 36, 0.15);
    --bg-body: #0b1120;
    --bg-card: #162032;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #273549;
    --quran-bg: #131c2e;
    --ayah-highlight: #2e3b52;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.25s, color 0.25s;
}

/* Top App Bar */
.app-header {
    background: linear-gradient(135deg, #0b3b2d 0%, #145a45 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.15rem;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 18px 16px 40px;
}

.hidden {
    display: none !important;
}

/* ==========================================
   HOME DASHBOARD (MAIN MENU)
   ========================================== */
.hero-card {
    background: linear-gradient(135deg, #0b3b2d 0%, #16654e 100%);
    color: #ffffff;
    border-radius: 18px;
    padding: 26px 20px;
    text-align: center;
    margin-bottom: 22px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(197, 155, 39, 0.35);
}

.hero-verse {
    font-family: 'Amiri Quran', 'Amiri', serif;
    font-size: 1.55rem;
    color: #fde68a;
    margin-bottom: 8px;
}

.hero-sub {
    font-size: 0.92rem;
    opacity: 0.9;
}

.resume-pill {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(253, 230, 138, 0.4);
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.btn-gold-sm {
    background: #c59b27;
    color: #fff;
    border: none;
    padding: 5px 14px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 560px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dash-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.dash-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(11, 59, 45, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

body.dark-mode .dash-icon-wrap {
    background: rgba(16, 185, 129, 0.15);
}

.dash-info {
    flex: 1;
}

.dash-info h2 {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.dash-info p {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.dash-arrow {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

.home-footer {
    text-align: center;
    margin-top: 28px;
}

.text-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    font-family: 'Cairo', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
}

/* ==========================================
   SECTION TOP BAR & SHARED CONTROLS
   ========================================== */
.section-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    background: var(--bg-card);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.section-topbar h2 {
    font-size: 1.15rem;
    color: var(--primary);
}

.btn-back {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
}

/* Search & Surah Cards */
.search-box-wrap {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    font-size: 0.98rem;
    box-shadow: var(--shadow-sm);
}

.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.surah-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.surah-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.surah-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.surah-number {
    width: 36px;
    height: 36px;
    background: rgba(11, 59, 45, 0.1);
    color: var(--primary);
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.surah-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.surah-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Reader View */
.reader-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    background: var(--bg-card);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.audio-panel {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.reciter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.select-input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
}

.audio-box audio {
    width: 100%;
    height: 42px;
    margin-bottom: 10px;
}

.memorize-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
}

.font-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint-text {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.notice-box {
    background: var(--accent-light);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid var(--accent);
}

.bismillah {
    text-align: center;
    font-family: 'Amiri Quran', 'Amiri', serif;
    font-size: 1.85rem;
    color: var(--primary);
    margin: 16px 0;
}

.ayahs-box {
    background: var(--quran-bg);
    padding: 24px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    font-family: 'Amiri Quran', 'Amiri', serif;
    font-size: 1.7rem;
    line-height: 2.35;
    text-align: justify;
    box-shadow: var(--shadow-sm);
}

.ayah-item {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 6px;
    transition: background 0.2s;
}

.ayah-item:hover, .ayah-item.memorize-focus {
    background-color: var(--ayah-highlight);
}

.ayah-num {
    color: var(--accent);
    font-size: 1.25rem;
    margin: 0 4px;
    font-family: 'Amiri', serif;
}

/* Buttons */
.btn-secondary, .btn-outline, .btn-tiny, .btn-danger-outline {
    font-family: 'Cairo', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
}

.btn-tiny {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 2px 10px;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 6px 14px;
}

/* Hadith Section */
.filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
    justify-content: center;
}

.pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.hadith-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.hadith-text {
    font-family: 'Amiri', serif;
    font-size: 1.38rem;
    line-height: 1.95;
    margin-bottom: 12px;
}

.hadith-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

/* Tasbih Section */
.tasbih-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 26px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.dhikr-selector {
    width: 100%;
    max-width: 440px;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.target-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.target-btn {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 5px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.target-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.counter-circle-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.tasbih-circle {
    width: 215px;
    height: 215px;
    border-radius: 50%;
    background: radial-gradient(circle, #145a45, #0b3b2d);
    color: white;
    border: 6px solid rgba(197, 155, 39, 0.55);
    box-shadow: 0 12px 28px rgba(11, 59, 45, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.08s;
    user-select: none;
}

.tasbih-circle:active {
    transform: scale(0.95);
}

.count-number {
    font-size: 3.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.tap-hint {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 6px;
}

.tasbih-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* About Section */
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    line-height: 1.85;
    box-shadow: var(--shadow-sm);
}

.about-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.sources-list {
    padding-right: 20px;
    margin: 14px 0;
}

.sources-list li {
    margin-bottom: 8px;
}

.dua-box {
    margin-top: 18px;
    padding: 14px;
    background: rgba(11, 59, 45, 0.08);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

.loader {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}
