/**
 * Navigation & Mega Menu Styles
 * RapidTeck Networks Inc.
 */

/* ===================================
   Site Logo
   =================================== */
.site-logo {
    max-height: 50px;
    width: auto;
    fill: #484169;
    transition: transform 0.3s ease;
}

.logo-link:hover .site-logo {
    transform: scale(1.05);
}

/* ===================================
   Header Updates
   =================================== */
       
.logged-in .site-header {
  margin-top: 30px;
}

.site-header {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 0;
}

.site-header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(72, 65, 105, 0.15);
}

.site-header.scrolled .site-logo {
    max-height: 40px;
    fill: #fff;
}

/* ===================================
   Mobile Menu Toggle Enhancement
   =================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.menu-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active .menu-bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.site-header.scrolled .menu-bar {
    background-color: var(--text-light);
}

/* ===================================
   Primary Menu
   =================================== */
.primary-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 0;
    display: block;
    position: relative;
    transition: color 0.3s ease;
}
.menu-item > a.btn-nav {
    padding: 0.75rem;
}
.site-header.scrolled .menu-item > a.btn-nav {
    border: 2px solid var(--primary-color);
    background-color: var(--text-light);
    color: var(--primary-color)!important;
}

.menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item > a:hover::after,
.menu-item.current-menu-item > a::after {
    width: 100%;
}

.site-header.scrolled .menu-item > a {
    color: var(--text-light);
}

.site-header.scrolled .menu-item > a::after {
    background: var(--text-light);
}

/* ===================================
   CTA Button in Nav
   =================================== */
.menu-item-cta {
    margin-left: 1rem;
}

.btn-nav {
    padding: 0.65rem 1.75rem;
    background: var(--primary-color);
    color: #ffffff !important;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
}

.btn-nav:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 65, 105, 0.3);
}

.btn-nav::after {
    display: none !important;
}

/* ===================================
   Mega Menu Container
   =================================== */
.mega-menu-item {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(72, 65, 105, 0.15);
    padding: 2rem;
    min-width: 900px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    margin-top: 1rem;
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ffffff;
}

.mega-menu-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===================================
   Mega Menu Inner Grid
   =================================== */
.mega-menu-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.mega-menu-column {
    transition: transform 0.3s ease;
}

/* ===================================
   Mega Menu Links
   =================================== */
.mega-menu-link {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
}

.mega-menu-link:hover {
    background: linear-gradient(135deg, rgba(72, 65, 105, 0.05) 0%, rgba(94, 85, 130, 0.05) 100%);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(72, 65, 105, 0.1);
}

.mega-menu-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mega-menu-link:hover .mega-menu-icon {
    transform: scale(1.1) rotate(5deg);
}

.mega-menu-content h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.mega-menu-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* ===================================
   Scrolled Header Mega Menu
   =================================== */
.site-header.scrolled .mega-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .mega-menu {
        min-width: 750px;
    }

    .mega-menu-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
        padding: 5rem 2rem 2rem;
    }

    .main-navigation.active {
        right: 0;
    }

    .primary-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .menu-item {
        border-bottom: 1px solid rgba(72, 65, 105, 0.1);
    }

    .menu-item > a {
        padding: 1.25rem 0;
    }

    .menu-item-cta {
        margin-left: 0;
        margin-top: 1rem;
        border: none;
    }

    .btn-nav {
        display: block;
        text-align: center;
        padding: 1rem;
    }

    /* Mobile Mega Menu */
    .mega-menu {
        position: static;
        transform: none;
        min-width: auto;
        width: 100%;
        padding: 0;
        margin: 0;
        background: #f8f9fa;
        border-radius: 0;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
    }

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

    .mega-menu-item.active .mega-menu,
    .mega-menu-item:hover .mega-menu {
        max-height: 1000px;
        padding: 1rem 0;
        opacity: 1;
        visibility: visible;
    }

    .mega-menu-inner {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .mega-menu-link {
        margin: 0.5rem 0;
    }

    /* Mobile menu overlay */
    .main-navigation.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 400px;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

@media (max-width: 480px) {
    .main-navigation {
        max-width: 100%;
    }

    .main-navigation.active::before {
        right: 0;
    }

    .mega-menu-link {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .mega-menu-icon {
        font-size: 3rem;
    }
}
