/* ============================================================
   MUSLIMAPP - Complete Islamic Platform Styles
   ============================================================ */

:root {
    --primary: #1a4b3c;
    --primary-dark: #0f3328;
    --primary-light: #2d6b56;
    --secondary: #c9a86c;
    --secondary-dark: #b38f4f;
    --secondary-light: #d8bf8a;
    --accent: #b8860b;
    --accent-light: #d4a017;
    --text-primary: #1e2a2a;
    --text-secondary: #4a5568;
    --text-muted: #6c757d;
    --bg-primary: #ffffff;
    --bg-secondary: #f9f6f0;
    --bg-tertiary: #e9ecef;
    --bg-dark: #0f3328;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --nav-height: 70px;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    --font-arabic: 'Noto Naskh Arabic', 'Traditional Arabic', serif;
    --max-width: 1200px;
    --gradient-primary: linear-gradient(135deg, #1a4b3c 0%, #2d6b56 100%);
    --gradient-accent: linear-gradient(135deg, #c9a86c 0%, #b38f4f 100%);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; }

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.section-header .btn-link {
    margin-top: 1rem;
    display: inline-block;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links > li > a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dropdown-menu li a:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-link {
    background: none;
    color: var(--primary);
    padding: 0;
    font-weight: 600;
}

.btn-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-danger {
    background: #e53e3e;
    color: white;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#hero3d-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15,61,30,0.85) 0%, rgba(26,92,46,0.75) 50%, rgba(15,61,30,0.85) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1.2s ease;
}

/* Quick Cards */
.quick-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: -3rem;
    position: relative;
    z-index: 3;
}

.quick-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    border-bottom: 3px solid var(--card-color);
    text-decoration: none;
    color: var(--text-primary);
}

.quick-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    color: var(--text-primary);
}

.quick-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.quick-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.quick-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Sections */
.section {
    padding: 5rem 0;
}

.section-dark {
    background: var(--bg-dark);
    color: white;
}

.section-dark .section-header h2,
.section-dark .section-header h2::after,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: white;
}

.section-dark .section-header p {
    color: rgba(255,255,255,0.8);
}

.section-gray {
    background: var(--bg-secondary);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
}

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

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.feature-card h3 { margin-bottom: 0.75rem; }
.feature-card p { color: var(--text-secondary); margin-bottom: 1rem; }

/* Daily Verse */
.daily-verse-card {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.verse-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.verse-header i {
    color: var(--accent);
    font-size: 1.5rem;
}

.verse-content {
    margin-bottom: 1.5rem;
}

.verse-arabic {
    font-family: var(--font-arabic);
    font-size: 2rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: center;
}

.verse-translation {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.5rem;
}

.verse-reference {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

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

.verse-actions .btn {
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}

.verse-actions .btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Course Cards */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.course-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-level {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--gradient-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-body {
    padding: 1.5rem;
}

.course-body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.course-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.course-lessons { border-top: 1px solid var(--border-light); padding-top: 0.75rem; margin-bottom: 0.75rem; }
.course-lesson-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.82rem; transition: var(--transition); }
.course-lesson-item:hover { background: var(--bg-tertiary); color: var(--primary); }
.lesson-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.lesson-name { flex: 1; }
}

/* Forum Topics */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.topic-item:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.topic-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.topic-info { flex: 1; }
.topic-info h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.topic-info p { font-size: 0.8rem; color: var(--text-muted); }
.topic-stats { color: var(--text-muted); font-size: 0.8rem; }

/* Calendar Widget */
.calendar-widget {
    max-width: 500px;
    margin: 0 auto;
}

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

.calendar-header button {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-header button:hover {
    background: rgba(255,255,255,0.1);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.calendar-day {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.calendar-day.today {
    background: var(--accent);
    color: white;
    font-weight: 700;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    animation: fadeIn 0.3s ease;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.search-form { margin-bottom: 1rem; }

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 0 1rem;
    box-shadow: var(--shadow-lg);
}

.search-input-group i {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-input-group input {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
}

.search-suggestions {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
}

/* Language Selector */
.language-selector { position: relative; }

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.language-selector:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* User Menu */
.user-menu { position: relative; }

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.user-info strong { display: block; }
.user-info small { color: var(--text-muted); }

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.user-dropdown a:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand i { color: var(--accent); }

.footer-col p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
    outline: none;
}

.newsletter-form input::placeholder { color: rgba(255,255,255,0.5); }

.newsletter-form button {
    padding: 0.625rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: var(--accent-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26,92,46,0.4);
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

/* Page Header */
.page-header {
    background: var(--gradient-primary);
    padding: 6rem 0 3rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.page-header h1 {
    color: white;
    margin-bottom: 0.5rem;
    position: relative;
}

.page-header p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    position: relative;
}

/* Main Content */
.main-content {
    padding-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* Mobile Nav Backdrop */
.nav-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-backdrop.active {
    display: block;
    opacity: 1;
}
body.nav-open {
    overflow: hidden;
}

/* Mobile Bottom Tab Bar */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    z-index: 1000;
    padding: 0 0.5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    position: relative;
}
.bottom-nav-item i {
    font-size: 1.15rem;
    transition: var(--transition);
}
.bottom-nav-item span {
    line-height: 1;
}
.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item.active i {
    transform: scale(1.1);
}
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* Auth Pages */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26,92,46,0.1);
}

.form-control.arabic-input {
    font-family: var(--font-arabic);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert-warning {
    background: #fefcbf;
    color: #744210;
    border: 1px solid #fae588;
}

.alert-info {
    background: #bee3f8;
    color: #2a4365;
    border: 1px solid #90cdf4;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 1.5rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #fefcbf;
    color: #744210;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-info {
    background: #bee3f8;
    color: #2a4365;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb span {
    color: var(--text-secondary);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}

table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
}

table tr:hover {
    background: var(--bg-secondary);
}

/* Animations */
/* Search Suggestions */
.search-suggestion {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-suggestion:last-child {
    border-bottom: none;
}

.search-suggestion:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-suggestion i {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.search-suggestion small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* AI Chat Styles */
.ai-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.ai-chat {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ai-bubble {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-message.user .ai-bubble {
    background: var(--primary);
    color: white;
}

.ai-input-group {
    display: flex;
    gap: 0.5rem;
}

.ai-input-group .form-control {
    flex: 1;
}

.quick-q {
    margin-bottom: 0.5rem;
    text-align: left;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    width: 100%;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.quick-q:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-tertiary);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Admin Layout Fixes */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    gap: 0;
}

.admin-sidebar {
    background: var(--bg-dark);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar a {
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.admin-main {
    padding: 2rem;
}

/* Quran Layout */
.quran-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.surah-list {
    max-height: 600px;
    overflow-y: auto;
}

.surah-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: var(--transition);
    text-decoration: none;
}

.surah-item:hover,
.surah-item.active {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.surah-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.surah-info {
    flex: 1;
}

.surah-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.surah-arabic {
    display: block;
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.quran-welcome {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.quran-welcome i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.ayah-card {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.ayah-card:hover {
    background: var(--bg-secondary);
}

.ayah-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.ayah-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.ayah-header { cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.ayah-header:hover { background: var(--bg-tertiary); padding: 0.25rem 0.5rem; margin: -0.25rem -0.5rem; border-radius: var(--radius-sm); }
.ayah-header-actions { display: flex; align-items: center; gap: 0.25rem; }
.ayah-body { padding: 0.5rem 0; }
.ayah-expand-btn { font-size: 0.75rem !important; }

.ayah-arabic-text {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
}

.ayah-translation-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.bismillah {
    text-align: center;
    font-family: var(--font-arabic);
    font-size: 1.8rem;
    padding: 2rem;
    color: var(--primary);
    opacity: 0.8;
}

.quran-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

/* Prayer Times */
.prayer-settings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.prayer-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.prayer-location i {
    color: var(--accent);
}

.prayer-date {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.prayer-item {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.prayer-item:hover {
    box-shadow: var(--shadow-md);
}

.prayer-item.next-prayer {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(184,134,11,0.05), rgba(212,160,23,0.1));
}

.prayer-item.next-prayer .prayer-name {
    color: var(--accent);
    font-weight: 700;
}

.prayer-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.prayer-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.prayer-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.prayer-method-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.prayer-method-selector select {
    width: auto;
    min-width: 200px;
}

/* Qibla */
.qibla-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.qibla-compass-card {
    text-align: center;
    padding: 2rem;
}

.compass-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
}

.compass-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--border);
    position: relative;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
}

.compass-direction {
    position: absolute;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.compass-direction.n { top: 10px; left: 50%; transform: translateX(-50%); }
.compass-direction.s { bottom: 10px; left: 50%; transform: translateX(-50%); }
.compass-direction.e { right: 10px; top: 50%; transform: translateY(-50%); }
.compass-direction.w { left: 10px; top: 50%; transform: translateY(-50%); }

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--primary);
    transition: transform 0.5s ease;
}

.qibla-marker {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Dua */
.dua-controls {
    margin-bottom: 2rem;
}

.dua-search {
    margin-bottom: 1rem;
}

.dua-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dua-cat-btn {
    border: 1px solid var(--border);
    background: var(--bg-primary);
    transition: var(--transition);
}

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

.dua-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.dua-card {
    transition: var(--transition);
}

.dua-card:hover {
    box-shadow: var(--shadow-md);
}

.dua-arabic {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    direction: rtl;
    text-align: center;
}

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

.dua-translation {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.dua-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

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

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

/* Calendar */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.cal-day-header {
    text-align: center;
    font-weight: 600;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cal-day {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cal-day:hover {
    border-color: var(--border);
    background: var(--bg-tertiary);
}

.cal-day.today {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cal-day.today .cal-day-hijri {
    color: rgba(255,255,255,0.8);
}

.cal-day.empty {
    border-color: transparent;
}

.cal-day-num {
    font-weight: 700;
    font-size: 1.1rem;
}

.cal-day-hijri {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.event-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

/* Zakat */
.zakat-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Hajj */
.hajj-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.hajj-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.hajj-checklist ul {
    list-style: none;
    margin-top: 1rem;
}

.hajj-checklist ul li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-primary);
    transform: translateX(-5px);
}

.timeline-date {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.event-date {
    font-weight: 600;
    color: var(--primary);
}

.event-hijri {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Media */
.media-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.media-filter {
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

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

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.media-card {
    overflow: hidden;
}

.media-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumb.audio-thumb,
.media-thumb.doc-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary);
}

.media-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.media-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.media-body {
    padding: 1rem;
}

.media-body h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.media-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Community */
.community-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.category-item:hover,
.category-item.active {
    background: var(--bg-tertiary);
    color: var(--primary);
    text-decoration: none;
}

.reply-card {
    border-left: 3px solid var(--primary);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-content {
    line-height: 1.6;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.notification-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
}

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

/* Profile */
.profile-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

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

.profile-avatar {
    margin-bottom: 1rem;
}

/* Learning */
.learning-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.lesson-list {
    max-height: 500px;
    overflow-y: auto;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: var(--transition);
}

.lesson-item:hover,
.lesson-item.active {
    background: var(--bg-tertiary);
    color: var(--primary);
    text-decoration: none;
}

.lesson-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.lesson-item.active .lesson-number {
    background: var(--primary);
    color: white;
}

.lesson-content {
    line-height: 1.8;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

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

.lesson-nav {
    display: flex;
    justify-content: space-between;
}

/* Hadith */
.hadith-controls {
    margin-bottom: 2rem;
}

.hadith-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

.hadith-display { padding: 1.5rem; }
.hadith-narrated { font-style: italic; color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }
.hadith-arabic { font-family: var(--font-arabic); font-size: 1.5rem; line-height: 2; text-align: center; direction: rtl; margin-bottom: 1.5rem; }
.hadith-text { font-size: 1rem; line-height: 1.8; margin-bottom: 1rem; color: var(--text-secondary); }
.hadith-reference { font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border-light); padding-top: 0.75rem; }

.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-outline-secondary { background: transparent; border: 1px solid var(--text-muted); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--text-muted); color: white; }

.hadith-collections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.collection-btn {
    border: 1px solid var(--border);
    background: var(--bg-primary);
    font-size: 0.85rem;
}

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

.hadith-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.hadith-actions .form-control {
    flex: 1;
    min-width: 150px;
}



/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.toast-success { background: #2f855a; }
.toast-error { background: #e53e3e; }
.toast-warning { background: #d69e2e; }
.toast-info { background: #3182ce; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Responsive fixes */
@media (max-width: 1024px) {
    .quran-layout,
    .community-layout,
    .profile-layout,
    .learning-layout,
    .calendar-layout,
    .zakat-layout,
    .qibla-container,
    .ai-layout {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        height: auto;
        position: static;
    }

    .admin-sidebar .admin-brand {
        display: none;
    }

    .admin-sidebar a {
        display: inline-flex;
        margin-right: 0.25rem;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .admin-main {
        padding: 1rem;
    }

    .compass-wrapper {
        width: 250px;
        height: 250px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.flex {
    display: flex;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .bottom-nav { display: block; }
    .main-content { padding-bottom: 64px; }
    .nav-toggle { display: flex; }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: calc(var(--nav-height) + 1rem) 1.5rem 2rem;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .nav-links > li > a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        display: none;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
        gap: 1rem;
        padding-top: 1.5rem;
        margin-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .nav-actions .btn.btn-primary.btn-sm {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .quick-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

    .section { padding: 3rem 0; }
    .features-grid { grid-template-columns: 1fr; }

    .footer { padding-bottom: 64px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }

    .page-header { padding: 5rem 0 2rem; }

    /* Mobile text size reductions */
    .verse-arabic { font-size: 1.5rem; }
    .hadith-arabic { font-size: 1.2rem; }
    .ayah-arabic-text { font-size: 1.2rem; }
    .dua-arabic { font-size: 1.1rem; }
    .bismillah { font-size: 1.4rem; }

    /* Calendar grid - wrap to fewer columns */
    .calendar-grid { grid-template-columns: repeat(7, 1fr); }
    .cal-day { padding: 0.4rem 0.25rem; }
    .cal-day-num { font-size: 0.8rem; }
    .cal-day-hijri { font-size: 0.55rem; }

    /* Thumbnail heights */
    .course-thumb, .media-thumb, .video-thumb { height: 140px; }

    /* Card padding */
    .prayer-item { padding: 1rem; }
    .course-body { padding: 1rem; }
    .media-body { padding: 0.75rem; }
    .dua-card .dua-footer { flex-wrap: wrap; gap: 0.5rem; }

    /* Hajj tabs - wrap */
    .hajj-tabs { flex-wrap: wrap; }

    /* Pagination */
    .pagination { flex-wrap: wrap; justify-content: center; }

    /* Search overlay padding */
    .search-overlay { padding-top: 60px; }

    /* Hero height for portrait */
    .hero-section { min-height: 70vh; }

    /* Surah list max-height */
    .surah-list { max-height: 350px; }

    /* Quran sidebar on mobile - full width */
    .quran-sidebar { position: static; width: 100%; }
    .quran-main { width: 100%; }

    /* Language selector btn sizes */
    .lang-option { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.video-card {
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.video-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,0,0,0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition);
}

.video-card:hover .video-play-btn {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: 1rem;
}

.video-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Quran Audio */
.ayah-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ayah-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

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

@media (max-width: 480px) {
    .hero-title { font-size: 1.4rem; }
    .hero-actions { flex-direction: column; }
    .quick-cards { grid-template-columns: 1fr 1fr; }
    .quick-card { padding: 1rem; }
    .quick-card-icon { width: 40px; height: 40px; font-size: 1rem; }
    .quick-card h3 { font-size: 0.8rem; }
    .quick-card p { font-size: 0.7rem; }

    /* Quran page */
    .quran-controls { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .quran-actions { width: 100%; }
    .quran-actions select, .quran-actions button { width: 100%; }

    /* Hadith page */
    .hadith-collections { justify-content: center; gap: 0.3rem; }
    .hadith-actions { flex-direction: column; }
    .hadith-actions select, .hadith-actions .form-control { width: 100% !important; }
    .collection-btn { font-size: 0.75rem; padding: 0.4rem 0.6rem; }

    /* Calendar */
    .cal-day { padding: 0.25rem 0.15rem; }
    .cal-day-num { font-size: 0.7rem; }
    .cal-day-hijri { font-size: 0.45rem; }
    .cal-day-header { font-size: 0.65rem; padding: 0.3rem 0; }

    /* Arabic text */
    .verse-arabic { font-size: 1.2rem; }
    .hadith-arabic { font-size: 1rem; }
    .ayah-arabic-text { font-size: 1rem; }
    .dua-arabic { font-size: 0.95rem; }
    .bismillah { font-size: 1.2rem; }

    /* Section spacing */
    .section { padding: 2rem 0; }

    /* Cards */
    .card-header { padding: 0.75rem 1rem; }
    .card-body { padding: 1rem; }

    /* Thumbnails */
    .course-thumb, .media-thumb, .video-thumb { height: 120px; }

    /* Bottom nav */
    .bottom-nav-item { font-size: 0.55rem; padding: 4px 8px; }
    .bottom-nav-item i { font-size: 1rem; }

    /* Admin sidebar */
    .admin-sidebar a { font-size: 0.7rem; padding: 0.4rem 0.5rem; }

    /* Page titles */
    .page-header h1 { font-size: 1.3rem; }
    .page-header p { font-size: 0.85rem; }

    /* Feature cards */
    .feature-card { padding: 1.25rem; }

    /* Dua grid */
    .dua-grid { grid-template-columns: 1fr; }

    /* Modal */
    /* Modal */
    .modal-content { width: 95%; margin: 1rem; }
}

/* ============================================================
   ROYAL GREEN & GOLD BRANDING ENHANCEMENTS (BELDANGA ALIGNMENT)
   ============================================================ */

/* Unified Quick Access Cards */
.quick-card {
    background: var(--bg-secondary) !important;
    border-radius: 16px !important;
    padding: 2.25rem 1.5rem !important;
    text-align: center !important;
    box-shadow: 0 10px 30px rgba(26, 75, 60, 0.06) !important;
    transition: var(--transition) !important;
    border: 1px solid rgba(201, 168, 108, 0.18) !important;
    border-bottom: 4px solid var(--primary) !important;
    text-decoration: none !important;
    color: var(--text-primary) !important;
    position: relative !important;
    overflow: hidden !important;
}

.quick-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-dark));
    opacity: 0;
    transition: var(--transition);
}

.quick-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 35px rgba(26, 75, 60, 0.14) !important;
    border-color: var(--secondary) !important;
    border-bottom-color: var(--secondary) !important;
}

.quick-card:hover::before {
    opacity: 1;
}

.quick-card-icon {
    width: 65px !important;
    height: 65px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 1.25rem !important;
    font-size: 1.6rem !important;
    color: var(--secondary) !important;
    box-shadow: 0 5px 15px rgba(26, 75, 60, 0.22) !important;
    transition: var(--transition) !important;
}

.quick-card:hover .quick-card-icon {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%) !important;
    color: var(--primary-dark) !important;
    transform: rotate(360deg) !important;
    box-shadow: 0 5px 15px rgba(201, 168, 108, 0.35) !important;
}

.quick-card h3 { 
    font-family: var(--font-heading) !important;
    font-size: 1.3rem !important; 
    margin-bottom: 0.5rem !important; 
    color: var(--primary-dark) !important;
    font-weight: 700 !important;
}

.quick-card p { 
    font-size: 0.85rem !important; 
    color: var(--text-secondary) !important; 
}

/* Feature Cards Alignment */
.feature-card {
    background: var(--bg-secondary) !important;
    border: 1px solid rgba(201, 168, 108, 0.15) !important;
    border-radius: 16px !important;
    padding: 2.25rem 2rem !important;
    transition: var(--transition) !important;
    box-shadow: 0 8px 24px rgba(26, 75, 60, 0.04) !important;
}

.feature-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(26, 75, 60, 0.08) !important;
    border-color: var(--secondary) !important;
}

.feature-icon {
    width: 58px !important;
    height: 58px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--secondary) !important;
    font-size: 1.45rem !important;
    margin-bottom: 1.25rem !important;
    box-shadow: 0 4px 12px rgba(26, 75, 60, 0.18) !important;
}

.feature-card h3 { 
    font-family: var(--font-heading) !important;
    font-size: 1.45rem !important;
    color: var(--primary-dark) !important;
    margin-bottom: 0.75rem !important; 
}

/* Course Cards Alignment */
.course-card {
    background: var(--bg-secondary) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(26, 75, 60, 0.04) !important;
    transition: var(--transition) !important;
    border: 1px solid rgba(201, 168, 108, 0.15) !important;
}

.course-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(26, 75, 60, 0.08) !important;
    border-color: var(--secondary) !important;
}

.course-level {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%) !important;
    color: var(--primary-dark) !important;
    font-weight: 700 !important;
    border-radius: 20px !important;
}

.course-body h3 {
    font-family: var(--font-heading) !important;
    font-size: 1.35rem !important;
    color: var(--primary-dark) !important;
    font-weight: 700 !important;
}

/* Daily Verse Card Enhancement */
.daily-verse-card {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(201, 168, 108, 0.22) !important;
    border-radius: 20px !important;
    padding: 3.5rem 2rem !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.verse-arabic {
    color: var(--secondary) !important;
    font-size: 2.25rem !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    font-weight: 500 !important;
}

.verse-reference {
    color: var(--secondary-light) !important;
    letter-spacing: 0.5px !important;
}

.verse-actions .btn {
    border-radius: 30px !important;
    border: 1px solid rgba(201, 168, 108, 0.3) !important;
    transition: var(--transition) !important;
}

.verse-actions .btn:hover {
    background: var(--secondary) !important;
    color: var(--primary-dark) !important;
    border-color: var(--secondary) !important;
}

/* General Card Enhancement */
.card {
    border-radius: 16px !important;
    border: 1px solid rgba(201, 168, 108, 0.15) !important;
    box-shadow: 0 8px 24px rgba(26, 75, 60, 0.04) !important;
    background: var(--bg-secondary) !important;
    overflow: hidden !important;
}

.card-header {
    background: rgba(26, 75, 60, 0.02) !important;
    border-bottom: 1px solid rgba(201, 168, 108, 0.15) !important;
    padding: 1.25rem 1.5rem !important;
}

.card-header h3 {
    font-family: var(--font-heading) !important;
    color: var(--primary-dark) !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
}

/* Page Header with Mosque Background Image & Green Overlay (Arab/Muslim Theme) */
.page-header {
    position: relative !important;
    background-image: url('https://images.unsplash.com/photo-1564507592333-c60657eea523?auto=format&fit=crop&w=1920&q=80') !important; /* Beautiful Taj Mahal Dome Silhouette */
    background-size: cover !important;
    background-position: center !important;
    border-bottom: 3px solid var(--secondary) !important;
    padding: 5.5rem 0 !important;
    text-align: center !important;
    color: var(--white) !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

.page-header::before {
    content: '' !important;
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0 !important;
    background: linear-gradient(135deg, rgba(15, 51, 40, 0.9) 0%, rgba(26, 75, 60, 0.8) 100%) !important;
    z-index: -1 !important;
}

.page-header .container {
    position: relative !important;
    z-index: 2 !important;
}

.page-header h1 {
    font-family: var(--font-heading) !important;
    font-size: 2.75rem !important;
    font-weight: 800 !important;
    color: var(--secondary) !important;
    margin-bottom: 0.5rem !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.page-header p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.1rem !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

/* ============================================================
   MOBILE RESPONSIVENESS OVERRIDES & HERO MOSQUE BACKGROUND
   ============================================================ */

/* High-res beautiful mosque hero background image */
.hero-section {
    position: relative !important;
    min-height: 75vh !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
    background-image: url('https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1920&q=80') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: scroll !important; /* Fixed background lag resolved on touch devices */
}

.hero-overlay {
    background: linear-gradient(135deg, rgba(15, 51, 40, 0.9) 0%, rgba(26, 75, 60, 0.8) 50%, rgba(15, 51, 40, 0.9) 100%) !important;
}

/* Intermediate screen and mobile typography reductions */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.75rem !important;
    }
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem !important;
        line-height: 1.25 !important;
    }
    .hero-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
    }
    .hero-actions {
        gap: 0.75rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    .hero-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Quick access card mobile overrides to prevent wrapping and overflow */
@media (max-width: 480px) {
    .quick-cards {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        padding: 0 5px !important;
        margin-top: -2rem !important;
    }
    .quick-card {
        padding: 1.25rem 0.5rem !important;
        border-radius: 12px !important;
        border-bottom-width: 3px !important;
    }
    .quick-card-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
        box-shadow: 0 4px 8px rgba(26, 75, 60, 0.15) !important;
    }
    .quick-card h3 {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
    }
    .quick-card p {
        display: none !important; /* Hide details on small mobile screens to keep the grid extremely neat */
    }
}

/* Ensure other layouts (grid items, spacing) are beautifully padded on mobile */
@media (max-width: 991.98px) {
    .features-grid, .courses-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .section-header h2 {
        font-size: 1.85rem !important;
    }
    .section-header p {
        font-size: 0.95rem !important;
    }

    /* Stack any sidebar/main layouts on all internal pages */
    .quran-layout, .hadith-layout, .prayer-layout, .zakat-layout, .hajj-layout, .learning-layout, .forum-layout, .profile-layout, .calendar-layout, .history-layout, .family-layout, .media-layout, .app-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .quran-sidebar, .quran-main, .hadith-sidebar, .hadith-main, .learning-sidebar, .learning-main, .forum-sidebar, .forum-main, .profile-sidebar, .profile-main, .sidebar, .main-content, .app-sidebar, .app-main {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Responsive overrides for Calendar to prevent mobile view overflow */
@media (max-width: 576px) {
    .calendar-day, .cal-day {
        padding: 0.4rem 0.15rem !important;
        font-size: 0.8rem !important;
    }
}

/* Prevent horizontal scroll white space on mobile devices */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Live Moon Phase Widget Styling */
.moon-phase-widget {
    background: #092119 !important; /* Rich solid deep forest green card backing */
    border: 1px solid rgba(201, 168, 108, 0.28) !important;
    border-radius: 20px !important;
    padding: 2.25rem 2rem !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.moon-icon-container {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon-graphic {
    font-size: 4.85rem;
    position: relative;
    z-index: 2;
    animation: moonFloat 4s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(201, 168, 108, 0.35));
}

.moon-glow {
    position: absolute;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(201, 168, 108, 0.45) 0%, rgba(201, 168, 108, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    top: 20px;
    left: 20px;
    filter: blur(6px);
}

@keyframes moonFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(6deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* Islamic Calendar Card Symmetry Styling */
.calendar-widget {
    background: #092119 !important; /* Rich solid deep forest green card backing */
    border: 1px solid rgba(201, 168, 108, 0.28) !important;
    border-radius: 20px !important;
    padding: 2.25rem 2rem !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3) !important;
    height: 100%;
}

/* Section Dark Calendar Day Contrast Overrides */
.section-dark .calendar-day {
    color: #f9f6f0 !important; /* Warm white day numbers */
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(201, 168, 108, 0.1) !important;
    transition: var(--transition) !important;
}

.section-dark .calendar-day:hover {
    background: rgba(201, 168, 108, 0.25) !important;
    color: var(--secondary-light) !important;
    border-color: var(--secondary) !important;
}

.section-dark .calendar-day.header {
    color: var(--secondary) !important; /* Royal gold weekday headers */
    font-weight: 700 !important;
    background: transparent !important;
    border: none !important;
}

.section-dark .calendar-day.empty {
    background: transparent !important;
    border: none !important;
    opacity: 0;
}

.section-dark .calendar-day.today {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)) !important;
    color: #092119 !important; /* Dark green number on gold background for today */
    border-color: var(--secondary) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 10px rgba(201, 168, 108, 0.35) !important;
}

.section-dark .calendar-header h3 {
    color: var(--secondary) !important; /* Royal gold active month name */
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}

.section-dark .calendar-header button {
    border-color: rgba(201, 168, 108, 0.3) !important;
    color: var(--secondary) !important;
}

.section-dark .calendar-header button:hover {
    background: rgba(201, 168, 108, 0.15) !important;
    color: var(--white) !important;
}

/* Moon Phase Widget Premium Gold Overrides */
.moon-phase-widget h3#moonPhaseName {
    color: var(--secondary) !important; /* Royal gold moon phase title */
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}

.moon-phase-widget strong.text-warning,
.moon-phase-widget .text-warning,
.moon-phase-widget strong {
    color: var(--secondary) !important; /* Royal gold values */
}

.moon-phase-widget p.text-white-50 {
    color: var(--secondary-light) !important; /* Muted gold hijri date */
    font-weight: 500 !important;
}

.moon-phase-widget small.text-white-50 {
    color: rgba(255, 255, 255, 0.6) !important; /* Muted ivory metadata labels */
}
