/**
 * Header Mega Menu Styles
 * Synergy Health Theme
 * Contains all mega menu styles for both tabbed and standard layouts
 */

/* ========================================
   MEGA MENU STYLES
   ======================================== */

/* Mega Menu Base Styles */
.primary-menu > li.mega-menu {
    position: static;
}

.mega-menu-dropdown {
    position: fixed;
    top: var(--mega-menu-top, 150px);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--light-green);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.primary-menu > li.mega-menu:hover .mega-menu-dropdown,
.primary-menu > li.mega-menu.mega-menu-open .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* TABBED MEGA MENU */
.mega-menu-dropdown.mega-menu-tabbed {
    display: flex;
    justify-content: center;
    padding: 0;
}

.mega-menu-dropdown.mega-menu-tabbed .mega-menu-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 400px;
    max-width: 1440px;
    width: 100%;
    position: relative;
}

.mega-menu-dropdown.mega-menu-tabbed .mega-menu-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100vw;
    background: linear-gradient(180deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    transform: translateX(-100%);
    z-index: -1;
}

.mega-menu-dropdown.mega-menu-tabbed .mega-menu-container::after {
    content: '';
    position: absolute;
    left: -400px;
    bottom: 0;
    width: 600px;
    height: 100%;
    background-image: url('../images/shp_paperclip_menu_bg.png');
    background-position: left bottom;
    background-size: 600px;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0.1;
    z-index: 0;
}

/* Sidebar with tabs */
.mega-menu-sidebar {
    background: linear-gradient(180deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    padding: 30px 0;
    position: relative;
}

.mega-menu-sidebar-title {
    font-family: var(--font-heading);
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
    font-style: normal;
    margin: 0 0 20px 0;
    padding: 0 30px 20px 20px;
}

.mega-menu-tabs {
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.mega-menu-tab {
    margin-right: 0;
    margin-bottom: 10px;
    transition: background-color 0.2s ease;
}

.mega-menu-tab:last-of-type {
    margin-bottom: 0;
}

.mega-menu-tab:last-child {
    border-bottom: none;
}

.mega-menu-tab a,
.mega-menu-tab span {
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
}

.mega-menu-tab i {
    font-size: var(--text-sm);
    transition: transform var(--transition-fast);
}

.mega-menu-tab:hover,
.mega-menu-tab.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.mega-menu-tab:hover i,
.mega-menu-tab.active i {
    transform: translateX(var(--spacing-xs));
}

/* Content area for tabbed mega menu */
.mega-menu-content {
    position: relative;
    padding: 40px;
    overflow: hidden;
    background: var(--light-green);
}

.mega-menu-panel {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 70px;
    animation: fadeIn 0.3s ease;
}

.mega-menu-panel.active {
    display: grid;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* STANDARD MEGA MENU */
.mega-menu-dropdown.mega-menu-standard {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.mega-menu-dropdown.mega-menu-standard .mega-menu-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 70px;
    max-width: 1440px;
    width: 100%;
    align-items: stretch;
}

/* Column Styles (both types) */
.mega-menu-col {
    min-width: 0;
}

.mega-menu-col-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    font-style: normal;
    color: var(--button-red);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #C8C8C8;
}

/* H3 section titles for Column 1 WYSIWYG */
h3.mega-menu-col-title {
    font-size: 22px;
}

.mega-menu-section-title {
    margin-top: 25px;
}

.mega-menu-section-title:first-child {
    margin-top: 0;
}

/* Section wrapper for consistent spacing */
.mega-menu-section,
.mega-menu-view-all {
    margin-bottom: 65px !important;
}

.mega-menu-section:last-child,
.mega-menu-view-all:last-child {
    margin-bottom: 0 !important;
}

.mega-menu-col-content {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
}

/* Lists in mega menu */
.mega-menu-col-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-col-content li {
    margin-bottom: 8px;
}

.mega-menu-col-content a {
    font-family: var(--font-body);
    color: var(--nav-color);
    text-decoration: none;
    font-size: 15px;
    display: inline-block;
    transition: all 0.2s ease;
}

.mega-menu-col-content a:hover {
    color: var(--primary-green);
    padding-left: 5px;
}

/* View All links - override content link styles */
.mega-menu-view-all,
.mega-menu-col-content .mega-menu-view-all {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-green) !important;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    padding-left: 0 !important;
}

.mega-menu-view-all:hover,
.mega-menu-col-content .mega-menu-view-all:hover {
    color: var(--primary-blue) !important;
    text-decoration: underline;
    padding-left: 0 !important;
}

/* Section view all links need bottom margin for spacing between sections */
.mega-menu-section-title ~ .mega-menu-view-all {
    margin-bottom: 20px;
    display: block;
}

/* View all chevron icon size */
.mega-menu-view-all i,
.mega-menu-col-content .mega-menu-view-all i {
    font-size: 0.6rem;
    padding-left: 10px;
    transition: transform 0.3s ease;
}

.mega-menu-view-all:hover i,
.mega-menu-col-content .mega-menu-view-all:hover i {
    transform: translateX(4px);
}

/* Provider cards styling */
.mega-menu-provider-card {
    display: block;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.mega-menu-provider-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mega-menu-provider-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    display: block;
}

.mega-menu-provider-name {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    font-style: normal;
    color: var(--white);
    margin: 0 0 5px 0;
}

.mega-menu-provider-specialty {
    font-family: var(--font-body);
    font-size: 13px;
    color: #666;
    margin: 0 0 8px 0;
}

.mega-menu-provider-rating {
    font-size: 13px;
    color: var(--primary-green);
    font-weight: 600;
}

/* CTA button in mega menu - matches .btn-primary */
/* Higher specificity to override .mega-menu-col-content a styles (prevents padding-left shift on hover) */
.mega-menu-col-content .mega-menu-cta,
.mega-menu-cta {
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--btn-padding-md);
    background-color: var(--red);
    color: var(--white) !important;
    text-decoration: none;
    border-radius: var(--radius-pill);
    border: 3px solid var(--red);
    font-weight: 600;
    font-size: var(--text-lg);
    transition: all var(--transition-base);
    margin-top: 15px;
    min-width: var(--btn-min-width);
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
}

.mega-menu-col-content .mega-menu-cta:hover,
.mega-menu-cta:hover {
    background-color: var(--red-dark);
    border-color: var(--red-dark);
    color: var(--white) !important;
    padding: var(--btn-padding-md); /* override parent's padding-left: 5px that caused shift */
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}

.mega-menu-col-content .mega-menu-cta:active,
.mega-menu-cta:active {
    transform: translateY(0);
}

.mega-menu-col-content .mega-menu-cta:focus,
.mega-menu-cta:focus {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

/* Compact CTA button variant - smaller padding, no text wrap */
.mega-menu-col-content .mega-menu-cta-compact,
.mega-menu-cta-compact {
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--btn-padding-sm);
    background-color: var(--red);
    color: var(--white) !important;
    text-decoration: none;
    border-radius: var(--radius-pill);
    border: 3px solid var(--red);
    font-weight: 600;
    font-size: var(--text-base);
    white-space: nowrap;
    transition: all var(--transition-base);
    margin-top: 15px;
}

.mega-menu-col-content .mega-menu-cta-compact:hover,
.mega-menu-cta-compact:hover {
    background-color: var(--red-dark);
    border-color: var(--red-dark);
    color: var(--white) !important;
    padding: var(--btn-padding-sm);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}

.mega-menu-col-content .mega-menu-cta-compact:active,
.mega-menu-cta-compact:active {
    transform: translateY(0);
}

.mega-menu-col-content .mega-menu-cta-compact:focus,
.mega-menu-cta-compact:focus {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

/* Social proof text */
.mega-menu-social-proof {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

/* MOBILE RESPONSIVE FOR MEGA MENU */
@media (max-width: 1200px) {
    .mega-menu-dropdown.mega-menu-tabbed .mega-menu-container {
        grid-template-columns: 250px 1fr;
    }

    .mega-menu-dropdown.mega-menu-standard .mega-menu-container {
        gap: 70px;
    }

    .mega-menu-dropdown.mega-menu-standard {
        padding: 30px 20px;
    }

    .mega-menu-panel {
        gap: 70px;
    }

    .mega-menu-content {
        padding: 30px 20px;
    }
}

@media (max-width: 992px) {
    .mega-menu-dropdown.mega-menu-tabbed .mega-menu-container {
        grid-template-columns: 220px 1fr;
    }

    .mega-menu-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
    }

    .mega-menu-dropdown.mega-menu-standard .mega-menu-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
    }

    .mega-menu-dropdown.mega-menu-standard {
        padding: 25px 20px;
    }
}

@media (max-width: 768px) {
    /* Mobile mega menu accordion style */
    .mega-menu-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        display: block !important;
        width: 100%;
    }

    .mega-menu-dropdown.mega-menu-tabbed,
    .mega-menu-dropdown.mega-menu-standard {
        display: block !important;
        padding: 0;
    }

    .mega-menu-dropdown .mega-menu-container {
        display: block !important;
        max-width: 100%;
    }

    .mega-menu-sidebar {
        background: transparent;
        padding: 0;
    }

    .mega-menu-tabs {
        padding: 0;
    }

    .mega-menu-tab {
        border: 1px solid #e5e5e5;
        margin-bottom: 10px;
        margin-right: 0;
        border-radius: 4px;
        background: var(--light-green);
    }

    .mega-menu-tab a,
    .mega-menu-tab span {
        color: var(--nav-color);
        padding: 12px 15px;
    }

    .mega-menu-tab:hover,
    .mega-menu-tab.active {
        background: var(--primary-green);
    }

    .mega-menu-tab:hover a,
    .mega-menu-tab.active a {
        color: var(--white);
        padding-left: 15px;
    }

    .mega-menu-content {
        padding: 0;
    }

    .mega-menu-panel {
        display: none;
        grid-template-columns: 1fr;
        gap: 35px;
        padding: 15px;
        background: #f9f9f9;
        border-radius: 4px;
        margin-bottom: 15px;
    }

    .mega-menu-panel.active {
        display: grid;
    }

    .mega-menu-dropdown.mega-menu-standard .mega-menu-col {
        padding: 15px;
        background: #f9f9f9;
        border-radius: 4px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .mega-menu-col-title {
        font-size: 16px;
    }

    .mega-menu-col-content {
        font-size: 13px;
    }

    .mega-menu-provider-card {
        padding: 12px;
    }
}

/* ========================================
   IMAGE CARD IN MEGA MENU
   ======================================== */

/* Image Card Column Styles */
.mega-menu-col-image-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-menu-col-image-card .image-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    height: auto;
    min-height: 310px;
    max-height: 310px;
    flex-shrink: 0;
    align-self: center;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mega-menu-col-image-card .image-card:hover {
    transform: translateY(-4px);
}

.mega-menu-col-image-card .image-card:focus {
    outline: 3px solid var(--primary-red);
    outline-offset: 2px;
}

/* Background Image */
.mega-menu-col-image-card .image-card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Overlay Colors */
.mega-menu-col-image-card .image-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* Teal Overlay */
.mega-menu-col-image-card .image-card.overlay-teal .image-card-overlay {
    background-color: #62A498C2;
}

/* Blue Overlay */
.mega-menu-col-image-card .image-card.overlay-blue .image-card-overlay {
    background-color: #4464ADC9;
}

/* Gradient Overlay - 45 degree angle, peach bottom-left to green top-right */
/* Support both 'gradient' and old 'light-gray' class names for backward compatibility */
.mega-menu-col-image-card .image-card.overlay-gradient .image-card-overlay,
.mega-menu-col-image-card .image-card.overlay-light-gray .image-card-overlay {
    background: linear-gradient(45deg, var(--gradient-start, #E8D5C4) 0%, var(--gradient-end, #B8D4CE) 100%);
    opacity: 0.85;
}

/* Gradient cards need primary green text instead of white for better contrast */
.mega-menu-col-image-card .image-card.overlay-gradient .image-card-title,
.mega-menu-col-image-card .image-card.overlay-light-gray .image-card-title {
    color: var(--primary-green, #62A498);
    text-shadow: none;
}

.mega-menu-col-image-card .image-card:hover .image-card-overlay {
    opacity: 0.9;
}

/* Card Content */
.mega-menu-col-image-card .image-card-content {
    position: relative;
    z-index: 3;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card Title - H4 styling to match mega menu titles */
.mega-menu-col-image-card .image-card-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
}

/* Card Description */
.mega-menu-col-image-card .image-card-description {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--black);
    line-height: 1.4;
    margin: 0 0 1rem 0;
}

/* Link Wrapper - Flex container for link text and arrow */
.mega-menu-col-image-card .image-card-link-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

/* Link Text - Green text next to arrow */
.mega-menu-col-image-card .image-card-link-text {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--primary-green, #62A498);
    transition: transform var(--transition-base);
}

.mega-menu-col-image-card .image-card:hover .image-card-link-text {
    transform: translateX(var(--spacing-xs));
}

/* Arrow Icon */
.mega-menu-col-image-card .image-card-arrow {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: transform var(--transition-base);
}

.mega-menu-col-image-card .image-card-arrow img {
    width: 44px;
    height: 43px;
}

.mega-menu-col-image-card .image-card:hover .image-card-arrow {
    transform: translateX(var(--spacing-xs));
}

/* Responsive Adjustments for Mega Menu Image Cards */
@media screen and (max-width: 1024px) {
    .mega-menu-col-image-card .image-card {
        height: auto;
        min-height: 220px;
        max-height: 280px;
    }
    
    .mega-menu-col-image-card .image-card-title {
        font-size: 16px;
    }
}

@media screen and (max-width: 768px) {
    .mega-menu-col-image-card .image-card {
        height: auto;
        min-height: 200px;
        max-height: 250px;
    }
    
    .mega-menu-col-image-card .image-card-content {
        padding: 1.25rem;
    }
    
    .mega-menu-col-image-card .image-card-title {
        font-size: 15px;
    }
    
    .mega-menu-col-image-card .image-card-arrow img {
        width: 36px;
        height: 35px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .mega-menu-col-image-card .image-card,
    .mega-menu-col-image-card .image-card-overlay,
    .mega-menu-col-image-card .image-card-arrow {
        transition: none;
    }
    
    .mega-menu-col-image-card .image-card:hover {
        transform: none;
    }
    
    .mega-menu-col-image-card .image-card:hover .image-card-arrow {
        transform: none;
    }
}