@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700;800&family=Changa:wght@600;700&display=swap');

:root {
    --primary-color: #00a59e;
    --primary-dark: #05615f;
    --primary-soft: #e7faf8;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --bg: #f5f8fb;
    --shadow: 0 18px 45px rgba(15, 23, 42, .10);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(0,165,158,.10), transparent 32rem),
        linear-gradient(180deg, #f8fbfd 0%, #eef4f8 100%);
    color: var(--ink);
    line-height: 1.8;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Changa', 'IBM Plex Sans Arabic', sans-serif;
    color: var(--ink);
}

a { color: inherit; }

.text-primary-custom { color: var(--primary-color) !important; }
.text-primary-dark-custom { color: var(--primary-dark) !important; }
.text-heading-custom { color: var(--ink) !important; }
.bg-secondary-custom { background: var(--primary-soft) !important; }

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    border: 0 !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(0, 165, 158, .25);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 165, 158, .32);
}

.btn-outline-primary-custom {
    border: 1px solid rgba(0,165,158,.35) !important;
    color: var(--primary-dark) !important;
    background: #fff !important;
}

.btn-outline-primary-custom:hover {
    background: var(--primary-soft) !important;
    transform: translateY(-1px);
}

.qb-navbar {
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226,232,240,.8);
}

.qb-brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: var(--ink) !important;
    text-decoration: none;
}

.qb-brand strong { display: block; line-height: 1.1; }
.qb-brand small { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }

.brand-mark, .footer-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(0,165,158,.28);
}

.navbar-nav .nav-link {
    color: var(--ink);
    font-weight: 700;
    margin-inline: .35rem;
    border-radius: 999px;
    padding: .55rem .95rem !important;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--primary-dark) !important;
    background: var(--primary-soft);
}

.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 620px;
    padding: 110px 0 95px;
    background:
        linear-gradient(135deg, rgba(6, 31, 45, .98), rgba(0, 106, 102, .95)),
        radial-gradient(circle at top left, rgba(255,255,255,.22), transparent 27rem);
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: auto 0 -1px 0;
    height: 90px;
    background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .45;
    background: rgba(255,255,255,.18);
}
.hero-orb-1 { width: 280px; height: 280px; top: -80px; left: 8%; }
.hero-orb-2 { width: 180px; height: 180px; bottom: 80px; right: 12%; }

.hero-badge, .section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.14);
    color: #fff;
    border-radius: 999px;
    padding: .45rem .9rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-kicker {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: rgba(0,165,158,.18);
}

.hero-title {
    color: #fff;
    font-size: clamp(2.4rem, 4vw, 4.5rem);
    line-height: 1.25;
    letter-spacing: -.04em;
    margin-bottom: 1rem;
}

.hero-text {
    color: rgba(255,255,255,.78);
    font-size: 1.22rem;
    max-width: 720px;
}

.hero-panel {
    position: relative;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 32px;
    padding: 1.35rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 28px 70px rgba(0,0,0,.22);
}

.hero-panel-header {
    display: flex;
    gap: .45rem;
    margin-bottom: 1.5rem;
}

.hero-panel-header span {
    width: .75rem;
    height: .75rem;
    background: rgba(255,255,255,.45);
    border-radius: 50%;
}

.metric-card {
    background: #fff;
    border-radius: 24px;
    padding: 1.3rem;
    margin-bottom: 1rem;
    color: var(--ink);
}
.metric-card small { color: var(--muted); display: block; }
.metric-card strong { font-size: 3rem; color: var(--primary-dark); }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.metric-grid div {
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 1rem;
    color: #fff;
}
.metric-grid strong { display: block; font-size: 1.5rem; }
.metric-grid span { color: rgba(255,255,255,.75); font-size: .9rem; }

.hero-line { height: .85rem; background: rgba(255,255,255,.18); border-radius: 999px; margin-top: 1.2rem; }
.hero-line.short { width: 70%; }
.hero-line.tiny { width: 45%; }

.section-title { text-align: center; max-width: 760px; margin: 0 auto 2rem; }
.section-title h2 { font-size: clamp(2rem, 3vw, 3rem); margin: .6rem 0; }
.section-title p { color: var(--muted); font-size: 1.1rem; }

.blog-filter-card, .content-card, .single-post-content, .empty-card, .loader-card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
}

.blog-filter-card { padding: 1rem; }
.loader-card, .empty-card { padding: 3rem; text-align: center; color: var(--muted); }
.empty-card i { font-size: 3rem; color: var(--primary-color); }

.search-box { position: relative; }
.search-box i {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--muted);
}
.search-box .form-control { padding-right: 2.8rem; }

.form-control, .form-select {
    border-color: var(--line);
    border-radius: 18px;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(0,165,158,.45);
}

.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--surface);
    border: 1px solid rgba(226,232,240,.85);
    border-radius: 28px;
    padding: 1.45rem;
    box-shadow: var(--shadow-soft);
    transition: .25s ease;
}
.blog-card:hover { transform: translateY(-7px); box-shadow: var(--shadow); }
.blog-card-top, .blog-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.post-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid rgba(0,165,158,.18);
    border-radius: 999px;
    padding: .4rem .85rem;
    font-weight: 800;
    font-size: .88rem;
}
.read-time { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.blog-card-title { font-size: 1.25rem; line-height: 1.65; margin: 1.1rem 0 .8rem; }
.blog-card-title a { text-decoration: none; }
.blog-card-title a:hover { color: var(--primary-dark); }
.blog-card-excerpt { color: var(--muted); flex: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1.2rem; }
.tag-row span, .post-tags span {
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .82rem;
}
.read-more { color: var(--primary-dark); font-weight: 800; text-decoration: none; }

.page-shell { padding-top: 4rem; padding-bottom: 4rem; }
.content-card { padding: 1.5rem; }

.post-page { padding-bottom: 4rem; }
.post-hero {
    position: relative;
    padding: 5rem 0 7rem;
    background: linear-gradient(135deg, #062236, #08756f);
    text-align: center;
    color: #fff;
    overflow: hidden;
}
.post-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 4rem); max-width: 980px; margin: 0 auto 1rem; line-height: 1.35; }
.post-hero p { max-width: 840px; margin: 0 auto 1.5rem; color: rgba(255,255,255,.78); font-size: 1.1rem; }
.post-meta-pill {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .8rem 1.4rem;
    padding: .85rem 1.2rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
}
.single-post-content {
    max-width: 950px;
    margin: -4rem auto 0;
    position: relative;
    padding: clamp(1.3rem, 4vw, 3.2rem);
}
.post-body { font-size: 1.13rem; color: #263548; }
.post-body p { margin-bottom: 1.45em; line-height: 2.05; }
.post-body h2, .post-body h3, .post-body h4 {
    color: var(--primary-dark);
    margin-top: 2.4rem;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--line);
}
.post-body ul, .post-body ol { padding-right: 1.5rem; margin-bottom: 1.6rem; }
.post-body li { margin-bottom: .65rem; }
.post-body blockquote {
    background: var(--primary-soft);
    border-right: 6px solid var(--primary-color);
    padding: 1.25rem 1.4rem;
    border-radius: 18px;
    color: var(--primary-dark);
}
.post-tags { display: flex; flex-wrap: wrap; gap: .6rem; }

.admin-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary-dark), #061f2d);
    color: #fff;
    border-radius: 30px;
    padding: 1.6rem;
    box-shadow: var(--shadow);
}
.admin-hero h1, .admin-hero .section-kicker { color: #fff; }
.admin-hero .section-kicker { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }
.admin-post-list { max-height: 720px; overflow-y: auto; }
.admin-post-list .list-group-item {
    border: 1px solid var(--line);
    border-radius: 16px !important;
    margin-bottom: .65rem;
}
.admin-post-list .list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: transparent;
}
.count-pill {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: .25rem .7rem;
    font-weight: 800;
}
.editor-card label { font-weight: 800; color: #334155; }
.ltr-code { direction: ltr; text-align: left; font-family: Consolas, monospace; }
.html-editor { min-height: 420px; }

.qb-footer {
    background:
        radial-gradient(circle at 20% 20%, rgba(0,165,158,.25), transparent 18rem),
        linear-gradient(135deg, #061f2d, #0f172a);
}
.footer-link-custom {
    display: inline-block;
    color: rgba(255,255,255,.74);
    text-decoration: none;
    margin-inline: .6rem;
}
.footer-link-custom:hover { color: #fff; }

.quantum-loader {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: .7rem;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
}
.loader-logo {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    box-shadow: var(--shadow);
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

@media (max-width: 767px) {
    .hero-section { min-height: auto; padding: 72px 0 64px; }
    .hero-panel { margin-top: 1rem; }
    .post-meta-pill { border-radius: 22px; }
    .single-post-content { margin-top: -3rem; }
}
