/* ========================================================
   1. LAYOUT RESET & CORE BOUNDS
   ======================================================== */
html, body {
    overflow-x: hidden !important;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
html {
    scroll-behavior: smooth;
}
#about, #contact {
    scroll-margin-top: 100px;
}

/* Base Utilities */
.desktop-only { display: block; }
.mobile-only-login { display: none; }

/* Navbar Fixed Position Wrapper */
.navbar-container {
    position: fixed;
    top: 20px; 
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; 
    padding: 0 20px;
}

/* Pill Shape Navbar Main Body */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.85); 
    width: 100%;
    max-width: 1300px; 
    padding: 12px 30px;
    border-radius: 50px; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05); 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
}

.logo {
    font-size: 25px;
    font-weight: 600;
    color: #1e3a5f;
    cursor: pointer;
}

/* Base Nav Links Layout */
.nav-links {
    display: flex;
    list-style: none;
    gap: 25px; 
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    text-decoration: none;
    color: #4a5568;
    font-size: 17px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links li a:hover, 
.nav-links li a.active {
    color: #007bff;
}

.nav-btn {
    margin-left: 25px;
}

.login-btn {
    text-decoration: none;
    background-color: #007bff; 
    color: white;
    padding: 10px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.login-btn:hover {
    background-color: #0056b3; 
    transform: scale(1.02);
}

/* Hamburger Structure */
.hamburger { 
    display: none; 
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 2000;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #1e3a5f;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* ========================================================
   2. DESKTOP SPECIFIC RULES (>= 992px Viewport)
   ======================================================== */
@media (min-width: 992px) {
    .hamburger { display: none !important; }
    
    .nav-links li { 
        position: relative; 
    }
    
    /* Strict Hidden States - Eliminates Dropdown Overflowing */
    .dropdown-menu,
    .dropdown-submenu .sub-course-menu {
        display: none; 
        position: absolute;
        background: #ffffff;
        min-width: 350px;
        padding: 10px 0;
        border-radius: 12px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 1500;
        list-style: none;
        margin: 0;
    }
	
	.nav-item.dropdown{
    position: relative;
}

.nav-item.dropdown::before{
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 15px;
}

    .dropdown-menu {
        top: 100%;
        left: 0;
        margin-top: 15px;
    }
    
    .dropdown-submenu { 
        position: relative; 
    }

    .dropdown-submenu .sub-course-menu {
        top: 0;
        left: 100%;
        margin-left: 2px;
    }

    /* JavaScript Desktop Active Class Hooks */
    .nav-item.dropdown.desktop-hover > .dropdown-menu,
    .dropdown-submenu.desktop-hover > .sub-course-menu { 
        display: block !important;
    }
    
    /* Flyout boundary fixer */
    .dropdown-submenu:nth-last-child(-n+4) .sub-course-menu {
        top: auto;
        bottom: 0;
    }

    .dropdown-item {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        color: #4a5568;
        text-decoration: none;
        font-size: 15px;
        transition: background 0.2s ease, color 0.2s ease;
    }
    
    .dropdown-item:hover { 
        background: #f7fafc; 
        color: #007bff; 
    }
    
    .submenu-arrow { 
        font-size: 14px; 
        color: #a0aec0; 
    }
}

.dropdown-submenu{
    position: relative;
}

/* Category aur submenu ke beech ka invisible bridge */
.dropdown-submenu::before{
    content: "";
    position: absolute;
    top: 0;
    left: 100%;
    width: 12px;   
    height: 100%;
}

/* ========================================================
   3. MOBILE & TABLET RULES (<= 991px Viewport)
   ======================================================== */
@media (max-width: 991px) {
    .desktop-only { display: none !important; }
    .mobile-only-login { display: block !important; width: 100%; text-align: center; margin-top: 10px; }
    
    .navbar-container { top: 10px; padding: 0 15px; }
    .navbar { padding: 10px 20px; border-radius: 30px; }
    .logo { font-size: 24px; }
    
    .hamburger { display: flex !important; }
    
    /* Toggle Hamburger Shapes */
    .hamburger.toggle-active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .hamburger.toggle-active span:nth-child(2) { opacity: 0; }
    .hamburger.toggle-active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

    /* Mobile Drawer Box Base */
    .nav-links {
        display: none !important;
        position: absolute;
        top: 65px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 10px);
        background: #ffffff;
        border-radius: 20px;
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        box-shadow: 0 15px 35px rgba(0,0,0,.15);
        max-height: 70vh;
        overflow-y: auto;
        box-sizing: border-box;
    }

    .nav-links.show-drawer {
        display: flex !important;
    }

    .nav-links li { width: 100% !important; }
    .nav-links li > a { 
        display: flex !important; 
        justify-content: space-between; 
        align-items: center; 
        width: 100%; 
        padding: 10px 0; 
        font-size: 16px; 
    }
    
    /* Mobile Accordion Dropdown Systems */
	
    .dropdown-menu {
        display: none !important;
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        margin-top: 5px;
        padding: 5px 0;
        background: #f8f9fb;
        border-radius: 12px;
        box-shadow: none !important;
        border: none !important;
    }

    .sub-course-menu {
        display: none !important;
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        margin-top: 5px;
        padding-left: 15px;
        border-left: 2px solid #007bff !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0;
    }

    /* JavaScript Mobile Active States Mapping */
    .nav-item.dropdown.mobile-open > .dropdown-menu,
    .dropdown-submenu.mobile-open > .sub-course-menu { 
        display: block !important; 
    }
    
    .nav-item.dropdown.mobile-open .arrow-down { transform: rotate(180deg); display: inline-block; transition: transform 0.2s; }
    .dropdown-submenu.mobile-open .submenu-arrow { transform: rotate(90deg); display: inline-block; color: #007bff; transition: transform 0.2s; }
    
    .dropdown-item {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        color: #333;
        text-decoration: none;
        font-size: 15px;
    }
    
    .mobile-only-login .login-btn {
        display: block; background: #007bff; color: #fff; text-align: center; padding: 12px; border-radius: 25px; font-weight: 600;
    }
}

@media screen and (min-width: 769px) and (max-width: 991px) {
    .nav-links { width: 92%; top: 70px; }
}