/* =============================================================
   Wazayef — Modern Minimal theme
   ============================================================= */

:root {
    --bg: #ffffff;
    --bg-soft: #f6f6f8;
    --bg-dark: #0b0b0d;
    --ink: #0b0b0d;
    --ink-muted: #6b6f76;
    --border: #e6e6ea;
    --accent: #4f46e5;
    --accent-dark: #3f38c9;
    --accent-soft: #eeedfd;
    --success: #0f9d58;
    --danger: #e0393e;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 24px;
    --shadow: 0 1px 2px rgba(11,11,13,.04), 0 8px 24px rgba(11,11,13,.06);
    --font-ar: 'Tajawal', sans-serif;
    --font-en: 'Inter', sans-serif;
    --header-h: 76px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b0b0d;
        --bg-soft: #151517;
        --ink: #f4f4f5;
        --ink-muted: #9a9aa2;
        --border: #232327;
        --accent-soft: #1a1836;
    }
}

/* Explicit toggle wins over system preference in either direction. */
:root[data-theme="dark"] {
    --bg: #0b0b0d;
    --bg-soft: #151517;
    --ink: #f4f4f5;
    --ink-muted: #9a9aa2;
    --border: #232327;
    --accent-soft: #1a1836;
}
:root[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #f6f6f8;
    --ink: #0b0b0d;
    --ink-muted: #6b6f76;
    --border: #e6e6ea;
    --accent-soft: #eeedfd;
}

body { transition: background-color .2s ease, color .2s ease; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-en);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.lang-ar { font-family: var(--font-ar); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

.container { max-width: 1180px; margin-inline: auto; padding-inline: 24px; }

/* ---------------------------------------------------------------
   Top bar
   --------------------------------------------------------------- */
.topbar {
    position: fixed;
    inset-inline: 0;
    top: 0;
    height: var(--header-h);
    z-index: 40;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1180px;
    margin-inline: auto;
    height: 100%;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.brand-mark {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent); color: #fff; font-weight: 800;
}

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch {
    font-size: .85rem;
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink-muted);
    transition: color .15s, border-color .15s;
}
.lang-switch:hover { color: var(--accent); border-color: var(--accent); }

.icon-btn {
    position: relative;
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    color: var(--ink-muted);
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.post-job-cta { white-space: nowrap; }
@media (max-width: 560px) { .post-job-cta { display: none; } }
.notif-dot {
    position: absolute; top: -2px; inset-inline-end: -2px;
    background: var(--danger); color: #fff;
    font-size: .625rem; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 999px;
    display: grid; place-items: center; padding-inline: 3px;
}

/* Hamburger -> popout trigger */
.menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    cursor: pointer;
}
.menu-toggle span {
    display: block; height: 2px; width: 18px; margin-inline: auto;
    background: var(--ink); border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------
   Popout menu
   --------------------------------------------------------------- */
.site-overlay {
    position: fixed; inset: 0;
    background: rgba(11,11,13,.45);
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
    z-index: 45;
}
.site-overlay.is-visible { opacity: 1; pointer-events: auto; }

.popout-menu {
    position: fixed;
    top: 0; bottom: 0;
    inset-inline-end: 0;
    width: min(380px, 88vw);
    background: var(--bg);
    border-inline-start: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 28px 28px 40px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.16,1,.3,1);
    box-shadow: -20px 0 60px rgba(11,11,13,.12);
}
html[dir="rtl"] .popout-menu { transform: translateX(-100%); }
.popout-menu.is-open { transform: translateX(0); }

.popout-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.popout-close { font-size: 1.8rem; line-height: 1; background: none; border: none; cursor: pointer; color: var(--ink-muted); }

.popout-links li + li { margin-top: 4px; }
.popout-links a {
    display: block;
    padding: 14px 6px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.01em;
    border-radius: var(--radius-sm);
    transition: color .15s, padding-inline-start .15s;
}
.popout-links a:hover { color: var(--accent); padding-inline-start: 14px; }

.popout-divider { height: 1px; background: var(--border); margin: 20px 0; }

.popout-links-auth a { font-size: 1rem; font-weight: 600; color: var(--ink-muted); }
.popout-links-auth a:hover { color: var(--accent); }
.popout-cta { color: var(--accent) !important; }
.popout-admin-link { margin-top: 14px; font-size: .8rem !important; opacity: .6; }

body.menu-open { overflow: hidden; }

/* ---------------------------------------------------------------
   Hero — pinned scroll-scale sections (vanilla GSAP ScrollTrigger)
   --------------------------------------------------------------- */
.hero-scroll {
    position: relative;
    height: 200vh;
    background: var(--bg-dark);
}

.hero-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    will-change: transform;
}

.hero-panel--intro {
    background: radial-gradient(120% 100% at 50% 0%, #f2f2f5, #e4e4ea 70%);
    color: var(--bg-dark);
}
.hero-panel--intro .hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(11,11,13,.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(11,11,13,.06) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
    mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
}

.hero-eyebrow {
    position: relative; z-index: 1;
    display: inline-block;
    font-size: .8rem; font-weight: 700;
    color: var(--accent-dark);
    background: rgba(79,70,229,.1);
    padding: 6px 16px; border-radius: 999px;
    margin-bottom: 22px;
}

.hero-title {
    position: relative; z-index: 1;
    font-size: clamp(2.2rem, 6vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    padding-inline: 20px;
    max-width: 900px;
}
.hero-title span { display: block; }

.hero-subtitle {
    position: relative; z-index: 1;
    max-width: 620px;
    margin: 22px auto 0;
    padding-inline: 20px;
    color: var(--ink-muted);
    font-size: 1.05rem;
}

.hero-actions { position: relative; z-index: 1; display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; justify-content: center; }

.hero-panel--stats {
    background: radial-gradient(120% 100% at 50% 0%, #1a1919, #06060e 70%);
    color: #fff;
}
.hero-panel--stats canvas#heroThreeCanvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: .6;
}
.hero-panel--stats .hero-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
    mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
}

.hero-stats {
    position: relative; z-index: 2;
    display: flex; gap: 56px; flex-wrap: wrap; justify-content: center;
}
.hero-stat-num { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.hero-stat-label { color: rgba(255,255,255,.6); font-size: .9rem; margin-top: 4px; }

.hero-scroll-hint {
    position: absolute; bottom: 28px; inset-inline: 0;
    text-align: center; font-size: .75rem;
    color: var(--ink-muted); z-index: 1;
    animation: bounce 1.8s infinite;
}
@keyframes bounce { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(6px);} }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink-muted); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------------------------------------------------------------
   Sections / cards
   --------------------------------------------------------------- */
section { padding: 80px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-eyebrow { color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; margin: 10px 0 12px; letter-spacing: -.01em; }
.section-text { color: var(--ink-muted); }

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-alt { background: var(--bg-soft); }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.why-card { padding: 26px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.why-icon { font-size: 1.8rem; margin-bottom: 14px; }
.why-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.why-card p { color: var(--ink-muted); font-size: .9rem; margin: 0; }

.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.testimonial-card { padding: 26px; }
.testimonial-card blockquote { margin: 0 0 20px; font-size: 1.02rem; line-height: 1.7; }
.testimonial-card figcaption { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-dark);
    display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}

.reveal { opacity: 0; transform: translateY(24px); }
.reveal.is-visible { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }

.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.job-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.job-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(11,11,13,.1); }
.job-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.job-card-title { font-size: 1.05rem; font-weight: 700; }
.job-card-company { color: var(--ink-muted); font-size: .9rem; margin-top: 2px; }
.job-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
    font-size: .75rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-dark);
}
.tag-muted { background: var(--bg-soft); color: var(--ink-muted); }
.job-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; font-size: .8rem; color: var(--ink-muted); }

.fav-btn {
    border: 1px solid var(--border);
    background: var(--bg);
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    cursor: pointer; color: var(--ink-muted);
    flex-shrink: 0;
}
.fav-btn.is-active { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* ---------------------------------------------------------------
   Job detail page
   --------------------------------------------------------------- */
.breadcrumb { font-size: .85rem; margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--ink); font-weight: 600; }

.job-detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .job-detail-grid { grid-template-columns: 1fr; } }

.job-detail-main { padding: 36px; }

.job-sidebar { position: sticky; top: calc(var(--header-h) + 20px); }
.job-sidebar-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.job-sidebar-company { display: flex; align-items: center; gap: 12px; }
.job-sidebar-row { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.fav-btn-wide { display: flex; }
.share-buttons { display: flex; gap: 6px; justify-content: center; border-top: 1px solid var(--border); padding-top: 14px; }

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
.form-page { max-width: 460px; margin: calc(var(--header-h) + 60px) auto 80px; padding-inline: 20px; }
.form-wide { max-width: 760px; }
.form-card { padding: 36px; }
.form-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.form-sub { color: var(--ink-muted); margin-bottom: 26px; font-size: .9rem; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: .95rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 18px; }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.alert-success { background: color-mix(in srgb, var(--success) 10%, transparent); color: var(--success); }

.filters-bar {
    display: flex; gap: 12px; flex-wrap: wrap;
    padding: 18px; margin-bottom: 32px;
}
.filters-bar input, .filters-bar select { flex: 1; min-width: 160px; }

.status-badge { font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.badge-new { background: #dbeafe; color: #1e40af; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0; background: var(--bg-soft); }
.site-footer-inner { max-width: 1180px; margin-inline: auto; padding-inline: 24px; }
.footer-about { color: var(--ink-muted); max-width: 420px; margin-top: 10px; font-size: .9rem; }
.footer-rights { margin-top: 26px; color: var(--ink-muted); font-size: .8rem; }

/* utility */
.mt-0{margin-top:0} .text-center{text-align:center} .muted{color:var(--ink-muted)}
.page-head { padding: calc(var(--header-h) + 40px) 0 20px; text-align: center; }
