/* ============================
   VARIABLES & RESET
============================ */
:root {
    --bg-primary:    #f0f5ff;
    --bg-secondary:  #ffffff;
    --bg-card:       #ffffff;
    --bg-card-hover: #eff6ff;
    --border:        #dbeafe;
    --border-dark:   #bfdbfe;
    --blue:          #2563eb;
    --blue-dark:     #1d4ed8;
    --blue-light:    #60a5fa;
    --blue-pale:     #eff6ff;
    --blue-mid:      #3b82f6;
    --navy:          #1e3a5f;
    --text-primary:  #0f172a;
    --text-secondary:#475569;
    --text-muted:    #94a3b8;
    --radius:        14px;
    --radius-sm:     8px;
    --transition:    0.22s ease;
    --shadow:        0 4px 20px rgba(37,99,235,0.1);
    --shadow-blue:   0 8px 30px rgba(37,99,235,0.18);
    --shadow-card:   0 2px 12px rgba(15,23,42,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    text-align: start;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../images/bg-pattern.svg');
    background-size: 1400px 1400px;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}
body > * { position: relative; z-index: 1; }
body.dark::before {
    background-image: url('../images/footer-pattern.svg');
}

a { text-decoration: none; color: inherit; }

/* ============================
   CONTAINER
============================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}
@media (max-width: 480px) {
    .container { padding: 0 10px; }
}

/* ============================
   NAVBAR
============================ */
/* ── Top Bar ── */
.topbar {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    font-size: .76rem;
    overflow: visible;
    position: relative;
    z-index: 1001;
}
.topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.topbar-links::-webkit-scrollbar { display: none; }
.topbar-links a {
    color: #94a3b8;
    text-decoration: none;
    padding: 7px 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .15s, background .15s;
    font-weight: 600;
}
.topbar-links a i { font-size: .68rem; opacity: .7; }
.topbar-links a:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}
/* ── Topbar Controls (dark mode + lang) ── */
.topbar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Topbar Dark Mode Toggle */
.topbar-dark-switch {
    cursor: pointer;
    display: flex;
    align-items: center;
}
.topbar-dark-switch input { display: none; }
.topbar-dark-track {
    position: relative;
    width: 40px;
    height: 22px;
    background: #334155;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    transition: background .2s;
}
.topbar-dark-track:hover { background: #475569; }
.topbar-icon-sun { font-size: .55rem; color: #fbbf24; }
.topbar-icon-moon { font-size: .55rem; color: #94a3b8; }
.topbar-dark-thumb {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: inset-inline-start .25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.topbar-dark-switch input:checked ~ .topbar-dark-track {
    background: #6366f1;
}
.topbar-dark-switch input:checked ~ .topbar-dark-track .topbar-dark-thumb {
    inset-inline-start: 20px;
}

/* Topbar Language Picker */
.topbar-lang {
    position: relative;
}
.topbar-lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 3px 10px;
    color: #cbd5e1;
    font-size: .74rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.topbar-lang-btn:hover {
    border-color: #6366f1;
    color: #fff;
}
.topbar-lang-flag { font-size: .85rem; line-height: 1; }
.topbar-lang-arrow { font-size: .55rem; opacity: .6; transition: transform .2s; }
.topbar-lang.open .topbar-lang-arrow { transform: rotate(180deg); }

.topbar-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 6px;
    min-width: 170px;
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.topbar-lang.open .topbar-lang-dropdown { display: block; }
.topbar-lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 6px;
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 600;
    transition: all .12s;
    text-decoration: none;
}
.topbar-lang-item:hover { background: #334155; color: #e2e8f0; }
.topbar-lang-item--active { color: #818cf8; }
.topbar-lang-item--active i { margin-inline-start: auto; font-size: .65rem; color: #818cf8; }

body.tool-maximized .topbar { display: none; }
@media (max-width: 900px) {
    .topbar-lang-label { display: none; }
}
@media (max-width: 640px) {
    .topbar-inner { justify-content: flex-start; }
    .topbar-links a { padding: 7px 10px; font-size: .72rem; }
    .topbar-controls { gap: 8px; }
}

.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 12px rgba(37,99,235,0.08);
}
body.tool-maximized .navbar { display: none; }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border: 1px solid #dfe9ff;
    border-radius: 12px;
    padding: 6px 10px;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.logo-img--mob {
    height: 28px;
}

.logo-icon {
    font-size: 1.4rem;
    color: var(--blue);
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 3px;
    text-align: left;
}

.logo-main {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
}

.logo-accent { color: var(--blue); }

.logo-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-links > li { position: relative; }
.nav-links > li.has-mega { position: static; }

.nav-links > li > a {
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-links > li { margin: 0 2px; }

.nav-links > li:not(.has-mega):not(.nav-games-item) > a:hover,
.nav-links > li:not(.has-mega):not(.nav-games-item).active > a {
    color: var(--blue);
    background: var(--blue-pale);
}

.nav-home-link {
    border: 1px solid rgba(59,130,246,0.3) !important;
    background: transparent !important;
}
.nav-home-link:hover {
    background: #eff6ff !important;
}

.nav-arrow {
    display: inline-block;
    vertical-align: middle;
    opacity: 0.5;
    transition: transform var(--transition), opacity var(--transition);
    flex-shrink: 0;
}

.nav-links > li:hover .nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ============================
   MEGA MENU
============================ */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: 580px;
    background: #ffffff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow-blue);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 200;
}

.mega-menu::before, .mega-menu::after { display: none; }

.has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* أقسام تظهر فقط في القائمة الجانبية على الهاتف */
.nav-mob-only { display: none; }
/* أقسام تظهر فقط على الديسكتوب */
.nav-desk-only { display: list-item; }

/* ميغا منيو عريض للأقسام الرئيسية */
.mega-menu--wide {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    transform: translateY(8px);
    border-radius: 0 0 16px 16px;
    border-top: 3px solid var(--cat-color, var(--blue));
}
.has-mega:hover .mega-menu--wide {
    transform: translateY(0);
}

/* شبكة عرض الأقسام */
.mega-cols-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 10px;
    padding: 0;
}

/* كارد القسم الفرعي */
.mega-sub-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.mega-sub-card:hover {
    border-color: var(--cat-color, var(--blue));
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.mega-sub-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: .79rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.mega-sub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255,255,255,.5);
    font-size: .77rem;
    flex-shrink: 0;
}

.mega-sub-tools {
    padding: 5px 6px;
}

/* صف الأداة */
.mega-tool-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 6px;
    text-decoration: none;
    transition: background .15s;
}
.mega-tool-row:hover {
    background: var(--tb, #f1f5f9);
}
.mega-tool-row:hover .mega-tool-name { color: var(--tc, #3b82f6); }

.soon-inline {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 50px;
    font-size: .65rem;
    font-weight: 400;
    background: var(--cat-color, var(--blue));
    color: #fff !important;
    margin-inline-start: 5px;
    vertical-align: middle;
    opacity: .9;
}
.cat-list-card--soon,
.cat-tool-card--soon { opacity: .75; }

.nav-soon-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 50px;
    font-size: .6rem;
    font-weight: 700;
    background: var(--tc, var(--blue));
    color: #fff;
    margin-inline-start: 5px;
    flex-shrink: 0;
    vertical-align: middle;
    opacity: .9;
}

.mega-tool-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--tb, #f1f5f9);
    color: var(--tc, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    flex-shrink: 0;
    transition: background .15s;
}
.mega-tool-row:hover .mega-tool-icon {
    background: var(--tc, #3b82f6);
    color: #fff;
}

.mega-tool-name {
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .15s;
}

/* أيقونة القسم في النافبار */
.nav-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--cat-bg, #f1f5f9);
    color: var(--cat-color, #475569);
    font-size: 0.78rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.has-mega:hover .nav-cat-icon { transform: scale(1.1); }

/* زر الألعاب المميز في النافبار */
.nav-games-item .nav-games-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: #fff !important;
    border: 1.5px solid transparent;
    transition: all 0.25s ease;
}
.nav-games-item .nav-games-btn .nav-cat-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.nav-games-item .nav-games-btn:hover {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #fff !important;
    border-color: transparent;
}

/* مربع عنصر القسم في النافبار */
.has-mega > a {
    border: 1px solid color-mix(in srgb, var(--cat-color, var(--border)) 30%, transparent 70%);
    background: transparent;
}
.has-mega:hover > a {
    border-color: var(--cat-color, var(--blue));
    background: var(--cat-bg, var(--blue-pale));
    color: var(--cat-color, var(--blue));
}

.mega-inner { padding: 16px 20px 20px; }

.mega-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.mega-heading h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 7px;
}

.mega-view-all {
    font-size: 0.82rem;
    color: var(--blue);
    font-weight: 500;
    transition: color var(--transition);
}

.mega-view-all:hover { color: var(--blue-dark); }

.mega-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.mega-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    cursor: pointer;
}

.mega-item:hover { background: var(--blue-pale); }

.mega-icon {
    width: 34px;
    height: 34px;
    background: var(--blue-pale);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--blue);
    flex-shrink: 0;
    transition: all var(--transition);
}

.mega-item:hover .mega-icon {
    background: var(--blue);
    color: #ffffff;
}

.mega-item div { flex: 1; min-width: 0; }

.mega-item strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.mega-item small {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* ============================
   NAV CONTROLS (dark + lang)
============================ */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* --- Dark Mode Switch --- */
.dark-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.dark-switch input { display: none; }

.dark-switch-track {
    position: relative;
    width: 52px;
    height: 28px;
    background: #e2e8f0;
    border-radius: 50px;
    border: 1px solid var(--border-dark);
    transition: background 0.3s, border-color 0.3s;
    display: flex;
    align-items: center;
    padding: 0 5px;
    justify-content: space-between;
}

.dark-icon-sun  { font-size: 0.7rem; color: #f59e0b; z-index: 1; }
.dark-icon-moon { font-size: 0.65rem; color: #94a3b8; z-index: 1; }

.dark-switch-thumb {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    transition: transform 0.3s ease, background 0.3s;
    z-index: 2;
}

/* checked state */
.dark-switch input:checked + .dark-switch-track {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.dark-switch input:checked + .dark-switch-track .dark-icon-moon { color: #93c5fd; }

.dark-switch input:checked + .dark-switch-track .dark-switch-thumb {
    transform: translateX(-24px);
    background: #93c5fd;
}

/* --- Language Picker --- */
.lang-picker {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    border: 1px solid var(--border-dark);
    border-radius: 50px;
    padding: 6px 14px 6px 10px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(37,99,235,0.08);
}

.lang-btn-flag {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.lang-btn .nav-arrow {
    opacity: 0.4;
    transition: transform var(--transition), opacity var(--transition);
    margin-right: 2px;
}

.lang-btn:hover {
    border-color: var(--blue);
    box-shadow: 0 2px 10px rgba(37,99,235,0.15);
}

.lang-picker.open .lang-btn {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.lang-picker.open .lang-btn .nav-arrow { transform: rotate(180deg); opacity: 1; }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 200px;
    background: #ffffff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(37,99,235,0.14), 0 2px 8px rgba(0,0,0,0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.98);
    transform-origin: top left;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 300;
    overflow: hidden;
    padding: 6px;
}

/* مثلث صغير فوق الـ dropdown */
.lang-dropdown::before {
    content: '';
    position: absolute;
    top: -7px; left: 20px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--border-dark);
}
.lang-dropdown::after {
    content: '';
    position: absolute;
    top: -5px; left: 21px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #ffffff;
}

.lang-picker.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.86rem;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    border-radius: 8px;
}

.lang-item:hover {
    background: var(--blue-pale);
    color: var(--blue);
}

.lang-item--active {
    background: var(--blue-pale);
    color: var(--blue);
    font-weight: 600;
    position: relative;
}

.lang-item--active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: var(--blue);
    margin-right: auto;
}

.lang-flag { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.lang-name  { flex: 1; }

/* ============================
   DARK MODE THEME
============================ */
body.dark {
    --bg-primary:    #0f172a;
    --bg-secondary:  #1e293b;
    --bg-card:       #1e293b;
    --bg-card-hover: #263248;
    --border:        #1e3a5f;
    --border-dark:   #2d4a7a;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --blue-pale:     #172554;
    --shadow-card:   0 2px 12px rgba(0,0,0,0.4);
    --shadow-blue:   0 8px 30px rgba(0,0,0,0.4);
}

body.dark .navbar       { background: #0f172a; border-color: #1e3a5f; }
body.dark .lang-btn          { background: #1e293b; border-color: #2d4a7a; color: #f1f5f9; box-shadow: none; }
body.dark .lang-btn-flag { box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
body.dark .lang-btn:hover    { border-color: #3b82f6; box-shadow: 0 2px 10px rgba(59,130,246,0.2); }
body.dark .lang-picker.open .lang-btn { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
body.dark .lang-dropdown     { background: #1e293b; border-color: #2d4a7a; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
body.dark .lang-dropdown::after  { border-bottom-color: #1e293b; }
body.dark .lang-dropdown::before { border-bottom-color: #2d4a7a; }
body.dark .lang-item         { color: #94a3b8; }
body.dark .lang-item:hover   { background: #172554; color: #60a5fa; }
body.dark .lang-item--active { background: #172554; color: #60a5fa; }
body.dark .lang-item--active::after { color: #60a5fa; }
body.dark .dark-switch-track { background: #1e293b; border-color: #2d4a7a; }
body.dark .mega-menu    { background: #1e293b; border-color: #2d4a7a; }
body.dark .mega-sub-card { border-color: #1e3a5f; }
body.dark .mega-sub-card:hover { border-color: var(--cat-color, #60a5fa); }
body.dark .mega-sub-header { border-color: #1e3a5f; }
body.dark .mega-item:hover { background: #172554; }
body.dark .mega-item strong { color: #f1f5f9; }
body.dark .cat-card     { background: #1e293b; border-color: #1e3a5f; }
body.dark .tool-card    { background: #1e293b; border-color: #1e3a5f; }
body.dark .digital-card { background: #1e293b; border-color: #1e3a5f; }
body.dark .challenges-section { border-color: #1e3a5f; }
body.dark .categories-section { border-color: #1e3a5f; }
body.dark .nav-links > li > a { color: #94a3b8; }
body.dark .nav-links > li > a:hover { background: #172554; color: #60a5fa; }
body.dark .nav-games-item .nav-games-btn { color: #fff !important; }
body.dark .nav-games-item .nav-games-btn:hover { background: linear-gradient(135deg, #e11d48, #f43f5e); color: #fff !important; }
body.dark .topbar { background: #0f172a; border-bottom-color: #1e293b; }
body.dark .topbar-links a { color: #64748b; }
body.dark .topbar-links a:hover { color: #e2e8f0; background: rgba(255,255,255,.04); }
body.dark .topbar-lang-btn { border-color: #1e293b; color: #94a3b8; }
body.dark .topbar-lang-btn:hover { border-color: #6366f1; color: #e2e8f0; }
body.dark .topbar-lang-dropdown { background: #0f172a; border-color: #1e293b; }
body.dark .topbar-lang-item:hover { background: #1e293b; }

/* Logo */
body.dark .logo              { border-color: #1e3a5f; }
body.dark .logo-main         { color: #f1f5f9; }
body.dark .logo-accent       { color: #60a5fa; }
body.dark .logo-sub          { color: #475569; }
body.dark .logo-icon         { color: #60a5fa; }
body.dark .menu-toggle span  { background: #94a3b8; }

/* Mega menu */
body.dark .mega-heading      { border-color: #1e3a5f; }
body.dark .mega-heading h3   { color: #f1f5f9; }
body.dark .mega-view-all     { color: #60a5fa; }
body.dark .mega-icon         { background: #172554; color: #60a5fa; }
body.dark .mega-item:hover .mega-icon { background: #2563eb; color: #fff; }
body.dark .mega-item small   { color: #64748b; }
body.dark .mega-col-title    { color: #60a5fa; border-color: #1e3a5f; }

/* Section titles */
body.dark .section-title     { color: #f1f5f9; }
body.dark .section-desc      { color: #64748b; }

/* Category cards */
body.dark .cat-name          { color: #f1f5f9; }
body.dark .cat-count         { color: #475569; }

/* Tool cards */
body.dark .tool-name         { color: #f1f5f9; }
body.dark .tool-desc         { color: #64748b; }
body.dark .tool-tag          { background: #172554; color: #60a5fa; border-color: #1e3a5f; }
body.dark .tool-card:hover   { border-color: #3b82f6; }

/* Digital cards */
body.dark .digital-name      { color: #f1f5f9; }
body.dark .digital-desc      { color: #64748b; }
body.dark .digital-card:hover { border-color: #3b82f6; }

/* Search */
/* Search is always on dark hero background - no dark overrides needed */

/* Hero cats */

/* Tools section background */
body.dark .tools-section     { }
body.dark .digital-section   { }

/* Footer brand logo */
body.dark .footer-brand .logo-main { color: #f1f5f9; }

/* Hero */
/* ── Hero Dark Mode ── */
body.dark .hero {
    background: linear-gradient(145deg, #020617 0%, #0c1a3a 40%, #0f172a 100%);
}
body.dark .hero-gradient {
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(37,99,235,.2), transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(30,58,138,.35), transparent 55%),
        radial-gradient(ellipse 50% 50% at 100% 0%, rgba(96,165,250,.08), transparent 50%);
}
body.dark .hero-orb--1 { background: radial-gradient(circle, rgba(37,99,235,.25) 0%, transparent 70%); }
body.dark .hero-orb--2 { background: radial-gradient(circle, rgba(96,165,250,.15) 0%, transparent 70%); }
body.dark .hero-orb--3 { background: radial-gradient(circle, rgba(30,58,138,.4) 0%, transparent 70%); }
body.dark .hero-dots { background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px); }
body.dark .hero-strip { background: rgba(15,23,42,.5); }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================
   HERO
============================ */
.hero {
    position: relative;
    z-index: 2;
    padding: 100px 0 0;
    background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 40%, #2563eb 70%, #3b82f6 100%);
    min-height: 520px;
}

/* ── Background layers ── */
.hero-bg {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.hero-gradient {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(147,197,253,.15), transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(30,58,138,.4), transparent 55%),
        radial-gradient(ellipse 50% 50% at 100% 0%, rgba(96,165,250,.12), transparent 50%);
}
.hero-noise {
    position: absolute; inset: 0;
    opacity: .2;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
    background-size: 200px;
}
.hero-rays {
    position: absolute; inset: 0;
    background:
        linear-gradient(115deg, transparent 42%, rgba(255,255,255,.04) 45%, rgba(255,255,255,.04) 46%, transparent 49%),
        linear-gradient(65deg,  transparent 42%, rgba(255,255,255,.03) 45%, rgba(255,255,255,.03) 46%, transparent 49%);
}
.hero-dots {
    position: absolute; inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
}

/* ── Orbs (glowing blobs) ── */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(70px);
}
.hero-orb--1 {
    width: 500px; height: 500px;
    top: -20%; left: -8%;
    background: radial-gradient(circle, rgba(147,197,253,.25) 0%, transparent 70%);
    animation: heroOrbDrift1 14s ease-in-out infinite;
}
.hero-orb--2 {
    width: 400px; height: 400px;
    bottom: -10%; right: -5%;
    background: radial-gradient(circle, rgba(96,165,250,.2) 0%, transparent 70%);
    animation: heroOrbDrift2 16s ease-in-out infinite;
}
.hero-orb--3 {
    width: 300px; height: 300px;
    top: 25%; right: 15%;
    background: radial-gradient(circle, rgba(30,58,138,.5) 0%, transparent 70%);
    animation: heroOrbDrift3 12s ease-in-out infinite;
}
@keyframes heroOrbDrift1 {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(40px,30px) scale(1.1); }
    66% { transform: translate(-20px,50px) scale(.95); }
}
@keyframes heroOrbDrift2 {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(-50px,-20px) scale(1.08); }
    66% { transform: translate(30px,-40px) scale(.92); }
}
@keyframes heroOrbDrift3 {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(-40px,25px) scale(1.15); }
}

/* ── Rings ── */
.hero-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.1);
}
.hero-ring--1 {
    width: 350px; height: 350px;
    top: -60px; left: 5%;
    animation: heroSpin 30s linear infinite;
    border-color: rgba(147,197,253,.15);
}
.hero-ring--1::after {
    content: '';
    position: absolute;
    width: 8px; height: 8px;
    background: rgba(147,197,253,.6);
    border-radius: 50%;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 12px rgba(147,197,253,.8);
}
.hero-ring--2 {
    width: 220px; height: 220px;
    bottom: 60px; right: 8%;
    border-color: rgba(255,255,255,.07);
    animation: heroSpin 22s linear infinite reverse;
}
.hero-ring--2::after {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    background: rgba(255,255,255,.5);
    border-radius: 50%;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(255,255,255,.4);
}
@keyframes heroSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Particles ── */
.hero-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: rgba(255,255,255,.5);
    box-shadow: 0 0 6px rgba(255,255,255,.3);
}
.hero-particle--1 { width: 3px; height: 3px; top: 22%; left: 18%; animation: heroPFloat 7s ease-in-out infinite; }
.hero-particle--2 { width: 4px; height: 4px; top: 55%; left: 28%; animation: heroPFloat 9s ease-in-out infinite 1s; }
.hero-particle--3 { width: 3px; height: 3px; top: 30%; right: 22%; animation: heroPFloat 6s ease-in-out infinite .5s; }
.hero-particle--4 { width: 4px; height: 4px; bottom: 35%; right: 28%; animation: heroPFloat 8s ease-in-out infinite 2s; }
.hero-particle--5 { width: 3px; height: 3px; top: 70%; left: 50%; animation: heroPFloat 10s ease-in-out infinite 1.5s; }
@keyframes heroPFloat {
    0%, 100% { transform: translateY(0) translateX(0); opacity: .5; }
    33% { transform: translateY(-20px) translateX(8px); opacity: 1; }
    66% { transform: translateY(-8px) translateX(-6px); opacity: .3; }
}

/* ── Floating tool icons ── */
.hero-floaters {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 1;
}
.hero-float {
    position: absolute;
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: rgba(255,255,255,.25);
    opacity: .5;
}
/* Left side */
.hero-float--1  { top: 8%;  left: 3%;   animation: heroFloat 7s ease-in-out infinite; }
.hero-float--2  { top: 28%; left: 10%;  animation: heroFloat 9s ease-in-out infinite .5s; }
.hero-float--3  { top: 48%; left: 3%;   animation: heroFloat 8s ease-in-out infinite 1s; }
.hero-float--4  { top: 68%; left: 11%;  animation: heroFloat 10s ease-in-out infinite 1.8s; }
.hero-float--5  { top: 12%; left: 18%;  animation: heroFloat 8s ease-in-out infinite 2.5s; }
.hero-float--6  { top: 42%; left: 17%;  animation: heroFloat 7s ease-in-out infinite .8s; }
.hero-float--7  { top: 75%; left: 4%;   animation: heroFloat 9s ease-in-out infinite 3s; }
.hero-float--8  { top: 58%; left: 20%;  animation: heroFloat 8s ease-in-out infinite 1.2s; }
/* Right side */
.hero-float--9  { top: 8%;  right: 3%;  animation: heroFloat 8s ease-in-out infinite 1.5s; }
.hero-float--10 { top: 28%; right: 10%; animation: heroFloat 7s ease-in-out infinite 2s; }
.hero-float--11 { top: 48%; right: 4%;  animation: heroFloat 9s ease-in-out infinite .3s; }
.hero-float--12 { top: 68%; right: 12%; animation: heroFloat 10s ease-in-out infinite 2.2s; }
.hero-float--13 { top: 12%; right: 19%; animation: heroFloat 8s ease-in-out infinite 1s; }
.hero-float--14 { top: 42%; right: 17%; animation: heroFloat 7s ease-in-out infinite 2.8s; }
.hero-float--15 { top: 75%; right: 5%;  animation: heroFloat 9s ease-in-out infinite .6s; }
.hero-float--16 { top: 58%; right: 20%; animation: heroFloat 8s ease-in-out infinite 3.2s; }

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-18px) rotate(5deg); }
}

/* ── Layout ── */
.hero-inner {
    position: relative;
    z-index: 2;
}
.hero-content {
    max-width: 660px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

/* ── Pill ── */
.hero-pill {
    display: inline-flex;
    align-items: center; gap: 10px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.9);
    padding: 8px 22px;
    border-radius: 50px;
    font-size: .82rem; font-weight: 600;
    margin-bottom: 30px;
    animation: heroFadeUp .8s ease both;
    box-shadow: none;
}
.hero-pill-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: heroPulse 2s ease-in-out infinite;
}
@keyframes heroPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px #34d399; }
    50% { opacity: .5; box-shadow: 0 0 4px #34d399; }
}

/* ── Title ── */
.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    margin-bottom: 24px;
    white-space: nowrap;
    letter-spacing: -.01em;
    animation: heroFadeUp .8s ease .15s both;
}
.hero-separator {
    color: rgba(255,255,255,.6);
    margin: 0 10px;
    font-weight: 300;
}
.hero-typed-box {
    position: relative;
    display: inline-block;
    vertical-align: baseline;
    white-space: nowrap;
}
.hero-typed {
    display: inline-block;
    color: #fff;
    clip-path: inset(0 100% 0 0);
}
.hero-wiper {
    display: none;
}
@keyframes heroGradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(1.1rem, 4vw, 1.6rem);
    }
    .hero-separator { margin: 0 5px; }
}

/* ── Features row ── */
.hero-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    animation: heroFadeUp .8s ease .3s both;
}
.hero-feat {
    display: flex; align-items: center; gap: 7px;
    color: rgba(255,255,255,.6);
    font-size: .84rem; font-weight: 500;
}
.hero-feat i {
    font-size: .75rem;
    color: #93c5fd;
}

/* ── Search ── */
.hero .search-box {
    animation: heroFadeUp .8s ease .45s both;
}

/* ── Trending ── */
.hero-trending {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 8px;
    margin-bottom: 20px;
}
.hero-trending-label {
    color: rgba(255,255,255,.35);
    font-size: .68rem; font-weight: 500;
    display: flex; align-items: center; gap: 4px;
}
.hero-trending-label i { color: rgba(255,255,255,.3); font-size: .6rem; }
.hero-trending-tag {
    color: rgba(255,255,255,.4);
    font-size: .68rem;
    padding: 0;
    border: none;
    background: transparent;
    text-decoration: none;
    transition: color .2s;
}
.hero-trending-tag:hover {
    color: rgba(255,255,255,.8);
}

/* ── Browse all button ── */
.hero-browse-btn {
    display: inline-flex;
    align-items: center; gap: 10px;
    padding: 12px 32px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.85);
    font-size: .9rem; font-weight: 600;
    text-decoration: none;
    transition: all .3s;
    margin-bottom: 36px;
    animation: heroFadeUp .8s ease .6s both;
}
.hero-browse-btn:hover {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.35);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.hero-browse-arrow {
    font-size: .75rem;
    transition: transform .3s;
}
.hero-browse-btn:hover .hero-browse-arrow {
    transform: translateX(-4px);
}
[dir="ltr"] .hero-browse-btn:hover .hero-browse-arrow {
    transform: translateX(4px);
}

/* ── Category strip ── */
.hero-strip {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.1);
    backdrop-filter: blur(8px);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    animation: heroFadeUp .8s ease .65s both;
}
.hero-strip::-webkit-scrollbar { display: none; }
.hero-strip-item {
    flex: 1;
    min-width: 0;
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    padding: 20px 12px;
    text-decoration: none;
    color: rgba(255,255,255,.55);
    font-size: .78rem; font-weight: 500;
    border-left: 1px solid rgba(255,255,255,.06);
    transition: all .25s;
    white-space: nowrap;
}
.hero-strip-item:first-child { border-left: none; }
[dir="ltr"] .hero-strip-item:first-child { border-left: none; }
[dir="ltr"] .hero-strip-item { border-left: none; border-right: 1px solid rgba(255,255,255,.06); }
[dir="ltr"] .hero-strip-item:last-child { border-right: none; }
.hero-strip-item i {
    font-size: 1.05rem;
    color: var(--sc);
    filter: brightness(1.3);
    transition: transform .25s;
}
.hero-strip-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.hero-strip-item small {
    font-size: .65rem;
    color: rgba(255,255,255,.3);
    background: rgba(255,255,255,.08);
    padding: 1px 8px;
    border-radius: 50px;
}
.hero-strip-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}
.hero-strip-item:hover i { transform: scale(1.2); }

/* ── Entrance animation ── */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero always dark, no dark overrides needed ── */

/* ── Select2-style Search ── */
.search-box {
    max-width: 540px;
    margin: 0 auto 18px;
    position: relative;
    z-index: 100;
}
.search-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid rgba(255,255,255,.25);
    border-radius: 12px;
    padding: 4px 16px;
    transition: all .25s ease;
}
.search-box.open .search-wrapper {
    border-radius: 12px 12px 0 0;
    border-bottom-color: var(--border);
}
.search-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.search-icon {
    color: #94a3b8;
    font-size: .88rem;
    flex-shrink: 0;
    margin-inline-end: 4px;
}
.search-input {
    flex: 1;
    background: none;
    border: none; outline: none;
    color: #1e293b;
    font-size: .93rem;
    padding: 10px 10px;
    direction: inherit;
    min-width: 0;
}
.search-input::placeholder { color: #94a3b8; }
.search-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: .88rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.search-btn:hover { background: #1d4ed8; }
.search-btn:active { transform: scale(.96); }

/* Dropdown */
.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% - 2px);
    left: 0; right: 0;
    background: #fff;
    border: 2px solid #3b82f6;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,.12);
    z-index: 9999;
    max-height: 340px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.search-suggestions::-webkit-scrollbar { width: 4px; }
.search-suggestions::-webkit-scrollbar-track { background: transparent; }
.search-suggestions::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
body.dark .search-suggestions::-webkit-scrollbar-thumb { background: #475569; }
.search-suggestions.active { display: block; }
.search-sugg-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #1e293b;
    transition: background .12s;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}
.search-sugg-item:last-child { border-bottom: none; }
.search-sugg-item:hover,
.search-sugg-item.highlighted { background: #eff6ff; }
.search-sugg-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem;
    flex-shrink: 0;
}
.search-sugg-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.search-sugg-name {
    font-size: .84rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-sugg-name mark {
    background: none;
    color: #2563eb;
    font-weight: 700;
}
.search-sugg-desc {
    font-size: .7rem;
    color: #94a3b8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-sugg-type {
    font-size: .65rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 50px;
    flex-shrink: 0;
    white-space: nowrap;
}
.search-sugg-empty {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: .85rem;
}
body.dark .search-wrapper { background: #1e293b; border-color: #334155; }
body.dark .search-input { color: #e2e8f0; }
body.dark .search-input::placeholder { color: #64748b; }
body.dark .search-icon { color: #64748b; }
body.dark .search-wrapper:focus-within { border-color: #3b82f6; }
body.dark .search-suggestions { background: #1e293b; border-color: #3b82f6; border-top-color: #334155; }
body.dark .search-sugg-item { color: #e2e8f0; border-bottom-color: #334155; }
body.dark .search-sugg-item:hover,
body.dark .search-sugg-item.highlighted { background: #0f172a; }
body.dark .search-sugg-name { color: #e2e8f0; }
body.dark .search-sugg-desc { color: #64748b; }
body.dark .search-sugg-empty { color: #64748b; }

/* Search tags */


/* ============================
   SECTIONS
============================ */
.section { padding: 72px 0; }

.section-header { text-align: center; margin-bottom: 44px; }

.section-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; color: var(--navy); }

.section-desc { color: var(--text-secondary); font-size: 0.95rem; }

/* ============================
   CATEGORIES
============================ */
.categories-section {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.cat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 16px 18px;
    text-align: center;
    display: block;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

/* الخط الملون في الأعلى */
.cat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--cat-color, var(--blue));
    transition: height var(--transition);
}

.cat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: var(--cat-color, var(--blue));
}

.cat-card:hover::before { height: 100%; opacity: 0.08; }

.cat-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--cat-bg, var(--blue-pale));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.35rem;
    color: var(--cat-color, var(--blue));
    transition: all var(--transition);
}

.cat-card:hover .cat-icon {
    background: var(--cat-color, var(--blue));
    color: #ffffff;
}

.cat-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color var(--transition);
}

.cat-count {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.cat-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--cat-bg, var(--blue-pale));
    border-radius: 50%;
    font-size: 0.7rem;
    color: var(--cat-color, var(--blue));
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(4px);
}

.cat-card:hover .cat-arrow {
    opacity: 1;
    transform: translateY(0);
    background: var(--cat-color, var(--blue));
    color: #ffffff;
}

/* ألوان الفئات */
.cat--gold    { --cat-color: #d97706; --cat-bg: #fef3c7; }
.cat--green   { --cat-color: #059669; --cat-bg: #d1fae5; }
.cat--pink    { --cat-color: #db2777; --cat-bg: #fce7f3; }
.cat--red     { --cat-color: #dc2626; --cat-bg: #fee2e2; }
.cat--blue    { --cat-color: #2563eb; --cat-bg: #dbeafe; }
.cat--purple  { --cat-color: #7c3aed; --cat-bg: #ede9fe; }
.cat--indigo  { --cat-color: #4f46e5; --cat-bg: #e0e7ff; }
.cat--teal    { --cat-color: #0d9488; --cat-bg: #ccfbf1; }
.cat--emerald { --cat-color: #16a34a; --cat-bg: #dcfce7; }
.cat--orange  { --cat-color: #ea580c; --cat-bg: #ffedd5; }
.cat--yellow  { --cat-color: #ca8a04; --cat-bg: #fef9c3; }
.cat--slate   { --cat-color: #475569; --cat-bg: #f1f5f9; }
.cat--cyan    { --cat-color: #0891b2; --cat-bg: #cffafe; }
.cat--rose    { --cat-color: #e11d48; --cat-bg: #ffe4e6; }

/* ============================
   TOOLS GRID
============================ */
/* ── Featured Tools (Premium) ── */
/* ── Section Banner ── */
.sec-banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.sec-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--sb-color) 0%, color-mix(in srgb, var(--sb-color) 70%, #000) 100%);
    z-index: 0;
}
.sec-banner-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.sec-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 26px;
}
.sec-banner-icon {
    width: 50px; height: 50px;
    border-radius: 14px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}
.sec-banner-text { flex: 1; min-width: 0; }
.sec-banner-text h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 3px;
}
.sec-banner-text p {
    font-size: .8rem;
    color: rgba(255,255,255,.7);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark .sec-banner-bg {
    background: linear-gradient(135deg, color-mix(in srgb, var(--sb-color) 60%, #0f172a) 0%, color-mix(in srgb, var(--sb-color) 35%, #0f172a) 100%);
}
@media (max-width: 768px) {
    .sec-banner-content { padding: 16px 18px; gap: 12px; }
    .sec-banner-icon { width: 42px; height: 42px; font-size: 1.1rem; border-radius: 10px; }
    .sec-banner-text h2 { font-size: 1rem; }
    .sec-banner-content { padding: 16px 18px; gap: 12px; }
    .sec-banner-text p { white-space: normal; }
}

.feat-section { padding: 48px 0 0; }
.highlight-cats-section { padding-top: 24px; padding-bottom: 0; }
.categories-section { padding-top: 24px; padding-bottom: 24px; }
.challenges-section { padding-top: 24px; }

.feat-header {
    text-align: center;
    margin-bottom: 36px;
}
.feat-header-icon {
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
    box-shadow: 0 6px 24px rgba(245,158,11,.35);
    transform: rotate(-6deg);
}
.feat-header-title {
    font-size: 1.55rem; font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.feat-header-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 480px; margin: 0 auto;
}

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

.feat-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: all .35s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    text-decoration: none;
}
.feat-card-shine {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.12) 50%, transparent 60%);
    background-size: 300% 300%;
    background-position: 100% 100%;
    transition: background-position .6s ease;
    pointer-events: none; z-index: 1;
}
.feat-card:hover .feat-card-shine {
    background-position: 0 0;
}
.feat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px color-mix(in srgb, var(--tc) 18%, rgba(0,0,0,.12));
    border-color: color-mix(in srgb, var(--tc) 35%, #e2e8f0);
}

.feat-card-top {
    position: relative;
    padding: 28px 20px 22px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 8%, #fff), color-mix(in srgb, var(--tc) 3%, #fff));
    display: flex; align-items: flex-start; justify-content: space-between;
}
.feat-card-top::after {
    content: '';
    position: absolute; bottom: 0; right: 0; left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tc) 18%, transparent), transparent);
}

.feat-card-icon {
    width: 54px; height: 54px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--tc), color-mix(in srgb, var(--tc) 75%, #000));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--tc) 35%, rgba(0,0,0,.15));
    transition: transform .35s ease, box-shadow .35s ease;
}
.feat-card:hover .feat-card-icon {
    transform: scale(1.1) rotate(-4deg);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--tc) 45%, rgba(0,0,0,.2));
}

.feat-card-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff; font-size: .65rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(245,158,11,.3);
    animation: feat-badge-pulse 2.5s ease-in-out infinite;
}
@keyframes feat-badge-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(245,158,11,.3); }
    50% { box-shadow: 0 2px 16px rgba(245,158,11,.55); }
}

.feat-card-body {
    padding: 18px 20px 14px;
    flex: 1;
}
.feat-card-name {
    font-size: 1rem; font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.4;
    transition: color .3s;
}
.feat-card:hover .feat-card-name { color: var(--tc); }

.feat-card-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.feat-card-footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between;
}
.feat-card-cat {
    font-size: 0.76rem; font-weight: 500;
    color: var(--tc);
    background: var(--tbg);
    padding: 3px 12px;
    border-radius: 50px;
    display: flex; align-items: center; gap: 5px;
}
.feat-card-arrow {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; color: #94a3b8;
    transition: all .3s;
}
.feat-card:hover .feat-card-arrow {
    background: var(--tc); color: #fff;
    transform: translateX(-4px);
}
[dir="ltr"] .feat-card:hover .feat-card-arrow,
html:not([dir="rtl"]) .feat-card:hover .feat-card-arrow {
    transform: translateX(4px);
}

/* Featured - Dark mode */
body.dark .feat-header-title { color: #f1f5f9; }
body.dark .feat-header-desc { color: #64748b; }
body.dark .feat-card {
    background: rgba(30,41,59,.85);
    border-color: #1e3a5f;
    backdrop-filter: blur(10px);
}
body.dark .feat-card:hover {
    border-color: color-mix(in srgb, var(--tc) 50%, transparent);
    box-shadow: 0 16px 48px color-mix(in srgb, var(--tc) 12%, rgba(0,0,0,.4));
}
body.dark .feat-card-top {
    background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 10%, #1e293b), color-mix(in srgb, var(--tc) 4%, #0f172a));
}
body.dark .feat-card-top::after {
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tc) 15%, transparent), transparent);
}
body.dark .feat-card-shine {
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.04) 50%, transparent 60%);
    background-size: 300% 300%;
    background-position: 100% 100%;
}
body.dark .feat-card-name { color: #f1f5f9; }
body.dark .feat-card:hover .feat-card-name { color: var(--tc); }
body.dark .feat-card-desc { color: #94a3b8; }
body.dark .feat-card-footer { border-color: #1e3a5f; }
body.dark .feat-card-cat {
    background: color-mix(in srgb, var(--tc) 12%, #0f172a);
    color: var(--tc);
}
body.dark .feat-card-arrow { background: #1e3a5f; color: #94a3b8; }
body.dark .feat-card:hover .feat-card-arrow { background: var(--tc); color: #fff; }
body.dark .feat-card-icon {
    box-shadow: 0 4px 20px color-mix(in srgb, var(--tc) 30%, rgba(0,0,0,.4));
}

.tools-section { }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

.tool-card:hover {
    border-color: var(--blue-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-blue);
}

.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.tool-currency  { background: #fef3c7; }
.tool-gold      { background: #fef9c3; }
.tool-pregnancy { background: #fce7f3; }
.tool-zakat     { background: #d1fae5; }
.tool-pdf       { background: #fee2e2; }
.tool-image     { background: #dbeafe; }

.tool-info { flex: 1; min-width: 0; }

.tool-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.4;
}

.tool-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 10px;
}

.tool-tag {
    display: inline-block;
    background: var(--blue-pale);
    color: var(--blue);
    border: 1px solid var(--border-dark);
    padding: 2px 11px;
    border-radius: 50px;
    font-size: 0.74rem;
    font-weight: 500;
}



.mega-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 16px;
}

.mega-col { display: flex; flex-direction: column; gap: 2px; }

.mega-col-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}


/* ============================
   TOOLS - NEW ICONS
============================ */
.tool-ai  { background: #ede9fe; }
.tool-bmi { background: #dcfce7; }

/* ============================
   DIGITAL TOOLS SECTION
============================ */
.digital-section {
}

.digital-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.digital-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.digital-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-blue);
    border-color: var(--blue-light);
}

.digital-preview {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    transition: transform var(--transition);
}

.digital-card:hover .digital-preview i { transform: scale(1.15); }

.digital-preview--qr       { background: linear-gradient(135deg, #e0f2fe, #bae6fd); color: #0369a1; }
.digital-preview--barcode  { background: linear-gradient(135deg, #f0fdf4, #bbf7d0); color: #15803d; }
.digital-preview--password { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.digital-preview--color    { background: linear-gradient(135deg, #fae8ff, #e9d5ff); color: #7e22ce; }
.digital-preview--uuid     { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #be123c; }
.digital-preview--username { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4338ca; }

.digital-info {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.digital-name {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-primary);
}

.digital-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.digital-action {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    transition: gap var(--transition);
}

.digital-card:hover .digital-action { gap: 10px; }

/* ============================
   CHALLENGES SECTION
============================ */
.challenges-section {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.challenge-card {
    position: relative;
    border-radius: var(--radius);
    padding: 28px 22px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
    text-decoration: none;
}


.challenge-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(0,0,0,0.2); }

.challenge-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.3);
}

.challenge-icon {
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
}

.challenge-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.challenge-desc {
    font-size: 0.84rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    flex: 1;
}

.challenge-btn {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.35);
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 4px;
    transition: background var(--transition);
}

.challenge-card:hover .challenge-btn { background: rgba(255,255,255,0.35); }

.challenge-hidden { display: none; }
.challenges-expanded .challenge-hidden { display: flex; }

.challenges-more-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 20px auto 0; padding: 10px 28px;
    border: 2px dashed rgba(139,92,246,.35);
    border-radius: 50px; background: rgba(139,92,246,.06);
    color: #7c3aed; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: all .25s;
}
.challenges-more-btn:hover { background: rgba(139,92,246,.13); border-color: rgba(139,92,246,.5); }
.challenges-more-btn i { font-size: .7rem; transition: transform .2s; }
.challenges-more-btn:hover i { transform: translateY(2px); }
body.dark .challenges-more-btn { border-color: rgba(139,92,246,.3); background: rgba(139,92,246,.08); color: #a78bfa; }
body.dark .challenges-more-btn:hover { background: rgba(139,92,246,.15); }

/* Nav challenges highlight */
.nav-challenges { color: #ea580c !important; }
.nav-challenges:hover { background: #fff7ed !important; }

/* ============================
   CATS BAR (before footer)
============================ */
.cats-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.cats-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.cats-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.cats-bar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}
.cats-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--cb);
    color: var(--c);
    border: 1px solid color-mix(in srgb, var(--c) 20%, transparent);
    text-decoration: none;
    transition: background .15s, transform .15s, box-shadow .15s;
    white-space: nowrap;
}
.cats-bar-item:hover {
    background: var(--c);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px color-mix(in srgb, var(--c) 30%, transparent);
}
.cats-bar-item i { font-size: .72rem; }

@media (max-width: 768px) {
    .cats-bar { padding: 12px 0; }
    .cats-bar-label { display: none; }
    .cats-bar-list { gap: 6px; }
    .cats-bar-item { font-size: .72rem; padding: 4px 10px; }
}

/* ============================
   HOME CATEGORY SECTIONS
============================ */
.home-cat-section { padding: 28px 0; }

/* ── Category banner ── */
.home-cat-banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.home-cat-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--cat-color) 0%, color-mix(in srgb, var(--cat-color) 70%, #000) 100%);
    z-index: 0;
}
.home-cat-banner-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.home-cat-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
}
.home-cat-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}
.home-cat-banner-text {
    flex: 1;
    min-width: 0;
}
.home-cat-banner-text h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
}
.home-cat-banner-text p {
    font-size: .8rem;
    color: rgba(255,255,255,.7);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-cat-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 50px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
}
.home-cat-banner-btn:hover {
    background: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.5);
    transform: translateY(-1px);
}
[dir="ltr"] .home-cat-banner-btn i { transform: scaleX(-1); }

/* ── Tools grid ── */
.home-cat-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.home-cat-tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: border-color .3s, box-shadow .3s, transform .3s;
}
.home-cat-tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color) 4%, transparent), transparent 60%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.home-cat-tool-card:hover::before { opacity: 1; }
.home-cat-tool-card:hover {
    border-color: color-mix(in srgb, var(--cat-color) 40%, transparent);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--cat-color) 12%, transparent), 0 2px 8px rgba(0,0,0,.04);
    transform: translateY(-3px);
}

.home-cat-tool-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: linear-gradient(145deg, var(--cat-bg), color-mix(in srgb, var(--cat-bg) 70%, #fff));
    color: var(--cat-color);
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 3px 12px color-mix(in srgb, var(--cat-color) 15%, transparent);
    transition: transform .3s, box-shadow .3s;
}
.home-cat-tool-card:hover .home-cat-tool-icon {
    transform: scale(1.1);
    box-shadow: 0 5px 18px color-mix(in srgb, var(--cat-color) 25%, transparent);
}

.home-cat-tool-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}
.home-cat-tool-info h3 {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s;
}
.home-cat-tool-card:hover .home-cat-tool-info h3 { color: var(--cat-color); }
.home-cat-tool-info p {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-cat-tool-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cat-color) 10%, transparent);
    color: var(--cat-color);
    font-size: .7rem;
    flex-shrink: 0;
    transition: all .3s;
    position: relative;
}
.home-cat-tool-action span { display: none; }
.home-cat-tool-card:hover .home-cat-tool-action {
    background: var(--cat-color);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--cat-color) 30%, transparent);
}
[dir="ltr"] .home-cat-tool-action i { transform: scaleX(-1); }

.home-cat-soon-badge {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    font-size: .62rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 50px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    z-index: 2;
    letter-spacing: .3px;
}
.home-cat-tool-card--soon { opacity: .55; }

.home-cat-tool-hidden { display: none; }
.home-cat-expanded .home-cat-tool-hidden { display: flex; }

.home-cat-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed color-mix(in srgb, var(--cat-color) 30%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--cat-color) 4%, transparent);
    color: var(--cat-color);
    font-size: .85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}
.home-cat-more-btn:hover {
    background: color-mix(in srgb, var(--cat-color) 10%, transparent);
    border-color: var(--cat-color);
    transform: translateY(-1px);
}
.home-cat-more-btn i { font-size: .7rem; transition: transform .2s; }
.home-cat-more-btn:hover i { transform: translateY(2px); }
body.dark .home-cat-more-btn { border-color: color-mix(in srgb, var(--cat-color) 30%, #1e3a5f); background: color-mix(in srgb, var(--cat-color) 8%, transparent); }

/* Reveal animation */
.reveal-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal-section.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-child {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity .5s ease, transform .5s ease;
    transition-delay: var(--delay, 0s);
}
.revealed .reveal-child {
    opacity: 1;
    transform: translateY(0);
}

/* ── Highlight Categories (pinned, 3 per row) ── */
.highlight-cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.hcat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all .3s ease;
    box-shadow: var(--shadow-card);
}
.hcat-card:hover {
    transform: translateY(-4px);
    border-color: var(--cat-color);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--cat-color) 15%, transparent);
}
.hcat-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--cat-bg), color-mix(in srgb, var(--cat-bg) 60%, #fff));
    color: var(--cat-color);
    transition: all .35s ease;
}
.hcat-card:hover .hcat-preview {
    background: linear-gradient(135deg, var(--cat-color), color-mix(in srgb, var(--cat-color) 80%, #000));
    color: #fff;
}
.hcat-card:hover .hcat-preview i { transform: scale(1.15); }
.hcat-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.hcat-name {
    font-size: .97rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    transition: color .3s ease;
}
.hcat-card:hover .hcat-name { color: var(--cat-color); }
.hcat-count {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0;
}
.hcat-action {
    font-size: .82rem;
    font-weight: 600;
    color: var(--cat-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    transition: gap .3s ease;
}
.hcat-action i {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    background: var(--cat-bg);
    color: var(--cat-color);
    transition: all .3s ease;
}
.hcat-card:hover .hcat-action i {
    background: var(--cat-color);
    color: #fff;
    transform: translateX(-4px);
}
[dir="rtl"] .hcat-card:hover .hcat-action i {
    transform: translateX(4px);
}
.hcat-card:hover .hcat-action { gap: 10px; }

body.dark .hcat-card { background: var(--bg-card); border-color: var(--border); }
body.dark .hcat-card:hover { border-color: var(--cat-color); }
body.dark .hcat-preview { background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color) 15%, #1e293b), color-mix(in srgb, var(--cat-color) 8%, #1e293b)); }

@media (max-width: 768px) {
    .highlight-cats-grid { grid-template-columns: 1fr; }
    .hcat-preview { height: 100px; font-size: 2.2rem; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .highlight-cats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Dark mode */
body.dark .home-cat-tool-card { background: rgba(30,41,59,.7); border-color: #1e3a5f; backdrop-filter: blur(8px); }
body.dark .home-cat-tool-card:hover { border-color: color-mix(in srgb, var(--cat-color) 50%, transparent); }
body.dark .home-cat-tool-card::before { background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color) 8%, transparent), transparent 60%); }
body.dark .home-cat-tool-info h3 { color: #f1f5f9; }
body.dark .home-cat-tool-card:hover .home-cat-tool-info h3 { color: var(--cat-color); }
body.dark .home-cat-tool-info p { color: #94a3b8; }
body.dark .home-cat-tool-icon { background: linear-gradient(145deg, color-mix(in srgb, var(--cat-color) 18%, #1e293b), color-mix(in srgb, var(--cat-color) 10%, #0f172a)); box-shadow: 0 3px 12px color-mix(in srgb, var(--cat-color) 20%, rgba(0,0,0,.3)); }
body.dark .home-cat-tool-action { background: color-mix(in srgb, var(--cat-color) 15%, transparent); }
body.dark .home-cat-banner-bg { background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color) 80%, #0f172a) 0%, color-mix(in srgb, var(--cat-color) 50%, #0f172a) 100%); }

/* ============================
   FOOTER
============================ */
.footer {
    background: #0a1628;
    position: relative;
    overflow: hidden;
}
.footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../images/footer-pattern.svg');
    background-size: 1400px 1400px;
    background-repeat: repeat;
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}
.footer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 10% 0%, rgba(37,99,235,.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 400px at 90% 100%, rgba(37,99,235,.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.footer > * { position: relative; z-index: 1; }

/* Decorative shapes (hidden – replaced by SVG pattern) */
.footer-shape { display: none; }

.footer-wave {
    line-height: 0;
    margin-bottom: -1px;
}
.footer-wave svg { width: 100%; height: 50px; display: block; }

/* Grid */
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 48px 0 40px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Brand */
.footer-logo-link { display: inline-block; transition: opacity .2s; }
.footer-logo-link:hover { opacity: .8; }
.footer-logo { max-height: 42px; width: auto; margin-bottom: 14px; display: block; }

.footer-tagline {
    color: rgba(255,255,255,.55);
    font-size: 0.84rem;
    line-height: 1.75;
    max-width: 260px;
    margin-bottom: 22px;
    font-weight: 500;
}

.footer-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.5);
    font-size: .83rem;
    font-weight: 600;
}
.footer-feature i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(96,165,250,.12);
    color: var(--blue-light);
    font-size: .7rem;
    flex-shrink: 0;
}

/* Columns */
.footer-col-title {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.footer-col-title i { font-size: .72rem; color: var(--blue-light); opacity: .8; }

.footer-col-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.footer-col-list li a {
    color: rgba(255,255,255,.5);
    font-size: 0.83rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .2s, padding-inline-start .2s;
    text-decoration: none;
    padding: 3px 0;
}
.footer-col-list li a i { font-size: .7rem; opacity: .5; width: 14px; text-align: center; flex-shrink: 0; }
.footer-col-list li a:hover {
    color: #fff;
    padding-inline-start: 5px;
}
.footer-col-list li a:hover i { opacity: 1; color: var(--blue-light); }
.footer-highlight-link { color: var(--blue-light) !important; font-weight: 700 !important; }
.footer-highlight-link:hover { color: #fff !important; }

/* Language picker */
.footer-lang-wrap { position: relative; margin-top: 22px; }
.footer-lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
    font-size: .85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
}
.footer-lang-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.footer-lang-flag { font-size: 1.1rem; line-height: 1; }
.footer-lang-name { flex: 1; text-align: start; }
.footer-lang-arrow { font-size: .6rem; opacity: .5; transition: transform .25s; }
.footer-lang-wrap.open .footer-lang-arrow { transform: rotate(180deg); }

.footer-lang-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 200px;
    background: #111d30;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 -8px 30px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s ease;
    z-index: 50;
}
.footer-lang-wrap.open .footer-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255,255,255,.6);
    font-size: .84rem;
    font-weight: 600;
    transition: all .15s;
}
.footer-lang-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.footer-lang-item--active { color: var(--blue-light); background: rgba(96,165,250,.1); }
.footer-lang-item-flag { font-size: 1.05rem; line-height: 1; }
.footer-lang-item-name { flex: 1; }
.footer-lang-item-check { font-size: .7rem; color: var(--blue-light); }

/* Bottom bar */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    color: rgba(255,255,255,.3);
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-bottom-start {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-bottom-logo { max-height: 28px; width: auto; opacity: .6; display: none; }
.footer-bottom-links { display: flex; align-items: center; gap: 8px; }
.footer-bottom-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.2); }
.footer-bottom-links a {
    color: rgba(255,255,255,.35);
    font-size: 0.8rem;
    font-weight: 500;
    transition: color .2s;
    text-decoration: none;
}
.footer-bottom-links a:hover { color: var(--blue-light); }

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 1024px) {
    .categories-grid { grid-template-columns: repeat(4, 1fr); }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .digital-grid { grid-template-columns: repeat(2, 1fr); }
    .challenges-grid { grid-template-columns: repeat(2, 1fr); }
    .home-cat-tools-grid { grid-template-columns: 1fr 1fr; }
    .mega-menu { width: 460px; }
    .mega-menu--wide { width: 560px; }
    .mega-cols { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-col-more { display: none; }
}

/* ============================
   MOBILE OVERLAY
============================ */
.mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 998;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mob-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================
   MOBILE MENU HEADER (li)
============================ */
.mob-menu-header {
    width: 100%;
    padding: 0 !important;
    flex-shrink: 0;
}

.mob-menu-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.mob-menu-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    direction: ltr;
}

.mob-menu-close {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: background 0.2s;
}

.mob-menu-close i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
}

.mob-menu-close:hover { background: var(--border); }

/* ============================
   MOBILE ONLY ELEMENTS (hidden on desktop)
============================ */
.mob-icon        { display: none; }
.mob-menu-header { display: none; }
.mob-overlay     { display: none; }

@media (max-width: 768px) {
    .nav-container { justify-content: space-between; height: 56px; padding: 0 12px; }

    /* hamburger يمين، شعار وسط، controls يسار */
    .menu-toggle  { order: 1; display: flex; flex-shrink: 0; }
    .logo         { order: 2; position: static; transform: none; margin: 0 auto; border: none; padding: 4px 6px; }
    .logo-img     { height: 30px; }
    .nav-controls { order: 3; flex-shrink: 0; gap: 4px; }

    .lang-btn span#langLabel { display: none; }
    .lang-btn { padding: 5px 8px; gap: 3px; min-width: auto; font-size: .78rem; }
    .lang-btn-flag { font-size: 1.1rem; }
    .lang-btn .nav-arrow { display: none; }
    .lang-dropdown { left: 0; right: auto; }

    .dark-switch-track { width: 40px; height: 22px; }
    .dark-switch-thumb { width: 16px; height: 16px; }
    .dark-switch input:checked + .dark-switch-track .dark-switch-thumb { transform: translateX(-18px); }
    .dark-icon-sun, .dark-icon-moon { font-size: .6rem; }

    /* إظهار عناصر الموبايل فقط */
    .mob-menu-header { display: block; }
    .mob-overlay.active { display: block; }
    .nav-mob-only { display: block; }
    /* إخفاء الأقسام الرئيسية في الموبايل */
    .nav-desk-only { display: none; }

    /* ---- ألوان الأقسام ---- */
    .mob-gold    { --mc: #d97706; --mb: #fef3c7; }
    .mob-green   { --mc: #059669; --mb: #d1fae5; }
    .mob-pink    { --mc: #db2777; --mb: #fce7f3; }
    .mob-red     { --mc: #dc2626; --mb: #fee2e2; }
    .mob-indigo  { --mc: #4f46e5; --mb: #e0e7ff; }
    .mob-emerald { --mc: #16a34a; --mb: #dcfce7; }
    .mob-cyan    { --mc: #0891b2; --mb: #cffafe; }
    .mob-rose    { --mc: #e11d48; --mb: #ffe4e6; }

    /* ---- Panel ---- */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 310px;
        height: 100vh;
        background: var(--bg-primary, #f0f5ff);
        border-left: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 0;
        transition: right 0.32s cubic-bezier(0.4,0,0.2,1);
        z-index: 999;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -8px 0 32px rgba(0,0,0,0.15);
        scrollbar-width: thin;
        scrollbar-color: var(--border-dark) transparent;
    }

    .nav-links.active { right: 0; }
    .nav-links > li { width: 100%; }
    .nav-links > li.has-mega { position: relative; }

    /* ---- رئيسية (plain item) ---- */
    .nav-links > li:not(.has-mega):not(.mob-menu-header) > a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 13px 16px;
        color: var(--text-secondary);
        font-size: 0.9rem;
        font-weight: 600;
        border-bottom: 1px solid var(--border);
        background: var(--bg-card);
        transition: background 0.2s;
    }

    .nav-links > li:not(.has-mega):not(.mob-menu-header) > a .mob-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px; height: 30px;
        border-radius: 8px;
        background: var(--blue-pale);
        color: var(--blue);
        font-size: 0.82rem;
        flex-shrink: 0;
    }

    /* ---- Category header ---- */
    .has-mega > a {
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 13px 16px !important;
        width: 100%;
        font-size: 0.88rem;
        font-weight: 600;
        border-bottom: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text-primary) !important;
        transition: background 0.2s;
        justify-content: flex-start !important;
    }

    .has-mega > a:hover { background: var(--bg-primary); }

    /* أيقونة القسم على الهاتف */
    .nav-cat-icon { width:30px;height:30px;border-radius:8px;font-size:0.85rem; }
    .mob-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px; height: 28px;
        border-radius: 7px;
        background: var(--mb, var(--blue-pale));
        color: var(--mc, var(--blue));
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    /* السهم يُدفع لليسار */
    .has-mega > a .nav-arrow {
        margin-right: auto !important;
        opacity: 0.4;
        color: var(--text-muted);
        transition: transform 0.3s ease, opacity 0.2s;
    }

    .has-mega.open > a .nav-arrow {
        transform: rotate(180deg);
        opacity: 0.7;
    }

    /* ---- Mega menu accordion ---- */
    .mega-menu {
        position: static;
        width: 100%;
        border: none;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
    }

    .mega-menu::before,
    .mega-menu::after { display: none; }

    .mega-menu.open { max-height: 700px; }

    /* ---- Mega inner ---- */
    .mega-inner { padding: 4px 0 6px; }

    .mega-heading { display: none; }

    /* ---- Mega items — قائمة بسيطة ---- */
    .mega-grid {
        display: flex;
        flex-direction: column;
    }

    .mega-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 20px;
        color: var(--text-secondary);
        font-size: 0.85rem;
        border-bottom: 1px solid var(--border);
        transition: background 0.15s, color 0.15s;
    }

    .mega-item:last-child { border-bottom: none; }

    .mega-item:hover {
        background: var(--bg-card);
        color: var(--mc, var(--blue));
    }

    .mega-icon {
        width: 26px; height: 26px;
        border-radius: 6px;
        background: var(--mb, var(--blue-pale));
        color: var(--mc, var(--blue));
        font-size: 0.75rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mega-item strong { font-size: 0.83rem; font-weight: 500; color: inherit; }
    .mega-item small  { display: none; }

    /* mega cols (تقنية) */
    .mega-menu--wide { width: 100%; }
    .mega-cols { display: flex; flex-direction: column; gap: 0; }
    .mega-col { display: flex; flex-direction: column; }
    .mega-col-title {
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--text-muted);
        padding: 8px 20px 4px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }

    .hero { padding: 80px 0 0; min-height: auto; }
    .hero-floaters { display: none; }
    .hero-features { gap: 14px; }
    .hero-feat { font-size: .78rem; }
    .hero-strip-item { min-width: 90px; padding: 16px 10px; font-size: .72rem; }
    .hero-strip-item i { font-size: .9rem; }

    .search-wrapper { padding: 4px 4px 4px 14px; }
    .search-input { font-size: .88rem; padding: 10px 8px; }
    .search-btn { width: 40px; height: 40px; font-size: .88rem; }

    .hero-trending-label { width: 100%; justify-content: center; }

    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-grid { grid-template-columns: 1fr; }
    .digital-grid { grid-template-columns: 1fr; }
    .challenges-grid { grid-template-columns: 1fr; }
    .home-cat-tools-grid { grid-template-columns: 1fr; }
    .home-cat-banner-content { flex-wrap: wrap; padding: 16px 18px; gap: 12px; }
    .home-cat-banner-icon { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 10px; }
    .home-cat-banner-text h2 { font-size: 1rem; }
    .home-cat-banner-text p { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .home-cat-banner-btn { width: 100%; justify-content: center; padding: 10px; }
    .mega-menu--wide { width: 100%; }
    .mega-cols { grid-template-columns: 1fr; }

    /* Footer — mobile */
    .footer-wave  { display: none; }
    .footer-grid  { grid-template-columns: 1fr; gap: 24px; padding: 28px 0 24px; }
    .footer-brand { text-align: center; }
    .footer-brand .footer-tagline { max-width: 100%; text-align: center; }
    .footer-features { flex-direction: row; justify-content: center; gap: 16px; }
    .footer-feature { font-size: .78rem; }
    .footer-brand .footer-logo-link { display: flex; justify-content: center; }
    .footer-col-more { display: none; }
    .footer-col-list { flex-direction: row; flex-wrap: wrap; gap: 4px 0; }
    .footer-col-list li { width: 50%; }
    .footer-col-list li a { font-size: .8rem; padding: 4px 0; }
    .footer-lang-wrap { width: 100%; }
    .footer-lang-dropdown { min-width: 100%; }
    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 18px 0 14px;
        font-size: .76rem;
        border-top: none;
    }
    .footer-bottom-logo  { display: block; }
    .footer-bottom-links { flex-wrap: wrap; justify-content: center; gap: 6px; }
    .footer-bottom-dot { display: none; }
}

@media (max-width: 420px) {
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-card { padding: 20px 8px 16px; }
}

/* ============================
   LTR OVERRIDES (non-Arabic)
============================ */

/* Language dropdown — يفتح من اليمين في LTR */
html[dir="ltr"] .lang-dropdown {
    left: auto;
    right: 0;
    transform-origin: top right;
}
html[dir="ltr"] .lang-dropdown::before {
    left: auto;
    right: 20px;
}
html[dir="ltr"] .lang-dropdown::after {
    left: auto;
    right: 21px;
}

/* Checkmark في عنصر اللغة النشط */
html[dir="ltr"] .lang-item--active::after {
    margin-right: unset;
    margin-left: auto;
}

/* سهم القسم في القائمة — يُدفع لليمين */
html[dir="ltr"] .has-mega > a .nav-arrow {
    margin-right: unset !important;
    margin-left: auto !important;
}

/* الشريط الجانبي للموبايل — يظهر من اليسار */
@media (max-width: 768px) {
    html[dir="ltr"] .nav-links {
        right: auto;
        left: -100%;
        border-left: none;
        border-right: 1px solid var(--border);
        box-shadow: 8px 0 32px rgba(0,0,0,0.15);
        transition: left 0.32s cubic-bezier(0.4,0,0.2,1);
    }
    html[dir="ltr"] .nav-links.active {
        left: 0;
    }
}
