/*
Theme Name: Ruqya Center
Theme URI: https://ruqyacenter.com
Description: موقع مركز الرقية بكلام الرحمن — تصميم مخصص مع دعم RTL وربط Supabase.
Version: 2.1.0
Author: Ruqya Center Dev
Text Domain: ruqya
Requires at least: 6.4
Requires PHP: 8.1
*/

/* ═══════════════════════════════════════════════════
   Design System — مركز الرقية بكلام الرحمن
   Ported from the Next.js globals.css
   ═══════════════════════════════════════════════════ */

:root {
    /* Primary Colors — Green */
    --green: #1a5c2a;
    --green-light: #2d7a3e;
    --green-dark: #0f3d1a;

    /* Accent Colors — Gold */
    --gold: #c5a028;
    --gold-light: #d4b84a;
    --gold-dark: #a88820;

    /* Secondary — Teal */
    --teal: #1a3a4a;

    /* Background */
    --bg: #f7f5f0;
    --bg-card: #ffffff;

    /* Text */
    --text: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Borders */
    --border: #e5e2d9;
    --border-light: #f0ede6;

    /* Status */
    --success: #16a34a;
    --warning: #f59e0b;
    --error: #dc2626;
    --info: #2563eb;

    /* Shadows */
    --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="ltr"] body {
    direction: ltr;
}

a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--green-light); }
img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--green); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Container ────────────────────────────────────── */
.container { width: min(1200px, calc(100% - 32px)); margin-inline: auto; padding-inline: 16px; }
.container-sm { width: min(800px, calc(100% - 32px)); margin-inline: auto; padding-inline: 16px; }
.container-lg { width: min(1400px, calc(100% - 32px)); margin-inline: auto; padding-inline: 16px; }

/* ── Typography ───────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); line-height: 1.3; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}
.btn-primary:hover {
    background: var(--green-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-accent {
    background: var(--gold);
    color: #fff;
}
.btn-accent:hover {
    background: var(--gold-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-ghost {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--green);
    color: var(--green);
}

.btn-sm { padding: 8px 16px; font-size: 0.875rem; border-radius: 8px; }
.btn-lg { padding: 16px 36px; font-size: 1.125rem; border-radius: 14px; }

.btn:disabled, .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* ── Cards ────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(26, 92, 42, 0.2);
}

/* ── Icon Box ─────────────────────────────────────── */
.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.icon-box-green { background: rgba(26, 92, 42, 0.1); color: var(--green); }
.icon-box-gold { background: rgba(197, 160, 40, 0.1); color: var(--gold-dark); }

.card:hover .icon-box-green { background: var(--green); color: #fff; }
.card:hover .icon-box-gold { background: var(--gold); color: #fff; }

/* ── Gradients ────────────────────────────────────── */
.gradient-hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 40%, var(--teal) 100%);
}
.gradient-primary { background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%); }
.gradient-accent { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); }

.text-gradient {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
}

/* ── Badge ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-gold { background: rgba(197, 160, 40, 0.12); color: var(--gold-dark); }

/* ── Grid helpers ─────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Sections ─────────────────────────────────────── */
.section { padding: 72px 0; }
.section-white { background: #fff; }
.section-heading { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-heading h2 { margin-bottom: 12px; }
.section-heading p { color: var(--text-secondary); font-size: 1.05rem; }

@media (max-width: 768px) {
    .section { padding: 50px 0; }
}

/* ── Header ───────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--green-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.site-logo img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.main-nav { 
    display: flex; 
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}
.main-nav ul { display: flex; gap: 4px; list-style: none; }
.main-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
    color: var(--green);
    background: rgba(26, 92, 42, 0.06);
}

.header-cta .btn { 
    padding: 10px 22px; 
    font-size: 0.9rem; 
    white-space: nowrap;
}
.lang-toggle {
    white-space: nowrap;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
}
.mobile-menu-btn svg { width: 24px; height: 24px; }

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
}

.mobile-nav-inner {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-nav.active { display: block; }
.mobile-nav.active .mobile-nav-inner { transform: translateX(0); }

.mobile-nav-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s;
}
.mobile-nav a:hover { background: rgba(26, 92, 42, 0.06); color: var(--green); }

@media (max-width: 1024px) {
    .main-nav, .header-cta { display: none; }
    .mobile-menu-btn { display: block; }
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
    position: relative;
    color: #fff;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 80px 16px 100px;
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.25; margin-bottom: 16px; color: #fff; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.1rem; max-width: 650px; margin: 0 auto 32px; line-height: 1.8; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 48px auto 0;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat-val { font-size: 1.8rem; font-weight: 700; color: var(--gold); }
.hero-stats .stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); margin-top: 4px; }

.hero-blur {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    pointer-events: none;
}

/* Wave separator */
.wave-sep {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    line-height: 0;
}
.wave-sep svg { display: block; width: 100%; }

/* ── FAQ Accordion ────────────────────────────────── */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    list-style: none;
    transition: background 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: rgba(0,0,0,0.02); }

.faq-item summary::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-right: 16px;
}
.faq-item[open] summary::after { transform: rotate(180deg); }

.faq-answer {
    padding: 0 20px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
    background: var(--teal);
    color: rgba(255,255,255,0.85);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-about h3 { color: #fff; margin-bottom: 12px; }
.footer-about p { font-size: 0.9rem; line-height: 1.8; color: rgba(255,255,255,0.7); }

.footer-links h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }

.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.2s;
}
.footer-social a:hover { background: var(--gold); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ── Forms ────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group label .required { color: var(--error); }

.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: all 0.2s;
    color: var(--text);
}
.form-control:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(26, 92, 42, 0.12);
}
.form-control::placeholder { color: var(--text-muted); }

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

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ── Stepper ──────────────────────────────────────── */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 32px;
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    transition: all 0.3s;
}

.stepper-step.active { color: var(--green); background: rgba(26, 92, 42, 0.08); }
.stepper-step.completed { color: var(--success); }

.stepper-step .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.stepper-step.active .step-num { background: var(--green); color: #fff; }
.stepper-step.completed .step-num { background: var(--success); color: #fff; }

.stepper-line {
    width: 24px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .stepper { flex-wrap: wrap; gap: 8px; }
    .stepper-step span:not(.step-num) { display: none; }
    .stepper-line { width: 16px; }
}

/* ── Breadcrumbs ──────────────────────────────────── */
.breadcrumbs { margin-bottom: 24px; }
.breadcrumbs ol { display: flex; gap: 8px; list-style: none; align-items: center; }
.breadcrumbs li::after { content: '/'; color: var(--text-muted); margin-right: 8px; }
.breadcrumbs li:last-child::after { display: none; }
.breadcrumbs a { color: var(--text-secondary); font-size: 0.85rem; }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumb-current { color: var(--text); font-size: 0.85rem; font-weight: 600; }

/* ── Page Hero (inner pages) ──────────────────────── */
.page-hero {
    padding: 48px 0 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: #fff;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 12px; color: #fff; }
.page-hero p { color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

/* ── Article cards ────────────────────────────────── */
.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s;
}
.article-card:hover { box-shadow: var(--shadow-hover); }
.article-card-img { width: 100%; height: 200px; object-fit: cover; }
.article-card-body { padding: 20px; }
.article-card-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.article-card-body p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.article-card-meta { display: flex; gap: 12px; margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); }

/* ── Animations ───────────────────────────────────── */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scale-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.animate-fade-in { animation: fade-in 0.6s ease-out; }
.animate-slide-up { animation: slide-up 0.6s ease-out; }

/* ── Utility ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-gold { color: var(--gold); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }
.text-lg { font-size: 1.125rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* ── Prose (article content) ──────────────────────── */
.prose { line-height: 1.9; color: var(--text); }
.prose p { margin-bottom: 1em; }
.prose h2 { margin: 1.5em 0 0.5em; }
.prose h3 { margin: 1.2em 0 0.4em; }
.prose ul, .prose ol { padding-inline-start: 1.5em; margin-bottom: 1em; }
.prose blockquote { border-inline-start: 3px solid var(--green); padding-inline-start: 1em; margin: 1em 0; color: var(--text-secondary); }
.prose img { max-width: 100% !important; height: auto !important; border-radius: 12px; margin: 1em 0; }
.prose iframe, .prose video { max-width: 100% !important; width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; border-radius: 12px; }

/* ── iOS fix ──────────────────────────────────────── */
@media screen and (max-width: 768px) {
    input, select, textarea { font-size: 16px !important; }
}

/* ── Notice messages ──────────────────────────────── */
.notice-msg {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}
.notice-success { background: #e9f7ed; color: var(--green-dark); }
.notice-error { background: #fff0ef; color: #a1261d; }

/* ── LTR Header and Spacing Adjustments ── */
html[dir="ltr"] .site-header .container {
    max-width: 1450px;
    width: 95%;
}

html[dir="ltr"] .main-nav ul {
    gap: 4px;
}

html[dir="ltr"] .main-nav a {
    padding: 6px 8px;
    font-size: 0.8rem;
}

html[dir="ltr"] .site-logo {
    font-size: 0.95rem;
}

html[dir="ltr"] .header-inner {
    gap: 12px;
}
