/* Global SVG Reset - Fixes Giant Icon issue */
svg {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}

.hidden {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}


:root {
    --primary: #2A8A8C;
    --primary-rgb: 42, 138, 140;
    --primary-light: #4DB8B0;
    --primary-dark: #1B6B6E;
    --gold: #D4A843;
    --gold-light: #E8C96A;
    --cream: #F8F6F0;
    --white: #ffffff;
    --light: #f5f3ee;
    --text-dark: #3a3a3a;
    --text-light: #8a9199;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius: 24px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans Arabic', sans-serif;
    background: linear-gradient(160deg, #F8F6F0 0%, #EDE9E0 50%, #F0EDE5 100%);
    color: var(--text-dark);
    line-height: 1.7;
    min-height: 100vh;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

html {
    overflow-x: hidden;
}

body[dir="rtl"] {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

/* Header & Nav */
header {
    background: linear-gradient(135deg, rgba(42, 138, 140, 0.92) 0%, rgba(27, 107, 110, 0.95) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(42, 138, 140, 0.15);
    border-bottom: none;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.4rem;
}

.logo svg {
    width: 32px;
    height: 32px;
    fill: var(--gold);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-trigger {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    font-weight: 600;
}

.lang-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1100;
    padding: 0.5rem;
    border: 1px solid rgba(13, 115, 119, 0.1);
}

body[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

.lang-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s ease;
    justify-content: flex-start;
    white-space: nowrap;
}

.lang-option:hover {
    background: var(--primary);
    color: var(--white);
}

.lang-option.active {
    background: rgba(13, 115, 119, 0.1);
    color: var(--primary);
}

.lang-option.active:hover {
    background: var(--primary);
    color: var(--white);
}

.flag-icon {
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 5px;
    border-radius: 4px;
    min-width: 25px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-transform: uppercase;
}

.lang-option .flag-icon {
    background: rgba(13, 115, 119, 0.1);
    color: var(--primary);
}

.lang-option:hover .flag-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-icon svg {
    fill: currentColor;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.header-btn.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    color: var(--white);
}

.header-btn svg {
    fill: currentColor;
}

/* Navigation */
.nav-scroll {
    background: var(--white);
    padding: 0.75rem 0;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 0.35rem;
    min-width: max-content;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 0.65rem 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.nav-btn:hover {
    background: rgba(42, 138, 140, 0.08);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(42, 138, 140, 0.2);
}

.nav-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Hero */
.hero {
    padding: 3.5rem 2rem 4.5rem;
    text-align: center;
    background: linear-gradient(160deg, var(--cream) 0%, #E8E4DA 100%);
    color: var(--text-dark);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    border-radius: 0 0 2.5rem 2.5rem;
}

.hero h1 {
    font-size: clamp(1.6rem, 4.5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Consolidated hidden class above */

/* Location Popup */
.location-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.location-popup.hidden {
    display: none !important;
}

.popup-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: var(--cream);
    color: var(--text-dark);
}

.popup-content svg {
    width: 64px;
    height: 64px;
    fill: var(--primary);
    margin-bottom: 1rem;
}

.popup-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.popup-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.popup-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

/* Tool Sections */
.tool-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.4s ease;
}

.tool-card:hover {
    box-shadow: 0 4px 24px rgba(42, 138, 140, 0.1);
}

.tool-card h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.tool-card h2 svg {
    width: 22px;
    height: 22px;
    fill: var(--gold);
}

/* Form Elements */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 0.875rem 1.1rem;
    border: 1.5px solid #e0ddd6;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--white);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(42, 138, 140, 0.08);
}

.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-lg);
}

.autocomplete-list.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: var(--cream);
}

.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    letter-spacing: 0.02em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(42, 138, 140, 0.25);
}

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

.btn-secondary {
    background: var(--cream);
    color: var(--text-dark);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #EDE9E0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Prayer Times */
.location-input {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.prayer-times-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (min-width: 600px) {
    .prayer-times-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.prayer-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.35s ease;
}

.prayer-card:hover {
    border-color: rgba(42, 138, 140, 0.2);
    box-shadow: 0 4px 16px rgba(42, 138, 140, 0.08);
    transform: translateY(-2px);
}

.prayer-card.active {
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(42, 138, 140, 0.2);
}

.prayer-name {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prayer-card.active .prayer-name {
    color: rgba(255, 255, 255, 0.85);
}

.prayer-time {
    font-size: 1.2rem;
    font-weight: 700;
}

.prayer-arabic {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    font-family: 'Noto Sans Arabic', sans-serif;
    opacity: 0.75;
}

.next-prayer {
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--text-dark);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 1.5rem;
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.15);
}

.next-prayer h3 {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.next-prayer .time-remaining {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Qibla */
.compass-container {
    width: 200px;
    height: 200px;
    margin: 2rem auto;
    position: relative;
}

.compass {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--white) 0%, var(--cream) 100%);
    border: 3px solid rgba(42, 138, 140, 0.3);
    position: relative;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), inset 0 2px 8px rgba(0, 0, 0, 0.03);
}

.compass-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 45%;
    background: var(--gold);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    border-radius: 2px;
    transition: transform 0.1s ease-out;
    /* Smoother update for sensor data */
}

.compass-arrow.aligned {
    background: #00e676;
    /* Bright Green */
    box-shadow: 0 0 15px #00e676;
}

.compass-arrow.aligned::after {
    border-bottom-color: #00e676;
}

.compass-arrow::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 15px solid var(--gold);
}

/* ==================== TASBEEH ENHANCEMENTS ==================== */
.tasbeeh-tabs {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.wird-item {
    background: rgba(42, 138, 140, 0.05);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wird-item:hover {
    background: rgba(42, 138, 140, 0.1);
    border-color: rgba(42, 138, 140, 0.2);
}

.wird-info {
    flex: 1;
}

.wird-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.wird-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
    max-width: 200px;
    margin-top: 5px;
}

.wird-progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.3s ease;
}

.wird-count {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-left: 10px;
    min-width: 60px;
    text-align: right;
}

.wird-item.completed {
    border-color: #00e676;
    background: rgba(0, 230, 118, 0.05);
}

.wird-item.completed .wird-progress-fill {
    background: #00e676;
}

.suggestions-list {
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 150px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    display: none;
}

.suggestions-list.show {
    display: block;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
}

.suggestion-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.preset-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.chip {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
}

.chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    z-index: 10;
}

.compass-label {
    position: absolute;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

.compass-label.n {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-label.e {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-label.s {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-label.w {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.qibla-kaaba {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
}

/* Loading */
.loading {
    display: none;
    justify-content: center;
    padding: 2rem;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--cream);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Zakat */
.zakat-form {
    display: grid;
    gap: 1rem;
}

.zakat-category {
    background: var(--cream);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.zakat-category h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-size: 0.95rem;
}

.zakat-category h4 svg {
    width: 18px;
    height: 18px;
    fill: var(--gold);
}

.zakat-result {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 1.5rem;
}

.zakat-result h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.zakat-result .amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

/* Hijri */
.hijri-display {
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(42, 138, 140, 0.15);
}

.hijri-display .date {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.hijri-display .arabic {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 1.2rem;
    opacity: 0.85;
}

/* Ramadan */
.iftar-countdown {
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--text-dark);
    padding: 1.75rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.12);
}

.iftar-countdown h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

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

.countdown-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    min-width: 60px;
}

.countdown-item .number {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.countdown-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* Dua */
.dua-card {
    background: linear-gradient(145deg, var(--cream) 0%, #F0EDE5 100%);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.dua-card .arabic-text {
    font-family: 'Amiri', 'Noto Sans Arabic', sans-serif;
    font-size: 1.5rem;
    line-height: 2;
    margin-bottom: 1.25rem;
    color: var(--primary-dark);
}

.dua-card .transliteration {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
}

.dua-card .translation {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.7;
}

.dua-card .reference {
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

.dua-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Tracker Grids */
.tracker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 600px) {
    .tracker-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}

.tracker-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.tracker-item:hover {
    background: rgba(42, 138, 140, 0.08);
    color: var(--primary);
    border-color: rgba(42, 138, 140, 0.2);
}

.tracker-item.completed {
    background: var(--primary);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(42, 138, 140, 0.2);
}

.tracker-item.today {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15);
}

/* Tasbeeh */
.tasbeeh-container {
    text-align: center;
    padding: 1.5rem;
}

.tasbeeh-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1.5rem 0;
}

.tasbeeh-btn {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 6px 24px rgba(42, 138, 140, 0.25);
    margin-bottom: 1.5rem;
}

.tasbeeh-btn:active {
    transform: scale(0.93);
    box-shadow: 0 2px 12px rgba(42, 138, 140, 0.3);
}

.tasbeeh-presets {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 0.4rem 0.8rem;
    background: var(--cream);
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

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

/* Footer */
footer {
    background: linear-gradient(145deg, var(--primary-dark) 0%, #164345 100%);
    color: var(--white);
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-top: 2rem;
    border-radius: 2rem 2rem 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gold-light);
    text-decoration: none;
    font-size: 0.88rem;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
}

footer p {
    font-size: 0.88rem;
    opacity: 0.8;
}



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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

/* Ramadan Banner */
.ramadan-banner {
    background: linear-gradient(145deg, rgba(212, 168, 67, 0.12) 0%, rgba(232, 201, 106, 0.08) 100%);
    color: var(--text-dark);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid rgba(212, 168, 67, 0.15);
}

.ramadan-banner h2 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--gold);
}

.ramadan-banner p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Unified Notification System */
.error-msg {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #dc2626;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    min-width: 250px;
    text-align: center;
    font-weight: 600;
    display: block !important;
}

.error-msg.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(13, 115, 119, 0.1);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.searching-item {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
    background: rgba(245, 245, 220, 0.3);
}

/* Mobile Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    padding: 0.6rem 0.25rem;
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
    border-top: none;
    border-radius: 1.25rem 1.25rem 0 0;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-nav-btn {
    background: none;
    border: none;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    flex: 1;
    min-width: 0;
}

.bottom-nav-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.bottom-nav-btn span {
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.bottom-nav-btn.active {
    color: var(--primary);
    background: rgba(42, 138, 140, 0.06);
    border-radius: var(--radius-sm);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

.monthly-table {
    min-width: 600px;
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 767px) {
    .nav-scroll {
        display: none;
    }

    .bottom-nav {
        display: block;
    }

    main {
        margin-bottom: 70px;
        /* Space for bottom nav */
    }

    .hero {
        padding: 2rem 1rem;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .tool-card {
        padding: 1rem;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 246, 240, 0.98);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 2rem 1.25rem;
    animation: slideUp 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu-overlay.show {
    display: flex;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mobile-menu-close {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.mobile-menu-item {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mobile-menu-item:active {
    transform: scale(0.96);
    background: var(--cream);
}

.mobile-menu-item svg {
    width: 32px;
    height: 32px;
    fill: var(--primary);
}

.mobile-menu-item span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dark mode for overlay */
body.dark-mode .mobile-menu-overlay {
    background: rgba(26, 26, 46, 0.98);
}

body.dark-mode .mobile-menu-item {
    background: #1e1e3a;
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .mobile-menu-item span {
    color: var(--white);
}

/* ==================== DARK MODE ==================== */
body.dark-mode {
    background: linear-gradient(160deg, #1a2332 0%, #1e2a38 50%, #1a2632 100%);
    color: #d8dce2;
}

body.dark-mode header {
    background: linear-gradient(135deg, #1a3a3c 0%, #15302f 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

body.dark-mode .nav-scroll {
    background: #1e2a38;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

body.dark-mode .nav-btn {
    color: #8a9199;
}

body.dark-mode .nav-btn:hover {
    background: rgba(77, 184, 176, 0.1);
    color: var(--primary-light);
}

body.dark-mode .nav-btn.active {
    background: var(--primary);
    color: var(--white);
}

body.dark-mode .hero {
    background: linear-gradient(160deg, #1e2a38 0%, #243040 100%);
    border-radius: 0 0 2.5rem 2.5rem;
}

body.dark-mode .hero h1 {
    background: linear-gradient(135deg, #4DB8B0 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.dark-mode .hero p {
    color: #8a9199;
}

body.dark-mode .tool-card {
    background: #222e3c;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-mode .tool-card:hover {
    box-shadow: 0 4px 24px rgba(77, 184, 176, 0.08);
}

body.dark-mode .tool-card h2 {
    color: #4DB8B0;
}

body.dark-mode .popup-content {
    background: #222e3c;
    color: #d8dce2;
}

body.dark-mode .popup-content p {
    color: #8a9199;
}

body.dark-mode .popup-close {
    color: #8a9199;
}

body.dark-mode .popup-close:hover {
    background: #2a3848;
    color: #fff;
}

body.dark-mode input,
body.dark-mode select {
    background: #2a3848;
    border-color: #364758;
    color: #d8dce2;
}

body.dark-mode input:focus,
body.dark-mode select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(77, 184, 176, 0.1);
}

body.dark-mode input::placeholder {
    color: #6a7580;
}

body.dark-mode .autocomplete-list {
    background: #2a3848;
    border-color: var(--primary);
}

body.dark-mode .autocomplete-item:hover {
    background: #364758;
}

body.dark-mode .input-group label {
    color: #8a9199;
}

body.dark-mode .prayer-card {
    background: #2a3848;
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-mode .prayer-card:hover {
    border-color: rgba(77, 184, 176, 0.2);
    box-shadow: 0 4px 16px rgba(77, 184, 176, 0.06);
}

body.dark-mode .prayer-name {
    color: #8a9199;
}

body.dark-mode .compass {
    background: linear-gradient(145deg, #2a3848 0%, #222e3c 100%);
    border-color: rgba(77, 184, 176, 0.2);
}

body.dark-mode .hijri-display {
    background: linear-gradient(145deg, #1a3a3c 0%, #15302f 100%);
}

body.dark-mode .zakat-category {
    background: #2a3848;
}

body.dark-mode .zakat-category h4 {
    color: #4DB8B0;
}

body.dark-mode .ramadan-banner {
    background: linear-gradient(145deg, rgba(212, 168, 67, 0.1) 0%, rgba(232, 201, 106, 0.06) 100%);
    border-color: rgba(212, 168, 67, 0.12);
    color: #d8dce2;
}

body.dark-mode .iftar-countdown {
    background: linear-gradient(145deg, #6b5a18 0%, #5a4c14 100%);
    color: #d8dce2;
}

body.dark-mode .dua-card {
    background: linear-gradient(145deg, #2a3848 0%, #253544 100%);
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-mode .dua-card .arabic-text {
    color: #4DB8B0;
}

body.dark-mode .dua-card .transliteration {
    color: #7a8490;
}

body.dark-mode .dua-card .translation {
    color: #d8dce2;
}

body.dark-mode .dua-card .reference {
    color: #6a7580;
}

body.dark-mode .tracker-item {
    background: #2a3848;
    color: #d8dce2;
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-mode .tracker-item:hover {
    background: rgba(77, 184, 176, 0.1);
    color: var(--primary-light);
}

body.dark-mode .tracker-item.completed {
    background: var(--primary);
    color: #fff;
}

body.dark-mode .btn-secondary {
    background: #2a3848;
    color: #d8dce2;
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .preset-btn {
    background: #2a3848;
    color: #d8dce2;
}

body.dark-mode .preset-btn:hover,
body.dark-mode .preset-btn.active {
    background: var(--primary);
    color: #fff;
}

body.dark-mode footer {
    background: linear-gradient(145deg, #141e2a 0%, #111a24 100%);
}

body.dark-mode .error-msg {
    background: #2a1515;
    color: #f87171;
}

body.dark-mode .bottom-nav {
    background: #1e2a38;
    box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .bottom-nav-btn.active {
    background: rgba(77, 184, 176, 0.1);
}


.events-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.event-card {
    background: rgba(42, 138, 140, 0.04);
    padding: 1.1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.event-card:hover {
    background: rgba(42, 138, 140, 0.06);
}

.event-info h4 {
    color: var(--primary);
    margin-bottom: 0.25rem;
    margin-top: 0;
    font-size: 1rem;
}

.event-date {
    font-size: 0.85rem;
    color: var(--text-light);
    display: block;
}

.event-countdown {
    text-align: right;
    min-width: 80px;
}

.days-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.days-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* PWA Modal */
.pwa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    visibility: hidden;
}

.pwa-modal.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.pwa-modal.show .pwa-content {
    transform: translateY(0);
}

.pwa-content {
    background: var(--white);

    @keyframes stroke {
        100% {
            stroke-dashoffset: 0;
        }
    }

    @keyframes scale {

        0%,
        100% {
            transform: none;
        }

        50% {
            transform: scale3d(1.1, 1.1, 1);
        }
    }

    @keyframes fill {
        100% {
            box-shadow: inset 0px 0px 0px 40px var(--primary);
        }
    }

    .success-checkmark {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .checkmark-circle {
        stroke-dasharray: 166;
        stroke-dashoffset: 166;
        stroke-width: 2;
        stroke-miterlimit: 10;
        stroke: var(--primary);
        fill: none;
        animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
    }

    .checkmark-check {
        transform-origin: 50% 50%;
        stroke-dasharray: 48;
        stroke-dashoffset: 48;
        animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
    }

    border-radius: var(--radius-md);
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.pwa-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.pwa-steps {
    text-align: left;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
}

.pwa-steps li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-icon-ios {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007AFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8'/%3E%3Cpolyline points='16 6 12 2 8 6'/%3E%3Cline x1='12' y1='2' x2='12' y2='15'/%3E%3C/svg%3E") no-repeat center/contain;
}

.add-icon-ios {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='12' y1='8' x2='12' y2='16'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* RESTORED: Audio Player Bar */
.audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 9000;
}

.audio-player-bar.show {
    transform: translateY(0);
}

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

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-icon:hover {
    background: rgba(42, 138, 140, 0.1);
    transform: scale(1.1);
}

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

.audio-btn-main {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(42, 138, 140, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.audio-btn-main:hover {
    transform: scale(1.05);
    background: var(--primary-dark);
}

.audio-info {
    flex: 1;
    margin: 0 1.5rem;
    text-align: center;
}

.audio-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.audio-subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
}

.ayah-playing {
    background-color: rgba(13, 115, 119, 0.1);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.dark-mode .audio-player-bar {
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header Layout Fixes */
header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Quran Page Styling (Ensuring it persists) */
.quran-page {
    background-color: #fdfbf7;
    border: 1px solid #e0dacc;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.quran-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--primary), var(--gold));
    opacity: 0.5;
}

.quran-page-content-arabic {
    font-family: 'Amiri', 'Noto Sans Arabic', serif;
    font-size: 1.8rem;
    line-height: 2.5;
    text-align: justify;
    direction: rtl;
    color: #2c3e50;
}

.quran-ayah {
    position: relative;
    padding: 0 2px;
    cursor: pointer;
    transition: color 0.2s;
}

.quran-ayah:hover {
    color: var(--primary);
}

.quran-ayah-marker {
    display: inline-block;
    font-size: 0.9em;
    color: var(--gold);
    margin: 0 8px;
    font-family: 'Amiri', serif;
    border: 1px solid var(--gold);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    background: rgba(201, 162, 39, 0.1);
}

/* Translation Styling */
.quran-ayah-text.translation {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
    line-height: 1.6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quran-ayah-text.translation:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.quran-ayah-text.translation:last-child {
    border-bottom: none;
}

/* Dark Mode Overrides for Quran */
.dark-mode .quran-page {
    background-color: #1e1e1e;
    border-color: #333;
}

.dark-mode .quran-page-content-arabic {
    color: #e0e0e0;
}

.dark-mode .quran-ayah-marker {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(201, 162, 39, 0.2);
}

.dark-mode .quran-ayah-text.translation {
    border-bottom-color: #333;
}

.dark-mode .quran-ayah-text.translation:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile Header Fixes */
@media (max-width: 767px) {
    header {
        padding: 0.75rem 0;
    }

    .header-content {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo svg {
        width: 28px;
        height: 28px;
    }

    #currentLangText {
        display: none;
    }

    .lang-trigger {
        padding: 0.4rem 0.6rem;
        gap: 0.25rem;
    }

    #headerInstallBtn {
        margin-inline-end: 0.25rem !important;
        padding: 0.35rem 0.6rem !important;
        font-size: 0.75rem !important;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .btn-icon {
        width: 34px;
        height: 34px;
    }
}

/* Landscape fix for small height screens */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        position: static;
    }
}


.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 200px;
}

.monthly-btn-container {
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--white);
}


.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.btn-load-more {
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(13, 115, 119, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-load-more:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(201, 162, 39, 0.3);
}

.btn-load-more:active {
    transform: translateY(-1px);
}

.btn-load-more svg {
    transition: transform 0.3s ease;
}

.btn-load-more:hover svg {
    transform: rotate(90deg);
}

.name-card {
    background: rgba(13, 115, 119, 0.05);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid rgba(13, 115, 119, 0.1);
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease-out forwards;
}

.name-card:hover {
    transform: translateY(-5px);
    background: rgba(13, 115, 119, 0.08);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.name-ar {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.name-tr {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.name-en {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-name-container {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.1) 0%, rgba(201, 162, 39, 0.1) 100%);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    position: relative;
    animation: fadeIn 0.5s ease;
}

.featured-name-container .name-ar {
    font-size: 3rem;
    color: var(--primary-dark);
}

.featured-name-container .name-tr {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.featured-name-container .name-meaning {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
}

.audio-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s;
}

.audio-btn:hover {
    transform: scale(1.1);
}

.audio-btn.playing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.names-progress {
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Dark Mode Overrides for 99 Names */
body.dark-mode .name-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .name-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .featured-name-container {
    background: linear-gradient(135deg, rgba(13, 115, 119, 0.2) 0%, rgba(201, 162, 39, 0.2) 100%);
    border-color: var(--primary);
}

body.dark-mode .name-ar {
    color: var(--gold);
    text-shadow: 0 0 15px rgba(201, 162, 39, 0.3);
}

body.dark-mode .featured-name-container .name-ar {
    color: #fff;
    text-shadow: 0 0 20px rgba(13, 115, 119, 0.5);
}

body.dark-mode .name-tr {
    color: var(--white);
}

body.dark-mode .name-en,
body.dark-mode .names-progress,
body.dark-mode .name-meaning {
    color: #b0bfc6;
}

body.dark-mode .featured-name-container .name-tr {
    color: #fff;
}

/* ===== QURAN READER STYLES ===== */
.quran-ayahs-container {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

/* Mushaf Page Style */
.quran-page {
    background-color: #fdfbf7;
    border: 5px double #ded0a6;
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
}

.quran-page-number {
    text-align: center;
    font-size: 0.9rem;
    color: #b0a37e;
    margin-top: 1.5rem;
    font-family: 'Amiri', serif;
}

.quran-ayah {
    /* Now inline-block for continuous flow */
    display: inline;
    line-height: 2.7;
}

/* Verse Markers */
.quran-ayah-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='18' fill='none' stroke='%23C9A227' stroke-width='2'/%3E%3C/svg%3E");
    background-size: cover;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0.25rem;
    vertical-align: middle;
    font-family: 'Amiri', serif;
}

.quran-ayah-text {
    font-size: 1.5rem;
    line-height: 2.2;
    color: var(--text-dark);
}

.quran-ayah-text.arabic {
    font-family: 'Amiri', 'Noto Sans Arabic', serif;
    direction: rtl;
    text-align: justify;
    text-align-last: center;
    font-size: 1.9rem;
    line-height: 2.6;
    color: #2c2c2c;
}

.quran-ayah-text.translation {
    font-size: 1.05rem;
    line-height: 1.8;
    direction: ltr;
    text-align: left;
    display: block;
    margin-bottom: 1rem;
    padding-bottom: 1rem;

}

/* Bismillah in Surah Header */
#quranBismillah {
    font-family: 'Amiri', serif;
    color: var(--gold);
}

/* Wrapper for continuous flow of arabic text */
.quran-page-content-arabic {
    text-align: justify;
    direction: rtl;
}



/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(13, 115, 119, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dark mode Quran */
body.dark-mode .quran-page {
    background-color: #1e1e2f;
    border-color: #3d3d52;
}

body.dark-mode .quran-ayah-text.arabic {
    color: #e0e0e0;
}

body.dark-mode .quran-ayah-marker {
    color: #fff;
    filter: brightness(1.2);
}

body.dark-mode #quranSurahNameAr {
    color: var(--gold);
}

/* Toggle Switch CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

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

/* Blog / Articles Styles - REDESIGNED */
.blog-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.blog-search-container {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.blog-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: var(--white);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(42, 138, 140, 0.15);
    transform: translateY(-2px);
}

.blog-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* RTL Support for Search */
body[dir="rtl"] .blog-search-input {
    padding: 1rem 3rem 1rem 1rem;
}

body[dir="rtl"] .blog-search-icon {
    left: auto;
    right: 1rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

.article-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(42, 138, 140, 0.3);
}

.article-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    position: relative;
}

.article-placeholder::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
}

.article-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* Article Typography & Elements */
.article-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
}

.article-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Beautiful Tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.article-body thead {
    background-color: var(--primary);
    color: white;
}

.article-body th,
.article-body td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.article-body th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.article-body tr:last-child td {
    border-bottom: none;
}

.article-body tr:nth-child(even) {
    background-color: #f8f9fa;
}

.article-body tr:hover {
    background-color: #f1f1f1;
}

/* Dark Mode Updates for Article Body */
body.dark-mode .article-body {
    color: #e0e0e0;
}

body.dark-mode .article-body h2,
body.dark-mode .article-body h3 {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .article-body blockquote {
    background: #2a3848;
    color: #ccc;
}

body.dark-mode .article-body table {
    background: #2a3848;
    box-shadow: none;
}

body.dark-mode .article-body thead {
    background-color: #1a2634;
}

body.dark-mode .article-body th,
body.dark-mode .article-body td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

body.dark-mode .article-body tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

body.dark-mode .article-body tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.article-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.35;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more-btn {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.2s ease;
}

.article-card:hover .read-more-btn {
    gap: 0.6rem;
}

/* Dark Mode Overrides */
body.dark-mode .blog-search-input {
    background: #2a3848;
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

body.dark-mode .article-card {
    background: #2a3848;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .article-card:hover {
    background: #303f50;
    border-color: var(--primary);
}

body.dark-mode .article-title {
    color: var(--white);
}

body.dark-mode .article-excerpt {
    color: #b0bfc6;
}


/* Mobile Responsive adjustments */
@media (min-width: 768px) {
    /* (Styles removed as they are now handled in the main blog styling block) */
}


/* ==================== BLOG / ARTICLE STYLES ==================== */

/* --- Blog Hero Section --- */
.blog-hero {
    background: linear-gradient(135deg, rgba(42, 138, 140, 0.05) 0%, rgba(255, 255, 255, 1) 100%);
    padding: 4rem 1.5rem;
    text-align: center;
    border-radius: 20px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(42, 138, 140, 0.1);
}

.blog-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(42, 138, 140, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-hero h2 {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.blog-hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* --- Search & Filter Bar --- */
.blog-search-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.blog-search-bar {
    flex: 2;
    min-width: 300px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    background: var(--white);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-search-bar:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(42, 138, 140, 0.15);
}

.blog-search-bar input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
    background: transparent;
}

.blog-search-bar input:focus {
    border-color: var(--primary);
}

.blog-search-bar .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.blog-filters {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.blog-filters select {
    flex: 1;
    padding: 0 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: var(--white);
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    height: 52px;
    /* Match input height roughly */
}

.blog-filters select:hover {
    border-color: var(--primary);
}

/* --- Article Cards (Myna UI Style) --- */
.articles-grid {
    display: grid;
    /* Default for mobile/tablet */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 900px) {
    .articles-grid {
        /* Strictly 3 columns as requested */
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.article-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    /* Subtle, premium shadow */
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.03);
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.article-card:hover {
    transform: translateY(-8px);
    /* Deeper shadow on hover */
    box-shadow: 0 20px 50px -10px rgba(42, 138, 140, 0.15);
}

.article-image-container {
    width: 100%;
    /* 16:9 Aspect Ratio */
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

.article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.article-card:hover .article-image {
    transform: scale(1.06);
}

.article-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-category {
    color: var(--primary);
}

.article-read-time {
    color: #a0a0a0;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    transition: color 0.2s ease;
}

.article-card:hover .article-title {
    color: var(--primary);
}

.article-excerpt {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: auto;
}

.article-date {
    font-size: 0.8rem;
    color: #999;
}

.read-more-btn {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.article-card:hover .read-more-btn {
    color: var(--primary);
}

/* --- Pagination / Load More --- */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 4rem;
    grid-column: 1 / -1;
    width: 100%;
}

#blogLoadMoreBtn {
    background: transparent;
    color: var(--primary);
    border: 2px solid rgba(42, 138, 140, 0.2);
    padding: 0.8rem 3rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    display: inline-block;
}

#blogLoadMoreBtn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(42, 138, 140, 0.25);
    transform: translateY(-2px);
}

/* --- Content Reading Styles (Premium upgrade) --- */
.article-body-content {
    font-family: 'Merriweather', 'Georgia', 'Noto Naskh Arabic', serif;
    color: #2c3e50;
    line-height: 2.1 !important;
    font-size: 1.35rem !important;
    max-width: 850px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    letter-spacing: -0.01em;
}

.article-body-content p {
    margin-bottom: 2.2rem;
    opacity: 0.95;
}

/* Drop Cap - Stylish initial letter */
.article-body-content p:first-of-type::first-letter {
    float: left;
    font-size: 4.5rem;
    line-height: 1;
    font-weight: 800;
    margin-right: 0.75rem;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
    text-shadow: 2px 2px 0px rgba(var(--primary-rgb), 0.1);
}

body[dir="rtl"] .article-body-content p:first-of-type::first-letter {
    float: right;
    margin-right: 0;
    margin-left: 0.75rem;
}

.article-body-content h2 {
    font-family: 'Inter', 'Noto Sans Arabic', sans-serif;
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    border-left: 5px solid var(--gold);
    padding-left: 1.2rem;
    line-height: 1.3;
}

body[dir="rtl"] .article-body-content h2 {
    border-left: none;
    border-right: 5px solid var(--gold);
    padding-left: 0;
    padding-right: 1.2rem;
}

.article-body-content h3 {
    font-family: 'Inter', 'Noto Sans Arabic', sans-serif;
    font-size: 1.7rem;
    color: var(--text-dark);
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Premium Callout Box */
.premium-callout {
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.03), rgba(var(--primary-rgb), 0.08));
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 3rem 0;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    clear: both;
}

.premium-callout::before {
    content: '✨';
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--gold);
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(212, 168, 67, 0.3);
}

.premium-callout h4 {
    margin-top: 0;
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-body-content ul,
.article-body-content ol {
    margin-bottom: 2.5rem;
    padding-inline-start: 2.5rem;
}

.article-body-content li {
    margin-bottom: 1rem;
}

.article-body-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2.5px solid rgba(var(--primary-rgb), 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-body-content a:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-bottom-color: var(--primary);
    color: var(--primary-dark);
}

/* Visual Excellence: Media styles */
.article-body-content img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin: 3rem 0;
    max-width: 100%;
}

.article-body-content blockquote {
    font-style: italic;
    font-size: 1.5rem;
    border-left: 4px solid var(--primary-light);
    padding-left: 2rem;
    margin: 3rem 0;
    color: #555;
}

body[dir="rtl"] .article-body-content blockquote {
    border-left: none;
    border-right: 4px solid var(--primary-light);
    padding-left: 0;
    padding-right: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 1rem;
    }

    .blog-hero h2 {
        font-size: 2.2rem;
    }

    .blog-search-wrapper {
        flex-direction: column;
    }

    .blog-search-bar,
    .blog-filters {
        width: 100%;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* End of consolidated PWA styles */

.pwa-steps li {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Dark Mode for PWA Modal */
body.dark-mode .pwa-content {
    background: #2a3848;
    color: #d8dce2;
}

body.dark-mode .pwa-steps {
    background: #1e2a38;
}

body.dark-mode .pwa-steps li {
    color: #d8dce2;
}

/* General Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ==================== PRINT STYLES ==================== */
@media print {

    header,
    footer,
    nav,
    .nav-scroll,
    .bottom-nav,
    .mobile-menu-item,
    .hero,
    .ramadan-banner,
    .location-input,
    .next-prayer,
    .tool-card>h2,
    .monthly-view-header,
    .tool-seo-content,
    .ad-container,
    .audio-player-bar,
    .mobile-menu-overlay,
    .pwa-modal,
    .location-popup,
    #prayerResults,
    button,
    .lang-dropdown {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    main {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    .tool-section {
        display: none !important;
    }

    .tool-section#prayer {
        display: block !important;
    }

    .tool-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: white !important;
    }

    #monthlyView {
        display: block !important;
        visibility: visible !important;
    }

    #monthlyView h3 {
        color: black !important;
        text-align: center;
        margin-bottom: 2rem !important;
        display: block !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .monthly-table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 2px solid #333 !important;
    }

    .monthly-table th {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #333 !important;
        padding: 10px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .monthly-table td {
        border: 1px solid #333 !important;
        padding: 8px !important;
        color: black !important;
    }

    /* Keep the "Today" highlight subtle for print if it's the current month */
    .monthly-table tr[style*="background"] {
        background: #efefef !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}