/* ===== CSS Variables ===== */
:root {
    --primary-color: #1a5f3f;
    --primary-light: #2d8a5e;
    --primary-dark: #0d3d26;
    --secondary-color: #d4a843;
    --secondary-light: #e8c76a;
    --accent-color: #c9a227;
    --text-dark: #2c3e50;
    --text-light: #5a6c7d;
    --text-muted: #8e9aab;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e1e8ed;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --font-primary: 'Poppins', sans-serif;
    --font-arabic: 'Amiri', serif;
    --font-urdu: 'Noto Nastaliq Urdu', 'Amiri', serif;
}

/* ===== RTL Support for Urdu ===== */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] body {
    font-family: var(--font-urdu);
    line-height: 1.8;
}

[dir="rtl"] .nav-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-right {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-brand {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .hero-content,
[dir="rtl"] .section-title,
[dir="rtl"] .empty-state,
[dir="rtl"] .page-header .container {
    text-align: center;
}

[dir="rtl"] .service-card {
    text-align: center;
}

[dir="rtl"] .step-card {
    text-align: center;
}

[dir="rtl"] .footer-content {
    text-align: center;
}

[dir="rtl"] .filters-bar {
    flex-direction: row-reverse;
}

[dir="rtl"] .form-grid {
    direction: rtl;
}

[dir="rtl"] .dashboard-sidebar {
    right: 0;
    left: auto;
}

[dir="rtl"] .dashboard-main {
    margin-left: 0;
    margin-right: 260px;
}

[dir="rtl"] .sidebar-link {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .sidebar-link:hover,
[dir="rtl"] .sidebar-link.active {
    border-right-color: var(--secondary-color);
    border-left-color: transparent;
}

[dir="rtl"] .zakat-family-header,
[dir="rtl"] .profile-header,
[dir="rtl"] .section-header,
[dir="rtl"] .cert-ids-row,
[dir="rtl"] .progress-info,
[dir="rtl"] .dashboard-topbar {
    flex-direction: row-reverse;
}

[dir="rtl"] .cert-couple-section {
    flex-direction: row-reverse;
}

[dir="rtl"] .cert-signatures-section {
    direction: rtl;
}

[dir="rtl"] .service-link i {
    margin-left: 0;
    margin-right: 5px;
    transform: scaleX(-1);
}

[dir="rtl"] .btn-back i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .masjid-list-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .contact-item {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .faq-question {
    flex-direction: row-reverse;
}

[dir="rtl"] .step-label {
    font-size: 0.75rem;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 15px;
}

[dir="rtl"] .lang-switcher {
    margin-right: 0;
    margin-left: 15px;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.lang-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Navigation ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Left side - Login buttons */
.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Right side - Logo + language */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    text-decoration: none;
}

.nav-brand:hover {
    color: var(--secondary-light);
}

.nav-brand i { font-size: 1.8rem; color: var(--secondary-color); }

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: var(--secondary-light);
}

.btn-login {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-masjid {
    background: var(--secondary-color);
    color: white !important;
}

.btn-masjid:hover {
    background: var(--accent-color);
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Pages ===== */
.page {
    display: none;
    min-height: calc(100vh - 70px - 200px);
}

.page.active { display: block; }

/* ===== Hero Section ===== */
.hero {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='20' cy='20' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='80' cy='40' r='1.5' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='40' cy='70' r='1' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='70' cy='80' r='0.8' fill='rgba(255,255,255,0.1)'/%3E%3C/svg%3E");
    background-size: 100px 100px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: 0 20px;
}

.hero h1 {
    font-family: var(--font-arabic);
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--secondary-light);
    margin-bottom: 15px;
    font-weight: 500;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

[dir="rtl"] .btn {
    font-family: var(--font-urdu);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover { background: rgba(255,255,255,0.3); }

.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #229954; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; color: white; }

/* Back Button */
.btn-back {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 15px;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-back:hover {
    background: rgba(255,255,255,0.3);
}

.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 15px 30px; font-size: 1.1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* ===== Section Title ===== */
.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-dark);
    margin: 50px 0 30px;
}

/* ===== How It Works ===== */
.how-it-works {
    margin: 60px 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.step-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.step-number-badge {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto 15px;
}

.step-card h4 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.step-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ===== Login Section ===== */
.login-section {
    margin: 40px 0;
}

.login-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.login-card.admin-card:hover { border-color: #3498db; }
.login-card.masjid-card:hover { border-color: var(--secondary-color); }

.login-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.admin-card .login-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.masjid-card .login-icon { background: linear-gradient(135deg, var(--secondary-color), var(--accent-color)); }

.login-card h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.login-card > p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.login-card ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
}

.login-card ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-light);
}

.login-card ul li:before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--primary-color);
}

/* ===== Services Grid ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.service-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: white;
}

.zakat-icon { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.matrimony-icon { background: linear-gradient(135deg, #e91e63, #c2185b); }
.jobs-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.donate-icon { background: linear-gradient(135deg, var(--primary-color), var(--primary-light)); }
.masjid-icon { background: linear-gradient(135deg, var(--secondary-color), var(--accent-color)); }

.service-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.service-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

.service-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

.service-link i { margin-left: 5px; }

/* ===== Page Header ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 50px 0;
    margin-bottom: 40px;
}

.page-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.page-header h2 i { color: var(--secondary-light); margin-right: 10px; }
[dir="rtl"] .page-header h2 i { margin-right: 0; margin-left: 10px; }

.page-header p { opacity: 0.9; }

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

/* ===== Forms ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-primary);
    transition: var(--transition);
    background: var(--bg-white);
}

[dir="rtl"] .form-control {
    font-family: var(--font-urdu);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; }

/* ===== Auth Pages ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.auth-header p { color: var(--text-light); }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===== Filters Bar ===== */
.filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters-bar .form-control {
    width: auto;
    min-width: 180px;
}

/* ===== Zakat Families Grid ===== */
.zakat-families-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.zakat-family-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.zakat-family-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.zakat-family-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.zakat-family-header h4 {
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.need-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.need-food { background: #fff3cd; color: #856404; }
.need-medical { background: #f8d7da; color: #721c24; }
.need-education { background: #d1ecf1; color: #0c5460; }
.need-housing { background: #d4edda; color: #155724; }
.need-debt { background: #e2e3e5; color: #383d41; }
.need-marriage { background: #fce4ec; color: #880e4f; }
.need-general { background: #e8eaf6; color: #283593; }
.need-active { background: #d4edda; color: #155724; }
.need-pending { background: #fff3cd; color: #856404; }
.need-completed { background: #d1ecf1; color: #0c5460; }

.family-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.family-description {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.6;
}

.progress-section {
    margin-bottom: 15px;
}

.progress-bar-bg {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
}

.progress-info .raised { color: var(--primary-color); font-weight: 600; }
.progress-info .required { color: var(--text-light); }

/* ===== Donate Container ===== */
.donate-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.family-info-card,
.masjid-info-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.donation-form-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.donation-form-card h3 {
    margin-bottom: 20px;
    color: var(--primary-dark);
}

/* ===== UPI Payment ===== */
.upi-payment-section {
    margin-top: 30px;
}

.payment-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 450px;
    margin: 0 auto;
}

.payment-amount-display {
    font-size: 1.2rem;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.payment-amount-display strong {
    color: var(--primary-color);
    font-size: 2rem;
    display: block;
    margin-top: 5px;
}

.qr-code-placeholder {
    width: 200px;
    height: 200px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    border: 2px dashed var(--border-color);
}

.qr-code-placeholder i {
    font-size: 5rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.upi-details {
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.upi-details p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.payment-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 20px 0;
}

/* ===== Profiles Grid ===== */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.profile-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.profile-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.profile-info h4 { font-size: 1.1rem; color: var(--primary-dark); }
.profile-info p { font-size: 0.85rem; color: var(--text-light); }

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.profile-detail { font-size: 0.85rem; }
.profile-detail span { color: var(--text-muted); display: block; }
.profile-detail strong { color: var(--text-dark); }

/* ===== Jobs List ===== */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 50px;
}

.job-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.job-card:hover { box-shadow: var(--shadow-md); }

.job-title { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 5px; }
.job-company { color: var(--text-light); font-size: 0.9rem; }
.job-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.job-meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== Masjid Donate Grid ===== */
.masjid-donate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.masjid-donate-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.masjid-donate-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--primary-light);
}

.masjid-donate-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8rem;
    color: white;
}

.masjid-donate-card h3 { color: var(--primary-dark); margin-bottom: 5px; }
.masjid-donate-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 15px; }

/* ===== Masjids List ===== */
.masjids-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 50px;
}

.masjid-list-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    align-items: start;
}

.masjid-list-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.masjid-list-info { flex: 1; }
.masjid-list-info h3 { color: var(--primary-dark); margin-bottom: 5px; }
.masjid-list-info p { color: var(--text-light); font-size: 0.9rem; }

.masjid-list-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.masjid-list-meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== Dashboard ===== */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
}

.dashboard-sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: white;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    left: 0;
}

.masjid-sidebar { background: #1e3a5f; }

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-header i { font-size: 1.5rem; color: var(--secondary-color); }

.sidebar-nav { padding: 15px 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--secondary-color);
}

.sidebar-link i { width: 20px; text-align: center; }

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

.dashboard-topbar {
    background: var(--bg-white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-topbar h2 { font-size: 1.5rem; color: var(--primary-dark); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-content { padding: 30px; }

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.stat-icon.masjid { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.nikah { background: linear-gradient(135deg, #e91e63, #c2185b); }
.stat-icon.matrimony { background: linear-gradient(135deg, #9c27b0, #7b1fa2); }
.stat-icon.zakat { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stat-icon.jobs { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-icon.donations { background: linear-gradient(135deg, var(--primary-color), var(--primary-light)); }

.stat-info h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== Admin/Masjid Tabs ===== */
.admin-tab,
.masjid-tab {
    display: none;
}

.admin-tab.active,
.masjid-tab.active {
    display: block;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 { color: var(--primary-dark); }

/* ===== Tables ===== */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.9rem;
}

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
    text-align: right;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.data-table tbody tr:hover { background: var(--bg-light); }
.data-table tbody tr:last-child { border-bottom: none; }

/* ===== Form Section ===== */
.form-section {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.form-section h4 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* ===== Nikah Form ===== */
.nikah-form { max-width: 900px; }

.optional-badge {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* Aadhar Input */
.input-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-action .form-control {
    flex: 1;
}

.btn-icon {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 14px;
    cursor: pointer;
    color: var(--primary-color);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

.aadhar-warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    color: #856404;
    font-size: 0.85rem;
}

.aadhar-warning a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
}

.form-text {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.validation-msg {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
}

.validation-msg.error {
    background: #fde8e8;
    color: #c81e1e;
    border: 1px solid #f5b7b7;
}

.validation-msg.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* Photo Upload */
.photo-upload {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.photo-upload:hover {
    border-color: var(--primary-color);
}

.photo-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.photo-preview-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    gap: 8px;
}

.photo-preview-area i {
    font-size: 2rem;
}

.photo-preview-area span {
    font-size: 0.8rem;
    text-align: center;
    padding: 0 10px;
}

.photo-preview-area.has-image {
    background-size: cover;
    background-position: center;
}

.photo-preview-area.has-image i,
.photo-preview-area.has-image span {
    display: none;
}

/* Digital Signatures */
.signatures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.signature-block {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    background: var(--bg-light);
}

.signature-block label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.signature-canvas {
    width: 100%;
    height: 120px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: crosshair;
    display: block;
    margin-bottom: 8px;
}

.section-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* ===== Certificate - Islamic Design ===== */
.certificate-container { margin-bottom: 30px; }

.islamic-cert {
    background: linear-gradient(135deg, #fff9f0 0%, #ffffff 50%, #fff9f0 100%);
    padding: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 850px;
    margin: 0 auto;
}

.certificate-border-outer {
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
}

.certificate-border-inner {
    background: white;
    padding: 40px;
    border-radius: var(--radius-md);
    position: relative;
}

.cert-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary-light);
}

.cert-masjid-name {
    font-family: var(--font-arabic);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.cert-masjid-address {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.cert-ids-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 10px;
}

.cert-title-section {
    text-align: center;
    margin-bottom: 30px;
}

.cert-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
}

.decoration-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
}

.cert-main-title {
    font-family: var(--font-arabic);
    font-size: 2.8rem;
    color: var(--primary-dark);
    margin: 5px 0;
    letter-spacing: 2px;
}

.cert-sub-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 5px;
}

.cert-body { margin-bottom: 25px; }

.cert-text {
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.cert-text strong { color: var(--primary-dark); }

.cert-couple-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.cert-person {
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.person-label {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.person-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    overflow: hidden;
}

.person-photo i { font-size: 2.5rem; color: var(--text-light); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }

.person-name { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 5px; }
.person-father { font-size: 1rem; color: var(--text-dark); margin-bottom: 8px; }
.person-address { font-size: 0.85rem; color: var(--text-light); margin-bottom: 8px; line-height: 1.4; }
.person-aadhar { font-size: 0.8rem; color: var(--text-light); font-family: monospace; background: var(--bg-white); padding: 4px 10px; border-radius: var(--radius-sm); display: inline-block; }

.cert-couple-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
}

.cert-mahar {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background: linear-gradient(135deg, var(--secondary-light), #fff9f0);
    border-radius: var(--radius-md);
    border: 1px solid var(--secondary-color);
}

.mahar-label { font-size: 0.85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.mahar-value { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); }
.mahar-type { font-size: 0.9rem; color: var(--text-light); text-transform: capitalize; }

.cert-conditions, .cert-wakeel {
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

[dir="rtl"] .cert-conditions,
[dir="rtl"] .cert-wakeel {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.conditions-label, .wakeel-label { font-weight: 600; color: var(--primary-color); margin-bottom: 8px; font-size: 0.9rem; }
.conditions-text, .wakeel-details { color: var(--text-dark); font-size: 0.95rem; line-height: 1.5; }

.cert-witnesses { margin: 25px 0; }
.witnesses-title { text-align: center; font-weight: 600; color: var(--primary-color); margin-bottom: 15px; font-size: 1rem; }
.witnesses-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.witness-block { text-align: center; padding: 15px; background: var(--bg-light); border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.witness-name { font-weight: 600; color: var(--text-dark); margin-bottom: 5px; }
.witness-phone { font-size: 0.85rem; color: var(--text-light); margin-bottom: 10px; }
.witness-signature { font-size: 0.8rem; color: var(--text-light); font-style: italic; border-top: 1px solid var(--border-color); padding-top: 8px; margin-top: 8px; }

.cert-quran-verse {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-radius: var(--radius-lg);
    color: white;
}

.verse-arabic { font-family: 'Amiri', serif; font-size: 1.4rem; line-height: 2; margin-bottom: 15px; }
.verse-translation { font-size: 0.95rem; font-style: italic; line-height: 1.6; opacity: 0.95; margin-bottom: 10px; }
.verse-reference { font-size: 0.85rem; opacity: 0.8; }

.cert-signatures-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.cert-sig-block { text-align: center; }
.sig-line { height: 60px; border-bottom: 1px solid var(--text-dark); margin-bottom: 8px; display: flex; align-items: flex-end; justify-content: center; }
.sig-line img { max-height: 55px; max-width: 100%; }
.sig-label { font-size: 0.8rem; color: var(--text-light); margin-bottom: 3px; }
.sig-name { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }

.cert-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--secondary-light);
}

.cert-seal { font-size: 3rem; color: var(--secondary-color); margin-bottom: 10px; }
.cert-issue-date { font-size: 0.9rem; color: var(--text-light); margin-bottom: 5px; }
.cert-verify { font-size: 0.8rem; color: var(--text-light); }

.certificate-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== Legal Pages (Privacy, Terms) ===== */
.legal-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto 50px;
}

.legal-content h3 {
    color: var(--primary-dark);
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.2rem;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 15px;
}

.legal-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

[dir="rtl"] .legal-content ul {
    margin-left: 0;
    margin-right: 20px;
}

.legal-content ul li {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 8px;
}

/* ===== Contact Page ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.contact-info-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.contact-info-card h3 {
    color: var(--primary-dark);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.contact-item i {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 3px;
}

.contact-item strong {
    color: var(--primary-dark);
    display: block;
    margin-bottom: 3px;
}

.contact-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.contact-form-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.contact-form-card h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
}

/* ===== FAQ Page ===== */
.faq-list {
    max-width: 800px;
    margin: 0 auto 50px;
}

.faq-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    font-weight: 500;
    color: var(--primary-dark);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-question i {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 25px 20px;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content { text-align: center; }

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-brand i { color: var(--secondary-color); }

.footer-text { opacity: 0.8; margin-bottom: 20px; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--secondary-light);
}

.footer-contact {
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.footer-copyright {
    opacity: 0.6;
    font-size: 0.85rem;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-dark);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

[dir="rtl"] .toast {
    right: auto;
    left: 30px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i { font-size: 1.2rem; color: #2ecc71; }

/* ===== Settings Grid ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.settings-card.full-width { grid-column: 1 / -1; }

.settings-card h4 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* ===== Registration Steps ===== */
.registration-steps {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.5;
    transition: var(--transition);
}

.step.active { opacity: 1; }
.step.completed { opacity: 1; }

.step.completed .step-number {
    background: var(--primary-color);
    color: white;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--secondary-color);
    color: white;
}

.step-label { font-size: 0.85rem; font-weight: 500; }

/* ===== Registration Form ===== */
.registration-form {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: 0 auto;
}

.registration-form h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* ===== Read Only Badge ===== */
.read-only-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 10px;
    vertical-align: middle;
}

[dir="rtl"] .read-only-badge {
    margin-left: 0;
    margin-right: 10px;
}

/* ===== Assistant Admin Section ===== */
#assistantAdminSection {
    display: none;
}

#assistantAdminSection.visible {
    display: block;
}

/* ===== QR Code Canvas ===== */
.qr-code-container {
    width: 220px;
    height: 220px;
    margin: 20px auto;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
}
.qr-code-container canvas {
    display: block;
    border-radius: var(--radius-sm);
}

/* ===== Phone Validation ===== */
input[type="tel"]:not(:placeholder-shown):invalid,
input.phone-validate:not(:placeholder-shown):invalid {
    border-color: var(--danger-color);
}
input[type="tel"]::placeholder {
    color: #999;
    font-size: 0.85rem;
}

/* ===== View Modal (Redesigned) ===== */
.view-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    padding: 40px 20px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}
.view-modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 650px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease;
    overflow: hidden;
    margin-bottom: 40px;
}
.view-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
}
.view-modal-header h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.view-modal-header .btn-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.view-modal-header .btn-icon:hover { background: rgba(255,255,255,0.35); }

/* ===== Generic Modal (for Apply, Interest forms) ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10000;
    padding: 40px 20px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease;
    overflow: hidden;
    margin-bottom: 40px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
}
.modal-header h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.modal-header .btn-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.modal-header .btn-icon:hover { background: rgba(255,255,255,0.35); }
.view-modal-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}
.view-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* Detail Grid - replaces table */
.view-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.view-detail-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.view-detail-item.full-width {
    grid-column: 1 / -1;
}
.view-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 4px;
}
.view-detail-value {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    word-break: break-word;
}
.view-detail-value .need-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
}
.view-creds-box {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 8px 0;
}
.view-creds-box .view-detail-label { color: #2e7d32; }
.view-creds-box .view-detail-value { color: #1b5e20; font-family: monospace; font-size: 1.05rem; font-weight: 700; }
.view-section-title {
    grid-column: 1 / -1;
    background: #f5f5f5;
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0;
}
.view-section-title i { margin-right: 6px; }

@media (max-width: 768px) {
    .view-detail-grid { grid-template-columns: 1fr; }
    .view-modal-overlay { padding: 10px; }
    .view-modal-content { max-width: 100%; }
}

/* ===== Inline Expandable Row ===== */
.inline-detail-row {
    display: none;
    background: #f8f9fa;
    border-left: 3px solid var(--primary-color);
}
.inline-detail-row.active {
    display: table-row;
}
.inline-detail-cell {
    padding: 0 !important;
    border: none !important;
}
.inline-detail-content {
    padding: 0;
}
.inline-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    margin: 10px 15px;
    overflow: hidden;
    background: #fff;
}
.inline-detail-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}
.inline-detail-item.full-width {
    grid-column: 1 / -1;
}
.inline-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}
.inline-detail-value {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
    word-break: break-word;
}
.inline-detail-value .need-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
}
.inline-section-title {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.inline-section-title i { margin-right: 6px; }
.inline-detail-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
    grid-column: 1 / -1;
    justify-content: flex-end;
}
.inline-creds-box {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 8px;
}
.inline-creds-box .inline-detail-label { color: #2e7d32; }
.inline-creds-box .inline-detail-value { color: #1b5e20; font-family: monospace; font-size: 1rem; font-weight: 600; }

/* Row highlight when expanded */
.data-table tbody tr.expanded {
    background: #e8f5e9 !important;
    border-left: 3px solid var(--primary-color);
}
.data-table tbody tr.expanded td {
    font-weight: 600;
}

/* ===== Edit Modal ===== */
.edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.edit-modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}
.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.edit-modal-header h3 { margin: 0; font-size: 1.2rem; }
.edit-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 130px);
}
.edit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
}
.edit-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Actions Cell in Tables ===== */
.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}
.actions-cell .btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* ===== Donate Masjid Dropdown Info Card ===== */
#donateMasjidInfoCard {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    font-size: 0.9rem;
}
#donateMasjidInfoCard h4 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1rem;
}
#donateMasjidInfoCard p {
    color: var(--text-light);
    margin-bottom: 4px;
    font-size: 0.85rem;
}
#donateMasjidInfoCard i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* ===== Masjid Profile Read-Only ===== */
.masjid-profile-readonly {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 5px;
}
.masjid-profile-readonly .view-data-table th {
    width: 30%;
    background: var(--bg-light);
    font-size: 0.8rem;
}
.masjid-profile-readonly .view-data-table td {
    font-size: 0.9rem;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-header h3 {
    margin: 0;
}

/* ===== Public Forms (Matrimony Create, Job Post) ===== */
#publicMatrimonyForm, #publicJobForm {
    animation: slideUp 0.3s ease;
}

/* ===== Interest/Application Badges ===== */
.profile-card .btn-sm,
.job-card .btn-sm {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* ===== Donate Masjid Info Card ===== */
#donateMasjidInfoCard {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
#donateMasjidInfoCard h4 {
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 1rem;
}
#donateMasjidInfoCard p {
    color: var(--text-light);
    margin-bottom: 4px;
    font-size: 0.85rem;
}
#donateMasjidInfoCard i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* ===== Subscription System ===== */
.subscription-banner {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    flex-wrap: wrap;
}
.sub-banner-expired {
    background: #fde8e8;
    border: 1px solid #f5b7b1;
    color: var(--danger-color);
}
.sub-banner-warning {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    color: var(--warning-color);
}
.subscription-banner i { font-size: 1.2rem; }
.subscription-banner strong { font-weight: 600; }
.subscription-banner button { margin-left: auto; }

.sub-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.sub-active { background: #d4edda; color: #155724; }
.sub-expiring { background: #fff3cd; color: #856404; }
.sub-expired { background: #f8d7da; color: #721c24; }
.sub-on-hold { background: #f5c6cb; color: #721c24; border: 1px dashed #dc3545; }

.on-hold-notice {
    background: #fde8e8;
    border: 1px solid #f5b7b1;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    margin-bottom: 15px;
    color: var(--danger-color);
    font-size: 0.9rem;
    text-align: center;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .edit-form-grid { grid-template-columns: 1fr; }
    .view-modal-content,
    .edit-modal-content { max-width: 95%; max-height: 85vh; }
    .view-modal-body,
    .edit-modal-body { padding: 15px; max-height: calc(85vh - 110px); }
    .actions-cell { flex-wrap: wrap; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .subscription-banner button { margin-left: 0; margin-top: 10px; width: 100%; }
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Auth Divider ===== */
.auth-divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

.auth-divider span {
    background: var(--bg-white);
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

/* ===== Register Masjid Card ===== */
.register-masjid-card { border: 2px dashed var(--secondary-color); }
.register-masjid-card:hover { border-style: solid; }
.register-icon { background: linear-gradient(135deg, var(--secondary-color), var(--accent-color)); }

/* ===== Utility ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-left {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary-color);
        flex-direction: column;
        padding: 20px;
        gap: 5px;
    }

    .nav-left.active { display: flex; }
    .nav-toggle { display: block; }
    
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-brand { font-size: 1.2rem; }
    .lang-switcher { margin-right: 5px; }
    .lang-btn { padding: 4px 8px; font-size: 0.7rem; }

    .hero h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; align-items: center; }

    .dashboard-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .dashboard-main { margin-left: 0 !important; margin-right: 0 !important; }
    .dashboard-wrapper { flex-direction: column; }

    .donate-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filters-bar { flex-direction: column; }
    .filters-bar .form-control { width: 100%; }
    .section-header { flex-direction: column; gap: 10px; }
    .cert-signatures-section { grid-template-columns: repeat(2, 1fr); }
    .cert-couple-section { flex-direction: column; }
    .witnesses-grid { grid-template-columns: 1fr; }
    .registration-steps { gap: 20px; }
    .contact-grid { grid-template-columns: 1fr; }
    .legal-content { padding: 25px; }
    .zakat-families-grid { grid-template-columns: 1fr; }
    .profiles-grid { grid-template-columns: 1fr; }
    .masjid-donate-grid { grid-template-columns: 1fr; }
}

@media print {
    .navbar, .footer, .certificate-actions, .toast, .btn-back, .lang-switcher { display: none !important; }
    .page { display: none !important; }
    #certificate.page { display: block !important; }
    .islamic-cert { box-shadow: none; padding: 0; }
    .certificate-border-outer { padding: 8px; }
    .certificate-border-inner { padding: 20px; }
    .cert-signatures-section { grid-template-columns: repeat(4, 1fr); gap: 15px; }
    .sig-line { height: 45px; }
    body { background: white; }
    /* Cert modal print support */
    #certModal { position: static !important; overflow: visible !important; background: white !important; padding: 0 !important; }
    #certModal .cert-container { max-width: 100% !important; margin: 0 !important; }
    #certModal .cert-buttons { display: none !important; }
}