/*=============================================
    CLOUDSNEST SIGNAGE - MEGA MENU STYLES
    Modern, Premium Navigation System
=============================================*/

/* Mega Menu Base Styles */
.mega-menu-item {
    position: relative;
}

.mega-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 9999;
    background: var(--sp-white);
    border-radius: 8px;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border-top: 3px solid var(--sp-primary);
    min-width: 1200px;
    /* WIDER for 4 columns */
    max-width: 1300px;
}

/* Show mega menu on hover */
.mega-menu-item:hover>.mega-menu-dropdown,
.mega-menu-item.focus>.mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Mega Menu Content Container */
.mega-menu-content {
    padding: 30px 20px 20px;
}

/* Mega Menu Row - FORCE 4 COLUMNS SIDE-BY-SIDE */
.mega-menu-row {
    display: flex;
    gap: 30px;
    flex-wrap: nowrap !important;
    /* NEVER wrap - always side-by-side */
    justify-content: flex-start;
}

/* Mega Menu Columns - WIDER for 4-column layout */
.mega-menu-col {
    flex: 1 1 280px;
    /* Wider columns */
    min-width: 260px;
    max-width: 320px;
    padding: 0 15px;
}

/* Mega Menu Title */
.mega-menu-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sp-secondary);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sp-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu-title i {
    color: var(--sp-primary);
    font-size: 18px;
}

/* Mega Menu Section */
.mega-menu-section {
    margin-bottom: 20px;
}

.mega-menu-section h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-secondary-dark);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.8;
}

/* Mega Menu List */
.mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-list li {
    margin: 0;
    padding: 0;
}

.mega-menu-list li a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--sp-secondary-dark);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mega-menu-list li a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--sp-primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.mega-menu-list li a:hover,
.mega-menu-list li a:focus {
    background-color: rgba(51, 204, 255, 0.08);
    color: var(--sp-primary);
    padding-left: 18px;
}

.mega-menu-list li a:hover:before,
.mega-menu-list li a:focus:before {
    transform: scaleY(1);
}

/* Mega Menu Footer */
.mega-menu-footer {
    display: flex;
    gap: 15px;
    padding: 20px 35px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    margin-top: 10px;
}

.mega-menu-cta {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--sp-primary);
    color: var(--sp-white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(51, 204, 255, 0.3);
}

.mega-menu-cta:hover,
.mega-menu-cta:focus {
    background: var(--sp-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 204, 255, 0.4);
    color: var(--sp-white);
}

.mega-menu-cta i {
    font-size: 14px;
}

/* Specific Menu Variations */

/* Solutions Menu - 3 Column Layout */
.solutions-menu .mega-menu-dropdown {
    min-width: 750px;
}

/* Resources Menu - 3 Column Layout */
.resources-menu .mega-menu-dropdown {
    min-width: 650px;
}

/* About Menu - 2 Column Layout */
.about-menu .mega-menu-dropdown {
    min-width: 500px;
}

/* Hover Effects & Animations */
.mega-menu-col {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.mega-menu-item:hover .mega-menu-col:nth-child(1) {
    animation-delay: 0.05s;
}

.mega-menu-item:hover .mega-menu-col:nth-child(2) {
    animation-delay: 0.1s;
}

.mega-menu-item:hover .mega-menu-col:nth-child(3) {
    animation-delay: 0.15s;
}

.mega-menu-item:hover .mega-menu-col:nth-child(4) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon Enhancements */
.mega-menu-list li a:hover i,
.mega-menu-list li a:focus i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

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

    .mega-menu-row {
        gap: 20px;
    }

    .mega-menu-col {
        padding: 0 10px;
    }
}

@media (max-width: 991px) {

    /* Mobile mega menu styles */
    .mega-menu-dropdown {
        position: static;
        transform: none;
        min-width: 100%;
        max-width: 100%;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-radius: 0;
        border-top: 0;
        display: none;
    }

    .mega-menu-item.active .mega-menu-dropdown {
        display: block;
    }

    .mega-menu-row {
        flex-direction: column;
        gap: 0;
    }

    .mega-menu-col {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #e0e0e0;
        animation: none;
        opacity: 1;
    }

    .mega-menu-title {
        font-size: 14px;
        margin: 15px 0 10px;
        padding: 10px 15px;
        background: #f8f9fa;
        border-bottom: 2px solid var(--sp-primary);
        border-radius: 4px;
    }

    .mega-menu-section h5 {
        padding-left: 15px;
        margin-top: 10px;
    }

    .mega-menu-list li a {
        padding: 10px 25px;
    }

    .mega-menu-footer {
        flex-direction: column;
        padding: 15px;
    }

    .mega-menu-cta {
        width: 100%;
    }
}

/* Premium Touch - Gradient Hover on Titles */
.mega-menu-title:hover {
    background: linear-gradient(90deg, transparent, rgba(51, 204, 255, 0.1), transparent);
    transition: background 0.3s ease;
}

/* Sticky Menu Adjustments */
.sticky-menu .mega-menu-dropdown {
    top: calc(100% + 5px);
}

/* Accessibility Improvements */
.mega-menu-list li a:focus-visible {
    outline: 2px solid var(--sp-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .mega-menu-dropdown {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .mega-menu-dropdown {
        border: 2px solid var(--sp-secondary);
    }

    .mega-menu-list li a:hover,
    .mega-menu-list li a:focus {
        border: 1px solid var(--sp-primary);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .mega-menu-dropdown,
    .mega-menu-list li a,
    .mega-menu-cta {
        transition: none;
    }

    .mega-menu-col {
        animation: none;
        opacity: 1;
    }
}