/* Navbar Styles */
.navbar {
    background: linear-gradient(90deg, #364aff 0%, #8c15e9 100%);
    width: -webkit-fill-available;
    display: flex;
    min-height: 80px;
    align-items: center;
    padding: 0 40px;
}

#navbar-container {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1002;
}

.schemaplus-logo {
    width: 150px;
    height: auto;
    display: block;
    margin-top: auto;
    margin-bottom: auto;
    flex: 1;
    cursor: pointer;
}

#pngLogo {
    display: none;
}

.url {
    margin-top: auto;
    margin-bottom: auto;
    flex: 1;
}

.inner-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: auto;
    flex: 1.5;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    transition: opacity 0.3s;
}

.navbar a:hover {
    opacity: 0.8;
}

/* Dropdown Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropbtn {
    background-color: transparent;
    color: white;
    padding: 8px 16px;
    font-size: 16px;
    border: 1px solid transparent;
    /* Transparent border by default to prevent layout shift */
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    display: inline-block;
    /* Ensure it works on anchor tags */
    text-decoration: none;
    /* Remove underline */
}

.nav-dropbtn:hover,
.nav-dropdown.active .nav-dropbtn {
    /* Active state for when dropdown is open */
    background-color: rgba(255, 255, 255, 0.1);
    /* Pill shape background */
    border-color: white;
    /* Visible border on hover */
    color: white;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background: linear-gradient(90deg, rgba(54, 74, 255, 0.87) 0%, rgba(48, 48, 48, 0.87) 126.49%);
    /* Dark blue/purple background */
    min-width: 600px;
    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.3);
    z-index: 1;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
    /* Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    margin-top: 10px;
    border-top: 0.8px solid rgba(173, 70, 255, 0.30);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mega-menu {
    min-width: 900px;
    /* Wider for 4 columns */
}

.nav-dropdown-content.show-dropdown {
    display: block;
}

.nav-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* Responsive columns */
    gap: 20px;
}

.nav-dropdown-item {
    display: flex;
    flex-direction: row;
    /* Icon next to text */
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    transition: background-color 0.3s;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none !important;
    /* Ensure no underline */
    position: relative;
}

.nav-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1 !important;
}

.nav-icon {
    margin-right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.1);
    /* Light transparent bg for icon */
    border-radius: 8px;
}

.nav-text {
    display: flex;
    flex-direction: column;
}

.nav-title {
    color: #ffffff;
    /* White text */
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.nav-desc {
    color: rgba(255, 255, 255, 0.7);
    /* Light grey text */
    font-size: 12px;
    line-height: 1.4;
}

/* Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    background: linear-gradient(90deg, #364aff 0%, #303030 100%);
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1000;
    padding-bottom: 30px;
    overflow-y: auto;
    border-bottom-left-radius: 0;
}

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

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    padding: 30px;
    gap: 15px;
    padding-bottom: 70px;
}

.mobile-dropbtn,
.mobile-link {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    padding: 10px 0;
    cursor: pointer;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    text-transform: none;
}

.mobile-dropbtn svg {
    transition: transform 0.3s ease;
}

.mobile-dropbtn.active svg {
    transform: rotate(180deg);
}

/* Mobile Dropdown Content */
.mobile-dropdown-content {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
    padding-left: 0;
    border-left: none;
    position: static !important;
    /* Ensure it takes up space in flow */
    height: auto !important;
    /* Allow expansion */
}

/* Mobile Nav Items (Cards) */
.mobile-dropdown-content .nav-dropdown-item,
.mobile-nested-trigger {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none !important;
    color: white;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.mobile-dropdown-content .nav-dropdown-item:hover,
.mobile-nested-trigger:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-dropdown-content .nav-icon {
    margin-right: 12px;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-dropdown-content .nav-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mobile-dropdown-content .nav-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.mobile-dropdown-content .nav-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.3;
}

/* Nested Items */
.mobile-nested-trigger .mobile-arrow {
    transition: transform 0.3s ease;
}

.mobile-nested-trigger.active .mobile-arrow {
    transform: rotate(180deg);
}

.nested-mobile-content {
    padding-left: 10px !important;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 10px;
}

.nested-mobile-content .nav-dropdown-item {
    background: transparent;
    border: none;
    padding: 8px 10px;
}

.nested-mobile-content .nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger {
    display: none;
    cursor: pointer;
    position: relative;
}

.hamburger.active path {
    stroke: white;
}

.navbar.mobile-active {
    background: linear-gradient(90deg, #364aff 0%, #303030 100%) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 2001 !important;
    position: relative;
}

@media (max-width: 900px) {
    #navbar-container {
        z-index: 2000 !important;
    }

    .inner-nav {
        display: none;
    }

    .hamburger {
        display: block;
    }
}

.has-sub-dropdown {
    position: relative;
    overflow: visible !important;
}

.sub-dropdown-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: absolute;
    left: -60%;
    top: 60px;
    background: linear-gradient(90deg, rgba(54, 74, 255, 1) 0%, rgba(48, 48, 48, 1) 126.49%);
    /* Slightly more opaque */
    min-width: 500px;
    /* Wider for grid */
    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 15px;
    /* Spacing from parent */

    /* Animation State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-sub-dropdown:hover .sub-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Bridge to prevent mouse-off closing */
.has-sub-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    right: -20px;
    /* Extend to cover gap */
    width: 20px;
    height: 100%;
    background: transparent;
}

/* Sub-dropdown Item Styling */
.sub-dropdown-content .nav-dropdown-item {
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    /* Matched to parent */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Matched to parent */
    color: white;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    /* Ensure block display for grid items */
}

.sub-dropdown-content .nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    /* Subtle slide effect */
    border-color: rgba(255, 255, 255, 0.2);
}

.has-sub-dropdown:hover::after {
    transform: rotate(45deg) translateX(3px);
}

@media (max-width: 1471px) {
    .mega-menu {
        min-width: 380px;
    }
}