/**
 * Mega Menu - Frontend Styles
 * 
 * @package Nexus_Pro
 * @since 3.0.0
 */

/* ===========================
   Mega Menu Container
   =========================== */

.nexus-mega-menu {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    max-width: 1200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    padding: 30px;
    z-index: 9999;
}

.nexus-has-mega-menu:hover > .nexus-mega-menu {
    display: flex;
    flex-wrap: wrap;
}

/* Column layouts */
.nexus-mega-columns-2 > li {
    width: 50%;
}

.nexus-mega-columns-3 > li {
    width: 33.333%;
}

.nexus-mega-columns-4 > li {
    width: 25%;
}

.nexus-mega-columns-5 > li {
    width: 20%;
}

.nexus-mega-columns-6 > li {
    width: 16.666%;
}

/* Mega menu items */
.nexus-mega-menu > li {
    list-style: none;
    padding: 0 15px;
    box-sizing: border-box;
}

.nexus-mega-menu > li > a {
    display: block;
    padding: 10px 0;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 10px;
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nexus-mega-menu > li > a:hover {
    color: #2196f3;
    border-color: #2196f3;
}

/* Sub-items within mega menu */
.nexus-mega-menu .sub-menu {
    position: static;
    display: block !important;
    opacity: 1;
    visibility: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.nexus-mega-menu .sub-menu li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nexus-mega-menu .sub-menu a {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.nexus-mega-menu .sub-menu a:hover {
    color: #2196f3;
    padding-left: 5px;
}

/* ===========================
   Menu Icons & Badges
   =========================== */

.nexus-menu-icon {
    margin-right: 8px;
    font-size: 18px;
    vertical-align: middle;
}

.nexus-icon-only .nexus-menu-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.nexus-menu-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* Disabled links */
.nexus-disabled-link {
    cursor: default;
    pointer-events: none;
}

/* ===========================
   Mobile Mega Menu
   =========================== */

@media screen and (max-width: 782px) {
    .nexus-mega-menu {
        position: static;
        width: 100%;
        max-width: 100%;
        padding: 15px;
        border: none;
        border-top: 1px solid #e0e0e0;
        box-shadow: none;
        background: #f9f9f9;
    }

    .nexus-has-mega-menu:hover > .nexus-mega-menu {
        display: block;
    }

    .nexus-mega-menu > li {
        width: 100% !important;
        padding: 10px 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .nexus-mega-menu > li:last-child {
        border-bottom: none;
    }

    .nexus-mega-menu > li > a {
        border-bottom: 1px solid #ddd;
        padding: 8px 0;
    }

    .nexus-mega-menu .sub-menu a {
        padding-left: 15px;
    }

    .nexus-mega-menu .sub-menu a:hover {
        padding-left: 20px;
    }
}

/* ===========================
   Accessibility
   =========================== */

.nexus-mega-menu a:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nexus-mega-menu {
        border: 2px solid currentColor;
    }

    .nexus-mega-menu > li > a {
        border-bottom-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nexus-mega-menu,
    .nexus-mega-menu a,
    .nexus-menu-icon,
    .nexus-menu-badge {
        transition: none;
    }
}

/* ===========================
   Dark Mode Support
   =========================== */

@media (prefers-color-scheme: dark) {
    .nexus-mega-menu {
        background: #1e1e1e;
        border-color: #333;
    }

    .nexus-mega-menu > li > a {
        color: #e0e0e0;
        border-color: #333;
    }

    .nexus-mega-menu > li > a:hover {
        color: #64b5f6;
        border-color: #64b5f6;
    }

    .nexus-mega-menu .sub-menu a {
        color: #b0b0b0;
    }

    .nexus-mega-menu .sub-menu a:hover {
        color: #64b5f6;
    }
}
