/* ═══════════════════════════════════════════════════════════════════════
   🎨 MODERN TWO-LEVEL NAVBAR - FAISAL ACADEMY
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══ UNIVERSAL FONT - NOTO KUFI ARABIC ═══ */
* {
    font-family: 'Noto Kufi Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
}

body,
html,
input,
textarea,
select,
button,
.nav-link,
.dropdown-link,
.mobile-nav-link,
h1, h2, h3, h4, h5, h6,
p, span, div, a {
    font-family: 'Noto Kufi Arabic', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ─────────────────────────────────────────────────────────────────────── 
   🔝 TOP NAVBAR: Logo + Search + Beta Tag
   ─────────────────────────────────────────────────────────────────────── */
.faisal-top-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1100;
}

.top-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.top-nav-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-nav-section.left-section {
    flex: 1;
    justify-content: flex-start;
}

.top-nav-section.center-section {
    flex-shrink: 0;
}

.top-nav-section.right-section {
    flex: 1;
    justify-content: flex-end;
}

/* Logo in Top Nav */
.top-nav-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.top-nav-brand-link:hover {
    transform: scale(1.05);
}

.top-nav-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
}

/* Beta Tag in Center */
.beta-tag-top {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Contact Info (moved to left after logo/search) */
.contact-info-group {
    display: flex;
    gap: 15px;
    margin-left: 20px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.contact-info-item:hover {
    color: white;
}

.contact-info-item .icon {
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────── 
   🎯 MAIN NAVBAR: Logo + Centered Menu
   ─────────────────────────────────────────────────────────────────────── */
.navbar-main-level {
    background: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-main-level .navbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 70px;
    padding: 10px 0;
}

/* Logo Section in Navbar */
.navbar-brand-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.navbar-brand-section .brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar-brand-section .brand-link:hover {
    transform: scale(1.05);
}

.navbar-brand-section .brand-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.navbar-brand-section .beta-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────── 
   📋 DESKTOP MENU (Centered)
   ─────────────────────────────────────────────────────────────────────── */
.navbar-menu-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.navbar-menu-desktop .nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #667eea;
}

.nav-link .dropdown-icon {
    transition: transform 0.3s ease;
}

.nav-item.has-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* ─────────────────────────────────────────────────────────────────────── 
   📂 DROPDOWN MENUS (2-Column Layout)
   ─────────────────────────────────────────────────────────────────────── */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 10px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1060;
    
    /* 2-Column Layout */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

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

.dropdown-menu li {
    list-style: none;
}

.dropdown-link {
    display: block;
    padding: 12px 16px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.dropdown-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(-3px);
}

/* Single item dropdowns (not 2-column) */
.dropdown-menu li:only-child {
    grid-column: 1 / -1;
}

/* ─────────────────────────────────────────────────────────────────────── 
   📱 MOBILE MENU BUTTON
   ─────────────────────────────────────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    left: 20px;
    z-index: 1100;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover .hamburger-line {
    background: #667eea;
}

/* ─────────────────────────────────────────────────────────────────────── 
   📱 MOBILE MENU DRAWER
   ─────────────────────────────────────────────────────────────────────── */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-drawer.active {
    right: 0;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-logo-section .mobile-logo {
    height: 40px;
    width: auto;
}

.mobile-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-close-btn svg {
    color: white;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Mobile Navigation */
.mobile-nav {
    flex: 1;
    padding: 10px;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    margin-bottom: 5px;
}

.mobile-nav-link {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.mobile-nav-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Mobile Submenu */
.mobile-nav-item.has-children .mobile-nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-dropdown-toggle {
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.mobile-nav-item.active .mobile-dropdown-toggle {
    transform: rotate(180deg);
}

.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav-item.active .mobile-submenu {
    max-height: 500px;
}

.mobile-submenu-link {
    display: block;
    padding: 12px 20px 12px 40px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.mobile-submenu-link:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* ─────────────────────────────────────────────────────────────────────── 
   📱 RESPONSIVE BREAKPOINTS
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    /* Hide desktop menu */
    .navbar-menu-desktop {
        display: none;
    }
    
    /* Show mobile button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Adjust navbar for mobile */
    .navbar-main-level .navbar-wrapper {
        min-height: 60px;
        padding: 8px 0;
    }
    
    .navbar-brand-section .brand-logo {
        height: 50px;
    }
    
    .navbar-brand-section .beta-tag {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    /* Adjust top nav for mobile */
    .faisal-top-nav {
        padding: 10px 0;
    }
    
    .beta-tag-top {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    /* Hide contact info on mobile */
    .contact-info-group {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Navbar adjustments */
    .navbar-brand-section .brand-logo {
        height: 45px;
    }
    
    .navbar-brand-section .beta-tag {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    /* Stack top nav sections */
    .top-nav-container {
        flex-wrap: wrap;
    }
    
    .top-nav-section.left-section {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }
    
    .top-nav-section.center-section {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .top-nav-section.right-section {
        order: 2;
        width: auto;
    }
    
    .beta-tag-top {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .mobile-menu-drawer {
        width: 280px;
    }
}

/* ─────────────────────────────────────────────────────────────────────── 
   🔒 Z-INDEX HIERARCHY (Maintain Proper Stacking)
   ─────────────────────────────────────────────────────────────────────── */
.faisal-navbar {
    z-index: 1000 !important;
}

.navbar-bottom-level {
    z-index: 1000 !important;
}

.dropdown-menu {
    z-index: 1060 !important;
}

.mobile-menu-overlay {
    z-index: 9998 !important;
}

.mobile-menu-drawer {
    z-index: 9999 !important;
}

/* User dropdown (if exists) should be above everything */
.nav-user-account,
.user-dropdown-wrapper,
.user-dropdown-menu {
    z-index: 1150 !important;
}
