/* ══════════════════════════════════════════════════════════════════
   قضية — هيدر إبداعي مبهر | Detective-Themed Header Redesign
   ══════════════════════════════════════════════════════════════════ */

/* ─── Keyframes ─── */
@keyframes laserSweep {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes headerPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

@keyframes logoPulseRing {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

@keyframes liveBreath {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.5); opacity: 0.5; }
}

@keyframes taglineReveal {
    0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
    100% { clip-path: inset(0 0 0 0); opacity: 1; }
}

@keyframes scanLine {
    0%   { top: 0; }
    100% { top: 100%; }
}

@keyframes glitchText {
    0%, 100% { text-shadow: none; }
    20%      { text-shadow: -2px 0 #e94560, 2px 0 #00d4ff; }
    40%      { text-shadow: 2px 0 #e94560, -2px 0 #00d4ff; }
    60%      { text-shadow: 0 0 4px #e94560; }
}

@keyframes navItemSlide {
    0%   { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes particleDrift {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-60px) rotate(360deg); opacity: 0; }
}

@keyframes hamburgerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.3); }
    50%      { box-shadow: 0 0 0 6px rgba(233, 69, 96, 0); }
}

@keyframes searchScanDown {
    0%   { transform: translateY(-100%); opacity: 0.8; }
    100% { transform: translateY(400%); opacity: 0; }
}

@keyframes badgeBounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.25); }
}

@keyframes profileRingRotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shineSlide {
    0%   { left: -100%; }
    100% { left: 200%; }
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    20%      { transform: rotate(12deg); }
    40%      { transform: rotate(-10deg); }
    60%      { transform: rotate(6deg); }
    80%      { transform: rotate(-4deg); }
}

@keyframes mobileNavReveal {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes caseStripPulse {
    0%, 100% { opacity: 0.5; width: 20px; }
    50%      { opacity: 1; width: 40px; }
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(233, 69, 96, 0.12); }
    50%      { border-color: rgba(233, 69, 96, 0.3); }
}

@keyframes ripple {
    0%   { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes typewriter {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes magneticFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(1px, -1px) rotate(0.5deg); }
    50%      { transform: translate(0, -2px) rotate(0deg); }
    75%      { transform: translate(-1px, -1px) rotate(-0.5deg); }
}

/* ─── الهيدر الأساسي ─── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
    background: linear-gradient(180deg, rgba(10, 10, 25, 0.98) 0%, rgba(15, 15, 35, 0.95) 100%);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid rgba(233, 69, 96, 0.12);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 600px 200px at 20% 50%, rgba(233, 69, 96, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 150px at 80% 50%, rgba(0, 212, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

/* خط ليزر أعلى الهيدر */
.header-laser-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    overflow: hidden;
}

.header-laser-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-color), rgba(0, 212, 255, 0.8), transparent);
    animation: laserSweep 4s ease-in-out infinite;
}

/* الجزيئات */
.header-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.header-particle {
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    animation: particleDrift 6s infinite;
}

.header-particle:nth-child(odd) {
    background: rgba(0, 212, 255, 0.6);
    width: 2px;
    height: 2px;
}

/* ─── حالة التمرير ─── */
.site-header.scrolled {
    background: linear-gradient(180deg, rgba(8, 8, 20, 0.99) 0%, rgba(12, 12, 30, 0.98) 100%);
    border-bottom-color: rgba(233, 69, 96, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 60px rgba(233, 69, 96, 0.06);
}

.site-header.scrolled .header-container {
    height: 58px;
}

.site-header.scrolled .logo-icon {
    width: 40px;
    height: 40px;
}

/* ─── الحاوية ─── */
.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    position: relative;
    z-index: 2;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════
   الشعار
══════════════════════════════════════════ */
.site-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    position: relative;
    flex-shrink: 0;
    animation: logoFloat 4s ease-in-out infinite;
}

.site-logo:hover {
    color: inherit;
}

.site-logo:hover .logo-icon {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.4), inset 0 0 20px rgba(233, 69, 96, 0.1);
}

.site-logo:hover .magnifier-lens {
    r: 9;
    transition: r 0.4s;
}

.site-logo:hover .magnifier-print {
    opacity: 0.7;
    transition: opacity 0.4s;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.15) 0%, rgba(233, 69, 96, 0.05) 100%);
    border: 1.5px solid rgba(233, 69, 96, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.logo-magnifier {
    color: var(--accent-color);
    filter: drop-shadow(0 0 6px rgba(233, 69, 96, 0.4));
    transition: transform 0.5s;
}

.site-logo:hover .logo-magnifier {
    transform: rotate(-15deg) scale(1.1);
}

.magnifier-lens {
    transition: all 0.4s;
}

.magnifier-print {
    transition: opacity 0.4s;
}

/* نبض الشعار */
.logo-pulse {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(233, 69, 96, 0.4);
    border-radius: 18px;
    animation: logoPulseRing 3s ease-out infinite;
    pointer-events: none;
}

.logo-pulse-delayed {
    animation-delay: 1.5s;
}

/* نص الشعار */
.logo-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 3px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e94560 0%, #ff6b8a 40%, #f4d160 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    letter-spacing: -0.02em;
}

/* تأثير glitch خفيف على الهوفر */
.site-logo:hover .logo-text {
    animation: glitchText 0.4s ease;
}

.logo-tagline {
    overflow: hidden;
}

.tagline-reveal {
    display: inline-block;
    font-size: 0.62rem;
    color: rgba(0, 212, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    animation: taglineReveal 1s ease 0.5s both;
}

/* مؤشر "مباشر" */
.logo-live-indicator {
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #00d26a;
    border-radius: 50%;
    animation: liveBreath 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(0, 210, 106, 0.5);
}

/* ══════════════════════════════════════════
   التنقل الرئيسي
══════════════════════════════════════════ */
.main-nav .nav-menu-list {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.main-nav .nav-menu-list > li {
    position: relative;
}

.main-nav .nav-menu-list > li > a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 8px 16px;
    border-radius: 10px;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
}

/* تأثير "ملف سري" على الهوفر */
.main-nav .nav-menu-list > li > a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.08) 0%, rgba(233, 69, 96, 0.02) 100%);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.35s;
}

.main-nav .nav-menu-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 16px;
    left: 16px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), rgba(0, 212, 255, 0.6));
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* أيقونات القائمة */
.nav-item-icon {
    font-size: 0.78rem;
    opacity: 0.6;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.main-nav .nav-menu-list > li > a:hover .nav-item-icon {
    opacity: 1;
    color: var(--accent-color);
    animation: iconBounce 0.4s ease;
    filter: drop-shadow(0 0 4px rgba(233, 69, 96, 0.4));
}

.main-nav .nav-menu-list > li.current-menu-item > a .nav-item-icon,
.main-nav .nav-menu-list > li.current_page_item > a .nav-item-icon {
    opacity: 1;
    color: var(--accent-color);
}

.main-nav .nav-menu-list > li > a:hover {
    color: #fff;
    transform: translateY(-2px);
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.15);
}

.main-nav .nav-menu-list > li > a:hover::before {
    opacity: 1;
}

.main-nav .nav-menu-list > li > a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* الحالة النشطة */
.main-nav .nav-menu-list > li.current-menu-item > a,
.main-nav .nav-menu-list > li.current_page_item > a {
    color: #fff;
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.15);
}

.main-nav .nav-menu-list > li.current-menu-item > a::after,
.main-nav .nav-menu-list > li.current_page_item > a::after {
    transform: scaleX(1);
}

/* أنيميشن ظهور العناصر */
.main-nav .nav-menu-list > li {
    animation: navItemSlide 0.5s ease both;
}
.main-nav .nav-menu-list > li:nth-child(1) { animation-delay: 0.1s; }
.main-nav .nav-menu-list > li:nth-child(2) { animation-delay: 0.2s; }
.main-nav .nav-menu-list > li:nth-child(3) { animation-delay: 0.3s; }
.main-nav .nav-menu-list > li:nth-child(4) { animation-delay: 0.4s; }
.main-nav .nav-menu-list > li:nth-child(5) { animation-delay: 0.5s; }
.main-nav .nav-menu-list > li:nth-child(6) { animation-delay: 0.6s; }
.main-nav .nav-menu-list > li:nth-child(7) { animation-delay: 0.7s; }

/* عناصر الجوال مخفية على الديسكتوب */
.main-nav .mobile-nav-header,
.main-nav .mobile-nav-user,
.main-nav .mobile-nav-auth,
.main-nav .mobile-nav-case-strip {
    display: none;
}

/* ══════════════════════════════════════════
   أزرار الهيدر
══════════════════════════════════════════ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    border-radius: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* خط مسح خفيف داخل الأزرار */
.btn-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.header-icon-btn:hover .btn-scan-line {
    opacity: 1;
    animation: scanLine 1s linear;
}

.header-icon-btn:hover {
    color: var(--accent-color);
    background: rgba(233, 69, 96, 0.1);
    border-color: rgba(233, 69, 96, 0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.15), 0 0 20px rgba(233, 69, 96, 0.05);
}

.header-icon-btn:active {
    transform: translateY(0) scale(0.95);
    transition-duration: 0.1s;
}

/* بحث — نبض خفيف */
.header-search-btn {
    animation: magneticFloat 6s ease-in-out infinite;
}

.header-search-btn:hover {
    animation: none;
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.15), 0 0 20px rgba(0, 212, 255, 0.05);
}

/* تبديل الوضع */
.header-icon-btn.theme-toggle-btn:hover {
    color: var(--gold-color);
    background: rgba(244, 209, 96, 0.1);
    border-color: rgba(244, 209, 96, 0.25);
    box-shadow: 0 6px 20px rgba(244, 209, 96, 0.12), 0 0 20px rgba(244, 209, 96, 0.05);
    transform: translateY(-2px) rotate(20deg);
}

/* المفضلة */
.favorites-link .heart-icon-static {
    color: var(--accent-color);
    transition: transform 0.3s;
}

.favorites-link:hover .heart-icon-static {
    transform: scale(1.3);
}

/* ── الإشعارات ── */
.notification-wrapper {
    position: relative;
}

.notification-bell:hover i {
    animation: bellShake 0.6s ease;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, var(--accent-color), #ff3366);
    color: #fff;
    font-size: 0.55rem;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    padding: 0 4px;
    box-shadow: 0 0 0 2.5px rgba(10, 10, 25, 0.95), 0 0 12px rgba(233, 69, 96, 0.4);
    animation: badgeBounce 2s ease-in-out infinite;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    max-height: 440px;
    background: rgba(15, 15, 35, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(233, 69, 96, 0.15);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(233, 69, 96, 0.08);
    z-index: 9999;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
    animation: navItemSlide 0.3s ease;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(233, 69, 96, 0.1);
    font-weight: 700;
    font-size: 0.88rem;
    background: rgba(233, 69, 96, 0.03);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.72rem;
    font-family: inherit;
    transition: opacity 0.2s;
}

.mark-all-read:hover { opacity: 0.7; }

.notification-dropdown-body {
    overflow-y: auto;
    max-height: 360px;
    padding: 4px 0;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.25s;
}

.notification-item:hover {
    background: rgba(233, 69, 96, 0.05);
}

.notification-item.unread {
    background: rgba(233, 69, 96, 0.06);
    border-right: 3px solid var(--accent-color);
}

.notification-content p { margin: 0; font-size: 0.84rem; line-height: 1.5; }
.notification-content time { font-size: 0.68rem; color: var(--text-muted); }
.notification-empty { text-align: center; padding: 30px 16px; color: var(--text-muted); font-size: 0.84rem; }

/* ── نقاط المستخدم ── */
.user-points-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(244, 209, 96, 0.08), rgba(244, 209, 96, 0.03));
    border: 1px solid rgba(244, 209, 96, 0.15);
    border-radius: 20px;
    color: var(--gold-color);
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* تأثير لمعة */
.user-points-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 209, 96, 0.2), transparent);
    animation: shineSlide 3s ease-in-out infinite;
}

.user-points-badge:hover {
    background: linear-gradient(135deg, rgba(244, 209, 96, 0.15), rgba(244, 209, 96, 0.06));
    border-color: rgba(244, 209, 96, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 209, 96, 0.12);
    color: var(--gold-color);
}

.user-points-badge i { font-size: 0.72rem; }

/* AI Tokens */
.qtok-header-tokens {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: rgba(130, 100, 255, 0.08);
    border: 1px solid rgba(130, 100, 255, 0.15);
    border-radius: 20px;
    color: #a78bfa;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.qtok-header-tokens:hover {
    background: rgba(130, 100, 255, 0.14);
    border-color: rgba(130, 100, 255, 0.35);
    color: #a78bfa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(130, 100, 255, 0.12);
}

/* ── صورة المستخدم ── */
.user-profile-wrapper {
    position: relative;
}

.user-profile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
}

.user-profile-link img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(233, 69, 96, 0.3);
    transition: all 0.3s;
    object-fit: cover;
}

.user-profile-link:hover img {
    border-color: var(--accent-color);
    box-shadow: 0 0 16px rgba(233, 69, 96, 0.3);
}

.profile-ring {
    position: absolute;
    inset: -3px;
    border: 2px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.user-profile-link:hover .profile-ring {
    opacity: 1;
    animation: profileRingRotate 1.5s linear infinite;
}

/* ── أزرار المصادقة ── */
.header-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 11px;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.header-auth-btn i { font-size: 0.78rem; }

.header-auth-btn.login {
    background: linear-gradient(135deg, var(--accent-color), #ff3366);
    color: #fff;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.35);
    border: none;
}

.header-auth-btn.login::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.header-auth-btn.login:hover::after {
    left: 200%;
}

.header-auth-btn.login:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.5), 0 0 40px rgba(233, 69, 96, 0.15);
}

.header-auth-btn.register {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(233, 69, 96, 0.2);
    color: var(--text-color);
}

.register-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.header-auth-btn.register:hover {
    background: rgba(233, 69, 96, 0.08);
    border-color: rgba(233, 69, 96, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(233, 69, 96, 0.15);
    color: #fff;
}

.header-auth-btn.logout {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 8px 14px;
}

.header-auth-btn.logout:hover {
    color: var(--danger-color);
    background: rgba(255, 71, 87, 0.08);
    border-color: rgba(255, 71, 87, 0.25);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.1);
}

/* ══════════════════════════════════════════
   زر الهامبرغر
══════════════════════════════════════════ */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    cursor: pointer;
    padding: 8px;
    z-index: 1200;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(233, 69, 96, 0.1);
    border-color: rgba(233, 69, 96, 0.2);
}

.hamburger-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-origin: center;
}

/* تحويل إلى X */
.mobile-menu-toggle.active {
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.3);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--accent-color);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--accent-color);
}

/* ══════════════════════════════════════════
   نافذة البحث
══════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 15, 0.92);
    backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 18vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-container {
    width: 92%;
    max-width: 700px;
    position: relative;
}

/* تأثير المسح */
.search-scan-effect {
    position: absolute;
    inset: -20px -20px;
    pointer-events: none;
    overflow: hidden;
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.5s 0.2s;
}

.search-overlay.active .search-scan-effect {
    opacity: 1;
}

.scan-line-h {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, rgba(233, 69, 96, 0.6) 50%, transparent 90%);
    animation: searchScanDown 2s ease-in-out infinite;
}

.search-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.search-overlay-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.search-overlay-title svg {
    color: var(--accent-color);
}

.search-overlay-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.close-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.close-key:hover {
    background: rgba(233, 69, 96, 0.1);
    border-color: rgba(233, 69, 96, 0.3);
    color: var(--accent-color);
}

.search-overlay .search-input-group {
    background: rgba(15, 15, 35, 0.9);
    border: 2px solid rgba(233, 69, 96, 0.2);
    border-radius: 16px;
    padding: 10px 18px;
    transition: all 0.3s;
}

.search-overlay .search-input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.15), inset 0 0 30px rgba(233, 69, 96, 0.03);
}

.search-overlay-hint {
    text-align: center;
    color: var(--text-muted);
    margin-top: 14px;
    font-size: 0.82rem;
    opacity: 0.6;
}

/* ══════════════════════════════════════════
   الوضع الفاتح
══════════════════════════════════════════ */
[data-theme="light"] .site-header {
    background: linear-gradient(180deg, rgba(240, 242, 250, 0.98) 0%, rgba(235, 237, 248, 0.95) 100%);
    border-bottom-color: rgba(233, 69, 96, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .site-header::before {
    background:
        radial-gradient(ellipse 600px 200px at 20% 50%, rgba(233, 69, 96, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 400px 150px at 80% 50%, rgba(0, 120, 200, 0.03) 0%, transparent 70%);
}

[data-theme="light"] .header-laser-line::before {
    opacity: 0.5;
}

[data-theme="light"] .site-header.scrolled {
    background: linear-gradient(180deg, rgba(240, 242, 250, 0.99) 0%, rgba(235, 237, 248, 0.98) 100%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .logo-text {
    -webkit-text-fill-color: unset;
    background: none;
    color: var(--accent-color);
}

[data-theme="light"] .tagline-reveal {
    color: rgba(0, 100, 180, 0.7);
}

[data-theme="light"] .logo-icon {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.1) 0%, rgba(233, 69, 96, 0.03) 100%);
    border-color: rgba(233, 69, 96, 0.2);
}

[data-theme="light"] .main-nav .nav-menu-list > li > a {
    color: var(--text-muted);
}

[data-theme="light"] .main-nav .nav-menu-list > li > a:hover {
    color: var(--text-color);
}

[data-theme="light"] .main-nav .nav-menu-list > li > a::before {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.06) 0%, transparent 100%);
}

[data-theme="light"] .header-icon-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

[data-theme="light"] .header-icon-btn:hover {
    background: rgba(233, 69, 96, 0.08);
    border-color: rgba(233, 69, 96, 0.15);
}

[data-theme="light"] .header-auth-btn.register {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header-auth-btn.logout {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .user-points-badge {
    background: rgba(180, 140, 20, 0.07);
    border-color: rgba(180, 140, 20, 0.12);
}

[data-theme="light"] .mobile-menu-toggle {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hamburger-line {
    background: var(--text-color);
}

[data-theme="light"] .notification-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .notification-dropdown-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
    background: rgba(233, 69, 96, 0.02);
}

[data-theme="light"] .notification-item {
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .notification-item:hover {
    background: rgba(233, 69, 96, 0.03);
}

[data-theme="light"] .search-overlay {
    background: rgba(240, 242, 250, 0.95);
}

[data-theme="light"] .search-overlay .search-input-group {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .search-overlay .search-input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.1);
}

[data-theme="light"] .close-key {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header-particle {
    background: rgba(233, 69, 96, 0.3);
}

[data-theme="light"] .header-particle:nth-child(odd) {
    background: rgba(0, 120, 200, 0.25);
}

[data-theme="light"] .logo-tagline {
    color: var(--text-muted);
}

/* ══════════════════════════════════════════
   الجوال (768px وأقل)
══════════════════════════════════════════ */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        animation: hamburgerPulse 3s ease-in-out infinite 2s;
    }

    .header-container {
        padding: 0 16px;
        height: 58px;
    }

    .site-header.scrolled .header-container {
        height: 52px;
    }

    .header-actions {
        gap: 4px;
    }

    .site-logo {
        animation: none;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-live-indicator,
    .user-points-badge,
    .user-profile-wrapper,
    .qtok-header-tokens,
    .header-auth-btn.logout,
    .header-auth-btn.register {
        display: none;
    }

    .logo-pulse {
        display: none;
    }

    /* ── القائمة الجانبية ── */
    .main-nav {
        position: fixed;
        top: 0;
        right: -320px;
        left: auto;
        width: 300px;
        max-width: 85vw;
        height: 100dvh;
        background: linear-gradient(180deg, rgba(10, 10, 25, 0.99), rgba(15, 15, 35, 0.98));
        backdrop-filter: blur(20px);
        padding: 0;
        transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1100;
        border-left: 1px solid rgba(233, 69, 96, 0.15);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        pointer-events: auto;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }

    [data-theme="light"] .main-nav {
        background: linear-gradient(180deg, rgba(245, 246, 250, 0.99), rgba(240, 241, 248, 0.98));
        border-left-color: rgba(0, 0, 0, 0.06);
    }

    .main-nav.active {
        right: 0;
    }

    /* عنوان القائمة */
    .main-nav .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        border-bottom: 1px solid rgba(233, 69, 96, 0.1);
        flex-shrink: 0;
        background: rgba(233, 69, 96, 0.03);
    }

    .mobile-nav-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--text-color);
    }

    .mobile-nav-logo {
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, var(--accent-color), #ff3366);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }

    .mobile-nav-close {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        color: var(--text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s;
    }

    .mobile-nav-close:hover {
        background: rgba(233, 69, 96, 0.1);
        color: var(--accent-color);
        border-color: rgba(233, 69, 96, 0.2);
    }

    /* شريط ملف القضية */
    .main-nav .mobile-nav-case-strip {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 20px;
        background: rgba(233, 69, 96, 0.04);
        border-bottom: 1px solid rgba(233, 69, 96, 0.06);
    }

    .case-strip-label {
        font-size: 0.68rem;
        color: var(--accent-color);
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .case-strip-line {
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, rgba(233, 69, 96, 0.3), transparent);
    }

    /* القائمة */
    .main-nav .nav-menu-list {
        flex-direction: column;
        gap: 2px;
        padding: 12px 14px;
        pointer-events: auto;
        flex: 1;
    }

    .main-nav .nav-menu-list > li {
        animation: none;
    }

    .main-nav.active .nav-menu-list > li {
        animation: mobileNavReveal 0.4s ease both;
    }

    .main-nav.active .nav-menu-list > li:nth-child(1) { animation-delay: 0.1s; }
    .main-nav.active .nav-menu-list > li:nth-child(2) { animation-delay: 0.15s; }
    .main-nav.active .nav-menu-list > li:nth-child(3) { animation-delay: 0.2s; }
    .main-nav.active .nav-menu-list > li:nth-child(4) { animation-delay: 0.25s; }
    .main-nav.active .nav-menu-list > li:nth-child(5) { animation-delay: 0.3s; }
    .main-nav.active .nav-menu-list > li:nth-child(6) { animation-delay: 0.35s; }
    .main-nav.active .nav-menu-list > li:nth-child(7) { animation-delay: 0.4s; }

    .main-nav .nav-menu-list > li > a {
        display: flex;
        align-items: center;
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 12px;
        color: var(--text-muted);
    }

    .main-nav .nav-menu-list > li > a::after {
        display: none;
    }

    .main-nav .nav-menu-list > li > a:hover {
        background: rgba(233, 69, 96, 0.06);
        color: #fff;
        transform: none;
    }

    .main-nav .nav-menu-list > li.current-menu-item > a {
        color: var(--accent-color);
        background: rgba(233, 69, 96, 0.08);
        border-left: 3px solid var(--accent-color);
    }

    /* معلومات المستخدم */
    .main-nav .mobile-nav-user,
    .main-nav .mobile-nav-auth {
        display: block;
        margin-top: auto;
        flex-shrink: 0;
    }

    .mobile-nav-user {
        border-top: 1px solid rgba(233, 69, 96, 0.08);
        padding: 16px;
        background: rgba(233, 69, 96, 0.02);
    }

    .mobile-nav-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 14px;
    }

    .mobile-nav-avatar {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: 2px solid rgba(233, 69, 96, 0.3);
        object-fit: cover;
    }

    .mobile-nav-user-details {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-nav-username {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-color);
    }

    .mobile-nav-points {
        font-size: 0.8rem;
        color: var(--gold-color);
    }

    .mobile-nav-points i { font-size: 0.7rem; }

    .mobile-nav-user-actions {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-nav-action-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 14px;
        border-radius: 10px;
        color: var(--text-muted);
        font-size: 0.9rem;
        text-decoration: none;
        transition: all 0.25s;
    }

    .mobile-nav-action-link:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-color);
    }

    .mobile-nav-action-link.mobile-nav-logout { color: var(--danger-color); }
    .mobile-nav-action-link i { width: 18px; text-align: center; font-size: 0.85rem; }

    /* أزرار المصادقة في الجوال */
    .mobile-nav-auth {
        border-top: 1px solid rgba(233, 69, 96, 0.08);
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        background: rgba(233, 69, 96, 0.02);
    }

    .mobile-nav-auth-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 13px;
        border-radius: 12px;
        font-size: 0.95rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s;
    }

    .mobile-nav-auth-btn.primary {
        background: linear-gradient(135deg, var(--accent-color), #ff3366);
        color: #fff;
        box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
    }

    .mobile-nav-auth-btn.secondary {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: var(--text-color);
    }

    /* أوفرلاي */
    .mobile-nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(6px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.35s;
    }

    .mobile-nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* بحث على الجوال */
    .notification-wrapper .notification-dropdown {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 68px;
        width: auto;
        transform: none;
    }

    .search-overlay { padding-top: 12vh; }
    .search-overlay-container { width: 94%; }
}

/* ── شاشات متوسطة ── */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-nav .nav-menu-list {
        gap: 2px;
    }

    .main-nav .nav-menu-list > li > a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .header-container {
        padding: 0 20px;
    }
}

/* ── شاشات صغيرة جداً ── */
@media (max-width: 380px) {
    .logo-text-group {
        display: none;
    }

    .header-actions {
        gap: 3px;
    }

    .header-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.82rem;
    }

    .header-auth-btn.login {
        padding: 7px 12px;
        font-size: 0.78rem;
    }
}

/* ═══ RTL ═══ */
[dir="rtl"] .main-nav .nav-menu-list > li > a::after {
    right: 16px;
    left: 16px;
    transform-origin: left;
}

[dir="rtl"] .main-nav .nav-menu-list > li > a:hover::after {
    transform-origin: right;
}

[dir="rtl"] .notification-item.unread {
    border-right: none;
    border-left: 3px solid var(--accent-color);
}

@media (max-width: 768px) {
    [dir="rtl"] .main-nav .nav-menu-list > li.current-menu-item > a {
        border-left: none;
        border-right: 3px solid var(--accent-color);
    }
}

/* إخفاء روابط الدخول من القائمة عند تسجيل الدخول */
body.logged-in .nav-hide-when-logged-in {
    display: none !important;
}
.nav-logout-item a {
    color: var(--accent-color, #e74c3c) !important;
}
