/* ============================================
   common.css — أنماط مشتركة بين كل صفحات الموقع
   (المتغيرات، القوالب العامة، البطاقات، الأزرار)
   ============================================ */

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

:root {
    --bg: #0c0b09;
    --bg2: #13120e;
    --bg3: #1a1812;
    --gold: #c9a84c;
    --gold-light: #e8c97a;
    --gold-pale: #f0dfa0;
    --cream: #f5f0e8;
    --text: #e8e0d0;
    --text-muted: #9a8f7a;
    --border: rgba(201,168,76,0.18);
    --border-hover: rgba(201,168,76,0.45);
    --glow: rgba(201,168,76,0.12);
    --danger: #c96a4c;
}

body {
    font-family: 'Noto Naskh Arabic', serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Top bar (مشترك في كل الصفحات الداخلية) ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(12,11,9,0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.back-link:hover { color: var(--gold-pale); }
.back-link svg { width: 18px; height: 18px; fill: currentColor; }

.topbar-title {
    font-family: 'Amiri', serif;
    font-size: 1.15rem;
    color: var(--gold-pale);
    font-weight: 700;
}

/* ── تخطيط الصفحة ── */
.page {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    padding: 2rem 1.2rem 4rem;
}

/* ── عنوان القسم ── */
.section-heading {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeDown 0.7s ease both;
}

.ornament {
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.4rem;
    opacity: 0.5;
}

.section-heading h2 {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: var(--cream);
    margin: 0.5rem 0;
}

.section-heading .sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── حالات التحميل / عدم وجود نتائج ── */
.loading, .no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.spinner {
    width: 30px; height: 30px;
    border: 2px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

/* ── بطاقة حديث (مشتركة بين أساس وحديث) ── */
.hadith-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-right: 3px solid var(--gold);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 0.8rem;
    transition: border-color 0.25s;
}
.hadith-card:hover { border-color: var(--border-hover); border-right-color: var(--gold-light); }
.hadith-text { font-size: 0.97rem; line-height: 1.9; color: var(--text); margin-bottom: 0.7rem; }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}
.hadith-label, .source-label { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

/* ── بطاقة مصدر (مشتركة بين أساس ومصدر) ── */
.source-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-right: 3px solid var(--gold);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
}
.source-link {
    color: #87CEEB;
    text-decoration: none;
    font-size: 0.92rem;
    display: block;
    margin-bottom: 0.6rem;
    word-break: break-all;
    transition: color 0.2s;
}
.source-link:hover { color: #b8e4f5; text-decoration: underline; }

/* ── زر النسخ (مشترك في كل مكان فيه نسخ) ── */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'Noto Naskh Arabic', serif;
    cursor: pointer;
    transition: all 0.25s;
    flex-shrink: 0;
    white-space: nowrap;
}
.copy-btn:hover { border-color: var(--border-hover); color: var(--gold-pale); }
.copy-btn svg { width: 13px; height: 13px; fill: currentColor; }
.copy-btn.copied { border-color: var(--gold); color: var(--gold-pale); }

/* ── الحركات (Animations) ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
