/* Header v4 — شريط عصري + قوائم منسدلة للمراحل */
:root {
    --np-header-h: 52px;
    --np-gov-strip-h: 44px;
    --hdr-prep: #14b8a6;
    --hdr-primary: #06b6d4;
    --hdr-thanwya: #8b5cf6;
    --hdr-azhar: #f59e0b;
}

.np-header-v4,
#npHeader {
    z-index: 220;
    overflow: visible;
    direction: rtl;
    text-align: right;
    background: linear-gradient(180deg, #0a0f1a 0%, #0f172a 55%, #111827 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 10px 30px rgba(2, 6, 23, .35);
}
#npHeader.np-header-v4--sticky,
.np-header-v4.np-header-v4--sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
}
#npHeader.np-header-v4--static,
.np-header-v4.np-header-v4--static {
    position: relative;
}
#npHeader.is-pinned,
.np-header-v4.is-pinned {
    box-shadow: 0 14px 40px rgba(2, 6, 23, .48);
    border-bottom-color: rgba(255, 255, 255, .1);
}
.np-header-spacer {
    display: block;
    height: var(--np-header-h, 58px);
    width: 100%;
    pointer-events: none;
    flex-shrink: 0;
}
.np-header-v4.is-hidden,
#npHeader.is-hidden {
    transform: none;
    pointer-events: auto;
}
.np-header-v4__glow {
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--hdr-prep) 0%, var(--hdr-thanwya) 50%, var(--hdr-azhar) 100%);
    opacity: .95;
    pointer-events: none;
}
.np-header-v4__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    height: var(--np-header-h);
    min-height: var(--np-header-h);
    max-height: var(--np-header-h);
    direction: rtl;
    overflow: visible;
}
.np-header-v4__brand {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 0 1 auto;
    text-decoration: none;
    color: #f8fafc;
}
.np-header-v4__brand:hover { text-decoration: none; opacity: .96; }
.np-header-v4__logo {
    display: block;
    width: 132px;
    height: 32px;
    max-width: min(132px, 42vw);
    max-height: 32px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
}
.np-header-v4__logo-fallback {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #fff;
    background: linear-gradient(145deg, #1e293b, #0d9488);
    border: 1px solid rgba(255, 255, 255, .12);
    flex-shrink: 0;
}
.np-header-v4__site {
    font-size: .82rem;
    font-weight: 900;
    line-height: 1.2;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-header-v4__nav {
    flex: 1;
    min-width: 0;
    display: none;
    justify-content: center;
    padding-inline: 4px;
    overflow: visible;
}
.np-header-v4__nav--desktop { display: none; }

.np-header-v4__groups {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    overflow: visible;
}
.np-header-v4__group {
    position: relative;
    border-radius: 10px;
    transition: background .18s ease;
}
.np-header-v4__group-head {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 1px 2px 1px 1px;
}
.np-header-v4__group-main {
    display: inline-flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.2;
    color: rgba(248, 250, 252, .88);
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}
.np-header-v4__group-main:hover {
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}
.np-header-v4__group-chev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: rgba(248, 250, 252, .55);
    font-size: .62rem;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .2s ease;
    flex-shrink: 0;
}
.np-header-v4__group-drop-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.np-header-v4__group-drop-wrap:hover .np-header-v4__group-chev,
.np-header-v4__group-drop-wrap:focus-within .np-header-v4__group-chev {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    transform: rotate(180deg);
}
.np-header-v4__group.is-active .np-header-v4__group-drop-wrap:hover .np-header-v4__group-chev,
.np-header-v4__group.is-active .np-header-v4__group-drop-wrap:focus-within .np-header-v4__group-chev {
    color: color-mix(in srgb, var(--group-accent, var(--hdr-prep)) 80%, #0f172a);
    background: color-mix(in srgb, var(--group-accent, var(--hdr-prep)) 12%, #fff);
}

.np-header-v4__group.is-active {
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 4px 14px rgba(2, 6, 23, .22);
}
.np-header-v4__group.is-active .np-header-v4__group-main {
    color: color-mix(in srgb, var(--group-accent, var(--hdr-prep)) 75%, #0f172a);
}
.np-header-v4__group.is-active .np-header-v4__group-main.is-active {
    font-weight: 900;
}
.np-header-v4__group.is-active .np-header-v4__group-chev {
    color: color-mix(in srgb, var(--group-accent, var(--hdr-prep)) 70%, #0f172a);
}

.np-header-v4__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: auto;
    transform: translateY(6px);
    min-width: 210px;
    padding: 6px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 14px 40px rgba(2, 6, 23, .28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 300;
}
.np-header-v4__dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid rgba(15, 23, 42, .06);
    border-top: 1px solid rgba(15, 23, 42, .06);
    rotate: 45deg;
}
.np-header-v4__group-drop-wrap:hover .np-header-v4__dropdown,
.np-header-v4__group-drop-wrap:focus-within .np-header-v4__dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.np-header-v4__drop-item {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
    color: #334155;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.np-header-v4__drop-item:hover {
    text-decoration: none;
    color: #0f172a;
    background: #f1f5f9;
}
.np-header-v4__drop-item.is-active {
    color: color-mix(in srgb, var(--group-accent, var(--hdr-prep)) 85%, #0f172a);
    background: color-mix(in srgb, var(--group-accent, var(--hdr-prep)) 12%, #fff);
    font-weight: 800;
}

.np-header-v4__tools {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.np-header-v4__year {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    color: #e2e8f0;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    line-height: 1;
}
.np-header-v4__menu {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    color: #f8fafc;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .18s ease, border-color .18s ease;
}
.np-header-v4__menu:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
}
.np-header-v4__menu-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
}
.np-header-v4__menu-bars i {
    display: block;
    height: 2px;
    background: #f8fafc;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.np-header-v4__menu-bars i:nth-child(2) { width: 70%; margin-inline-start: auto; }
body.np-drawer-open .np-header-v4__menu-bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.np-drawer-open .np-header-v4__menu-bars i:nth-child(2) { opacity: 0; }
body.np-drawer-open .np-header-v4__menu-bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.np-header-v4__countries {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.np-header-v4__countries-inline {
    display: none;
}
.np-header-v4__country-picker {
    position: relative;
    display: block;
    flex-shrink: 0;
}
.np-header-country-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .07);
    color: #f8fafc;
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    transition: background .18s ease, border-color .18s ease;
}
.np-header-country-picker-btn:hover,
.np-header-v4__country-picker.is-open .np-header-country-picker-btn {
    background: color-mix(in srgb, var(--country-accent, #14b8a6) 22%, rgba(255, 255, 255, .08));
    border-color: color-mix(in srgb, var(--country-accent, #14b8a6) 45%, transparent);
}
.np-header-country-picker-flag { font-size: 1.05rem; line-height: 1; }
.np-header-country-picker-label { white-space: nowrap; max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
.np-header-country-picker-chev {
    font-size: .58rem;
    opacity: .75;
    transition: transform .2s ease;
}
.np-header-v4__country-picker.is-open .np-header-country-picker-chev {
    transform: rotate(180deg);
}
.np-header-country-picker-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 196px;
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 18px 44px rgba(2, 6, 23, .32);
    z-index: 320;
}
.np-header-country-picker-menu-head {
    padding: 6px 10px 8px;
    font-size: .68rem;
    font-weight: 900;
    color: #64748b;
    letter-spacing: .02em;
}
.np-header-country-picker-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.np-header-country-picker-item-text strong {
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.2;
}
.np-header-country-picker-item-text em {
    font-size: .65rem;
    font-weight: 700;
    color: #94a3b8;
    font-style: normal;
}
.np-header-country-picker-menu[hidden] { display: none; }
.np-header-country-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.np-header-country-picker-item:hover {
    text-decoration: none;
    color: #0f172a;
    background: #f1f5f9;
}
.np-header-country-picker-item.is-active {
    color: color-mix(in srgb, var(--country-accent, #14b8a6) 85%, #0f172a);
    background: color-mix(in srgb, var(--country-accent, #14b8a6) 12%, #fff);
    font-weight: 800;
}
.np-header-country-picker-item-flag { font-size: 1rem; line-height: 1; }
.np-header-country-picker-check {
    margin-inline-start: auto;
    font-size: .7rem;
    opacity: .85;
}
.np-header-country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    color: rgba(248, 250, 252, .82);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.np-header-country:hover {
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, .12);
}
.np-header-country.is-active {
    color: #fff;
    background: color-mix(in srgb, var(--country-accent, #14b8a6) 28%, rgba(15, 23, 42, .9));
    border-color: color-mix(in srgb, var(--country-accent, #14b8a6) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--country-accent, #14b8a6) 35%, transparent);
}
.np-header-country__flag { font-size: 1rem; line-height: 1; }
.np-header-country__label { white-space: nowrap; }

@media (max-width: 1024px) {
    .np-header-v4__inner {
        gap: 5px;
        justify-content: space-between;
    }
    .np-header-v4__nav--desktop { display: none !important; }
    .np-header-v4__year--desktop { display: none !important; }
    .np-header-v4__menu-label { display: none; }
    .np-header-v4__menu {
        padding: 6px 8px;
        border-radius: 10px;
        min-width: 36px;
        justify-content: center;
    }
    .np-header-v4__brand {
        flex: 0 1 auto;
        min-width: 0;
        gap: 5px;
    }
    .np-header-v4__countries-inline { display: none; }
    .np-header-v4__country-picker { display: block; }
    .np-header-v4__tools {
        flex-shrink: 0;
        gap: 5px;
    }
    .np-header-country-picker-label { max-width: 56px; }
}

@media (min-width: 1025px) {
    .np-header-v4__inner.np-wrap,
    .np-gov-strip__shell.np-wrap {
        max-width: var(--np-max, 1200px);
        width: 100%;
        margin-inline: auto;
        padding-inline: max(var(--np-gutter, 16px), env(safe-area-inset-right, 0px)) max(var(--np-gutter, 16px), env(safe-area-inset-left, 0px));
        box-sizing: border-box;
    }
    .np-header-v4__nav--desktop {
        display: flex;
        flex: 1;
        min-width: 0;
        padding-inline: 5px;
    }
    .np-header-v4__country-picker { display: block; }
    .np-header-v4__brand {
        flex-shrink: 0;
        gap: 5px;
    }
}

@media (min-width: 769px) {
    #npHeader.is-hidden,
    .np-header-v4.is-hidden {
        transform: none;
        pointer-events: auto;
    }
}
