/* Mudawi - Heritage & Horizon Design System v2 */
:root {
    --surface: #f8f9ff;
    --surface-dim: #cbdbf5;
    --surface-bright: #f8f9ff;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #eff4ff;
    --surface-container: #e5eeff;
    --surface-container-high: #dce9ff;
    --surface-container-highest: #d3e4fe;
    --on-surface: #0b1c30;
    --on-surface-variant: #45464d;
    --inverse-surface: #213145;
    --inverse-on-surface: #eaf1ff;
    --outline: #76777d;
    --outline-variant: #c6c6cd;
    --surface-tint: #565e74;
    --primary: #000000;
    --on-primary: #ffffff;
    --primary-container: #131b2e;
    --on-primary-container: #7c839b;
    --inverse-primary: #bec6e0;
    --secondary: #0058be;
    --on-secondary: #ffffff;
    --secondary-container: #2170e4;
    --on-secondary-container: #fefcff;
    --secondary-fixed: #d8e2ff;
    --secondary-fixed-dim: #adc6ff;
    --on-secondary-fixed: #001a42;
    --on-secondary-fixed-variant: #004395;
    --tertiary: #000000;
    --on-tertiary: #ffffff;
    --tertiary-container: #2a1700;
    --on-tertiary-container: #b87500;
    --error: #ba1a1a;
    --on-error: #ffffff;
    --error-container: #ffdad6;
    --on-error-container: #93000a;
    --background: #f8f9ff;
    --on-background: #0b1c30;
    --surface-variant: #d3e4fe;
    /* Gradient accents */
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2170e4 100%);
    --gradient-card: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #2170e4 100%);
    --gradient-accent: linear-gradient(135deg, #2170e4 0%, #0058be 100%);
}

body {
    background-color: var(--background);
    color: var(--on-background);
    font-family: 'Cairo', sans-serif;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

.font-cairo { font-family: 'Cairo', sans-serif; }
.font-notoSerif { font-family: 'Noto Serif', serif; }
.font-article-body { font-family: 'Cairo', sans-serif; font-size: 18px; line-height: 1.9; }
.font-ui-label { font-family: 'Cairo', sans-serif; font-size: 14px; line-height: 20px; font-weight: 500; }

.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

.bg-background { background-color: var(--background); }
.bg-surface { background-color: var(--surface); }
.bg-surface-container { background-color: var(--surface-container); }
.bg-surface-container-low { background-color: var(--surface-container-low); }
.bg-surface-container-lowest { background-color: var(--surface-container-lowest); }
.bg-surface-container-high { background-color: var(--surface-container-high); }
.bg-surface-variant { background-color: var(--surface-variant); }
.bg-secondary-container { background-color: var(--secondary-container); }

.text-on-background { color: var(--on-background); }
.text-on-surface { color: var(--on-surface); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-on-secondary { color: var(--on-secondary); }
.text-on-secondary-container { color: var(--on-secondary-container); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-secondary-container { color: var(--secondary-container); }
.text-outline { color: var(--outline); }

.border-outline-variant { border-color: var(--outline-variant); }
.border-secondary-container { border-color: var(--secondary-container); }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

@media (max-width: 768px) {
    .font-article-body { font-size: 16px; }
}
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Article Content Styles */
.article-content {
    direction: rtl;
    text-align: right;
}

.article-content .article-lead {
    font-size: 1.2rem;
    line-height: 2.2;
    color: var(--on-surface-variant);
    font-weight: 500;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--outline-variant);
    position: relative;
}

.article-content .article-lead::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 80px;
    height: 2px;
    background: var(--gradient-accent);
}

.article-content .article-heading {
    font-family: 'Cairo', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--on-background);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-container);
    display: inline-block;
}

.article-content .article-body {
    font-size: 1.05rem;
    line-height: 2.2;
    color: var(--on-surface);
    margin-bottom: 1rem;
    text-indent: 2rem;
}

.article-content .article-body:first-of-type {
    text-indent: 0;
}

.article-content .article-point {
    font-size: 1rem;
    line-height: 2;
    color: var(--on-surface);
    margin-bottom: 0.75rem;
    padding-right: 1.5rem;
    position: relative;
    background: linear-gradient(to left, rgba(33, 112, 228, 0.04), transparent);
    border-radius: 0 8px 8px 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
}

.article-content .article-point::before {
    content: '◆';
    position: absolute;
    right: 0;
    color: var(--secondary-container);
    font-size: 0.7rem;
    top: 0.75rem;
}

.article-content .article-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem 0;
}

.article-content .article-list li {
    font-size: 1rem;
    line-height: 2;
    color: var(--on-surface);
    padding-right: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.article-content .article-list li::before {
    content: '●';
    position: absolute;
    right: 0;
    color: var(--secondary-container);
    font-size: 0.6rem;
    top: 0.55rem;
}

.article-content .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--outline-variant);
}

.article-content .article-tags .tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--gradient-accent);
    color: white;
    border-radius: 2rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.article-content h3.article-heading + p.article-body {
    text-indent: 0;
}

.article-content a {
    color: var(--secondary-container);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: var(--secondary);
}

.article-content em {
    font-style: italic;
    color: var(--on-surface-variant);
}

@media (max-width: 768px) {
    .article-content .article-lead {
        font-size: 1.05rem;
    }
    .article-content .article-heading {
        font-size: 1.2rem;
    }
    .article-content .article-body {
        font-size: 0.95rem;
    }
    .article-content .article-point {
        font-size: 0.9rem;
    }
}

/* ===== Hero Section ===== */
.hero-section {
    background: var(--gradient-hero);
    position: relative;
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Profile Hero ===== */
.profile-hero {
    background: var(--gradient-hero);
    position: relative;
}

.profile-hero .hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* ===== Card Design ===== */
.person-card {
    animation: fadeInUp 0.6s ease-out both;
}

.person-card:nth-child(1) { animation-delay: 0.03s; }
.person-card:nth-child(2) { animation-delay: 0.06s; }
.person-card:nth-child(3) { animation-delay: 0.09s; }
.person-card:nth-child(4) { animation-delay: 0.12s; }
.person-card:nth-child(5) { animation-delay: 0.15s; }
.person-card:nth-child(6) { animation-delay: 0.18s; }
.person-card:nth-child(7) { animation-delay: 0.21s; }
.person-card:nth-child(8) { animation-delay: 0.24s; }
.person-card:nth-child(n+9) { animation-delay: 0.27s; }

.card-inner {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.person-card:hover .card-inner {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(33, 112, 228, 0.15);
}

.card-image-wrapper {
    position: relative;
    overflow: hidden;
}

.card-overlay {
    transition: opacity 0.4s ease;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(33, 112, 228, 0); }
    50% { box-shadow: 0 0 20px 4px rgba(33, 112, 228, 0.15); }
}

/* Header Animation */
header {
    animation: fadeIn 0.5s ease-out;
}

/* Search Animation */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

/* Article Content Animation */
.article-content {
    animation: fadeInUp 0.8s ease-out;
}

.article-content .article-lead {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.article-content .article-heading {
    animation: slideInRight 0.5s ease-out both;
}

.article-content .article-body {
    animation: fadeIn 0.5s ease-out both;
}

.article-content .article-tags .tag {
    animation: scaleIn 0.3s ease-out both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-content .article-tags .tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 112, 228, 0.25);
}

/* Profile Hero Animation */
.profile-hero {
    animation: fadeInUp 0.6s ease-out;
}

/* Back Button Animation */
.back-btn {
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateX(-4px);
}

/* Footer Animation */
footer {
    animation: fadeIn 0.8s ease-out 0.3s both;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}