/* Navbar Styles - Using Bootstrap with minimal custom CSS */
.navbar {
    font-family: 'Poppins', sans-serif;
}

/* Center navigation links using flex */
.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Logo */
.navbar-logo {
    height: 50px;
    width: auto;
}

/* Navigation Links */
.navbar-nav .nav-link {
    font-size: 16px;
    line-height: 1.8;
    color: #333 !important;
}

    .navbar-nav .nav-link:hover {
        color: #039BC1 !important;
    }

/* Dropdown Chevron */
.navbar-chevron {
    width: 12px;
    height: 10px;
}

/* Dropdown Menu */
.navbar-dropdown {
    background-color: #051c2c !important;
    border: none !important;
    padding: 1.5rem !important;
    margin-top: 0 !important;
    border-radius: 16px;
    min-width: 750px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Industries dropdown - dynamic width based on content */
.nav-item-industries .mega-dropdown {
    min-width: auto !important;
    width: fit-content;
    max-width: none;
    padding: 1.5rem !important;
}

    .nav-item-industries .mega-dropdown .row {
        width: fit-content;
        margin: 0;
    }

        .nav-item-industries .mega-dropdown .row > [class*="col-"] {
            flex: 0 0 auto;
            width: auto;
        }

/* Capabilities dropdown - wider for featured section */
.nav-item-capabilities .mega-dropdown {
    min-width: 900px;
    max-width: 1800px;
}

/* Mega dropdown positioning - connect to nav item */
.nav-item-industries,
.nav-item-capabilities,
.nav-item-featured-insight {
    position: static;
}

/* More nav item needs relative positioning for proper dropdown alignment */
.nav-item-more {
    position: relative;
}

    .nav-item-industries .mega-dropdown,
    .nav-item-capabilities .mega-dropdown,
    .nav-item-featured-insight .mega-dropdown,
    .nav-item-more .mega-dropdown {
        margin-top: 0.5rem !important;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    /* Ensure nav item and dropdown are treated as one hover area */
    .nav-item-industries.show .mega-dropdown,
    .nav-item-capabilities.show .mega-dropdown,
    .nav-item-featured-insight.show .mega-dropdown,
    .nav-item-more.show .mega-dropdown {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* More dropdown - smaller width since it only has 2 items */
    .nav-item-more .mega-dropdown {
        min-width: 200px;
        max-width: 300px;
        /* Position directly under the "More" nav link, aligned with the link text */
        /* Offset by nav-link's typical left padding to align with text start */
        left: 0 !important;
        transform: none !important;
        right: auto !important;
    }

/* Ensure dropdown aligns with nav-link text */
.nav-item-more {
    position: relative;
}

    /* Align dropdown left edge with nav-link text by matching nav-link padding */
    .nav-item-more .mega-dropdown {
        /* Bootstrap nav-links typically have 0.5rem left padding, so we offset by that */
        left: 0.5rem !important;
    }

.mega-dropdown .dropdown-item {
    color: #ffffff !important;
    padding: 0.35rem 0 !important;
    background: transparent !important;
    border: none !important;
}

    .mega-dropdown .dropdown-item:hover {
        background-color: transparent !important;
        color: #57c1ff !important;
    }

/* Featured Section in Capabilities Dropdown */
.featured-section {
    padding-left: 1rem;
    margin-bottom: 0;
}

.featured-card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .featured-card h6 {
        font-size: 18px;
        color: #051c2c;
    }

    .featured-card p {
        font-size: 13px;
        line-height: 1.6;
        color: #333;
    }

/* Explore Solutions Button */
.navbar-btn {
    background-color: #039BC1 !important;
    min-height: 55px;
    border: none;
    font-weight: 500;
}

    .navbar-btn:hover {
        background-color: #0288a1 !important;
        color: #ffffff !important;
    }

.navbar-arrow {
    width: 20px;
    height: 20px;
}

/* Overlay - Full screen black overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1040;
    pointer-events: none;
}

    .nav-overlay.show {
        opacity: 1;
        visibility: visible;
        cursor: pointer;
    }

/* Mega dropdown - Higher z-index than overlay */
.mega-dropdown {
    z-index: 1050 !important;
    position: relative;
}

.nav-item-industries.show .mega-dropdown {
    display: block !important;
}

/* Hide Bootstrap default dropdown arrow */
.navbar-nav .dropdown-toggle::after {
    display: none !important;
}

/* Mobile Side Menu */
.mobile-side-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1060;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

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

.mobile-side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

    .mobile-menu-close:hover {
        background-color: #f8f9fa;
    }

    .mobile-menu-close span {
        line-height: 1;
    }

.mobile-side-menu-content {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

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

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .mobile-nav-link:hover {
        background-color: #f8f9fa;
        color: #039BC1;
    }

.mobile-chevron {
    width: 16px;
    height: 10px;
    transition: transform 0.3s ease;
}

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

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

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

.mobile-submenu li {
    border-bottom: 1px solid #e9ecef;
}

    .mobile-submenu li:last-child {
        border-bottom: none;
    }

.mobile-submenu a {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 2.5rem;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .mobile-submenu a:hover {
        background-color: #e9ecef;
        color: #039BC1;
    }

.mobile-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background-color: #ffffff;
    position: sticky;
    bottom: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1059;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Hide desktop navbar on mobile */
@media (max-width: 991px) {
    #navbarNav {
        display: none !important;
    }

    .navbar-btn:not(.mobile-menu-footer .navbar-btn) {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .navbar-center {
        flex: none;
        justify-content: flex-start;
        margin-top: 1rem;
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        width: 100%;
    }

    .navbar-btn {
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }

    .nav-overlay {
        display: none;
    }

    /* Mobile dropdown styling */
    .nav-item-industries,
    .nav-item-capabilities,
    .nav-item-featured-insight,
    .nav-item-more {
        position: relative;
        width: 100%;
    }

        .nav-item-industries .mega-dropdown,
        .nav-item-capabilities .mega-dropdown,
        .nav-item-featured-insight .mega-dropdown,
        .nav-item-more .mega-dropdown {
            position: static !important;
            left: auto !important;
            transform: none !important;
            width: 100% !important;
            margin-top: 0.5rem !important;
            margin-left: 0 !important;
            opacity: 1 !important;
            visibility: visible !important;
            display: none !important;
            box-shadow: none !important;
            border-radius: 8px !important;
            background-color: #f8f9fa !important;
            padding: 1rem !important;
        }

            /* Show dropdown when nav item has show class OR when Bootstrap adds show class to dropdown */
            .nav-item-industries.show .mega-dropdown,
            .nav-item-capabilities.show .mega-dropdown,
            .nav-item-featured-insight.show .mega-dropdown,
            .nav-item-more.show .mega-dropdown,
            .nav-item-industries .mega-dropdown.show,
            .nav-item-capabilities .mega-dropdown.show,
            .nav-item-featured-insight .mega-dropdown.show,
            .nav-item-more .mega-dropdown.show {
                display: block !important;
            }

    /* Mobile dropdown items */
    .mega-dropdown .dropdown-item {
        color: #333 !important;
        padding: 0.5rem 0.75rem !important;
        border-bottom: 1px solid #e9ecef;
    }

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

        .mega-dropdown .dropdown-item:hover {
            background-color: #e9ecef !important;
            color: #039BC1 !important;
        }

    /* Mobile dropdown headings */
    .mega-dropdown h6 {
        color: #051c2c !important;
        font-size: 14px;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #039BC1;
    }

    /* Mobile featured section */
    .featured-section {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 2px solid #039BC1;
    }

        .featured-section h6 {
            color: #051c2c !important;
        }

        .featured-section p {
            color: #333 !important;
        }

    /* Mobile flex layout adjustments */
    .mega-dropdown .d-flex {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

        .mega-dropdown .d-flex > div {
            width: 100% !important;
            min-width: auto !important;
            max-width: 100% !important;
            border-left: none !important;
            padding-left: 0 !important;
        }

    /* Mobile navbar dropdown toggle */
    .navbar-nav .dropdown-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
    }

    .navbar-chevron {
        transition: transform 0.3s ease;
    }

    .nav-item.show .navbar-chevron {
        transform: rotate(180deg);
    }
}

@media (max-width: 768px) {
    .navbar-logo {
        height: 60px;
    }

    .navbar-nav .nav-link {
        font-size: 18px;
    }

    .navbar-btn {
        min-height: 50px;
        font-size: 14px;
    }

    /* Mobile dropdown adjustments */
    .mega-dropdown {
        padding: 0.75rem !important;
    }

        .mega-dropdown h6 {
            font-size: 13px;
        }

        .mega-dropdown .dropdown-item {
            font-size: 15px;
            padding: 0.5rem !important;
        }
}

@media (max-width: 576px) {
    .navbar-logo {
        height: 50px;
    }

    .navbar-nav .nav-link {
        font-size: 16px;
    }

    .navbar-btn {
        min-height: 45px;
        padding: 0.5rem 1rem !important;
        font-size: 13px;
    }

    .navbar-arrow {
        width: 16px;
        height: 16px;
    }

    /* Small mobile dropdown adjustments */
    .mega-dropdown {
        padding: 0.5rem !important;
    }

        .mega-dropdown h6 {
            font-size: 12px;
            margin-bottom: 0.5rem;
        }

        .mega-dropdown .dropdown-item {
            font-size: 14px;
            padding: 0.4rem 0.5rem !important;
        }

    .featured-section {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

        .featured-section h6 {
            font-size: 13px;
        }

        .featured-section p {
            font-size: 12px;
        }

    /* Mobile side menu adjustments for small screens */
    .mobile-side-menu {
        width: 90%;
        max-width: 350px;
    }

    .mobile-nav-link {
        font-size: 15px;
        padding: 0.875rem 1.25rem;
    }

    .mobile-submenu a {
        font-size: 13px;
        padding: 0.625rem 1.25rem 0.625rem 2rem;
    }

    .mobile-menu-footer {
        padding: 1.25rem;
    }
}
