/* 
 * TECA Canada - Enhanced Mega Menu Styles
 * Modern, professional and sophisticated mega-dropdown styling
 */

/* Base Mega Dropdown Styling */
.mega-dropdown {
    position: static !important;
}

.mega-dropdown-menu {
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0 0 12px 12px;
    margin-top: 0 !important;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.06);
    animation: megaMenuFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    left: 0;
    right: 0;
    border-top: none;
    background-color: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform-origin: top center;
    overflow: hidden;
    position: absolute;
    top: 100%;
    z-index: 1000;
}

/* Special styles for the mega dropdowns to make them seamless with the navbar */
.dropdown > .dropdown-menu {
    margin-top: -1px !important;
    padding-top: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0 0 12px 12px;
}

@keyframes megaMenuFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-12px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Mega Menu Wrapper - Centers Content */
.mega-menu-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}

/* Header Styling - Modern Visual Hierarchy */
.mega-menu-header {
    text-align: left;
    position: relative;
    padding: 24px 32px;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.mega-menu-header h4 {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 4px;
    position: relative;
    display: inline-block;
}

.mega-menu-header h4::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: linear-gradient(to bottom, #1e40af, #3b82f6);
    border-radius: 2px;
}

.mega-menu-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0;
    max-width: 600px;
}

/* Main Content Container */
.mega-menu-content {
    display: grid;
    grid-template-columns: 1.5fr 2.5fr;
    gap: 25px;
    padding: 32px;
}

/* Left Side Help Section Styling */
.mega-menu-help-section {
    padding-right: 15px;
    border-right: 1px solid rgba(0,0,0,0.08);
    height: 100%;
}

.help-content-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.help-content-block,
.featured-banner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.featured-banner {
    height: calc(50% - 10px); /* Account for margin between sections */
}

.help-content-block {
    height: calc(50% - 10px); /* Account for margin between sections */
}

/* Consistent heights for all items */
.mega-menu-categories-container,
.mega-menu-category:has(.category-content.no-icon) {
    min-height: 160px;
}

.mega-menu-help-section {
    min-height: 320px; /* Double the height of categories for the container */
}

/* Adjust spacing in the featured banner */
.featured-banner .featured-content {
    margin-bottom: 15px;
}

/* Help section spacing */
.help-content-block .help-content-top {
    margin-bottom: 15px;
}

.help-content-block {
    padding: 18px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.category-content.no-icon {
    padding-left: 0;
    margin-left: 0;
}

.help-content-block h4 {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 12px;
    position: relative;
}

.help-content-block h4::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: linear-gradient(to bottom, #1e40af, #3b82f6);
    border-radius: 2px;
}

.help-content-block p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.mega-menu-categories-container {
    padding-left: 10px;
}

/* Categories Grid Styling */
.mega-menu-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Categories without icons need different styling */
.mega-menu-category:has(.category-content.no-icon) {
    padding: 18px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mega-menu-category:has(.category-content.no-icon):hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mega-menu-category {
    background-color: #ffffff;
    border-radius: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.mega-menu-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.mega-menu-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.03), rgba(30, 64, 175, 0));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.mega-menu-category:hover::before {
    opacity: 1;
}

/* Icon Container - Modern Floating Design */
.mega-menu-category .icon-container {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    font-size: 1.25rem;
    border-radius: 12px;
    margin: -20px auto 8px;
    position: relative;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    overflow: hidden;
}

.mega-menu-category:hover .icon-container {
    transform: translateY(-2px) rotateY(10deg);
    box-shadow: 0 12px 25px rgba(30, 64, 175, 0.3);
}

.mega-menu-category .icon-container::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    transform: rotate(45deg);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.mega-menu-category:hover .icon-container::before {
    transform: rotate(45deg) translateX(10%);
    opacity: 1;
}

/* Category Content Styling */
.category-content {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.mega-menu-category h5 {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
    transition: color 0.3s ease;
}

.mega-menu-category:hover h5 {
    color: #1e40af;
}

.category-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.category-link {
    color: #1e40af;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 6px 0;
    transition: all 0.3s ease;
    margin-top: auto;
}

.category-link::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.mega-menu-category:hover .category-link::after {
    width: 100%;
}

.category-link i {
    margin-left: 6px;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.mega-menu-category:hover .category-link i {
    transform: translateX(3px);
}

/* Featured Content Styling */
.mega-menu-featured {
    border-left: 1px solid rgba(0,0,0,0.05);
    padding-left: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.featured-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.mega-menu-featured:hover .featured-image img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
}

.featured-tag {
    background: linear-gradient(90deg, #facc15, #eab308);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 30px;
    display: inline-block;
}

.featured-content {
    padding: 0;
}

.featured-content h5 {
    color: #0f172a;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.featured-content h5::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
}

.featured-content p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.featured-actions {
    margin-top: auto;
}

.featured-actions .btn {
    padding: 10px 22px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.featured-actions .btn-primary {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border: none;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.25);
}

.featured-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.featured-actions .btn i {
    transition: transform 0.3s ease;
}

.featured-actions .btn:hover i {
    transform: translateX(3px);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .mega-menu-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .mega-menu-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mega-menu-featured {
        border-left: none;
        border-top: 1px solid rgba(0,0,0,0.05);
        padding-left: 0;
        padding-top: 30px;
    }
}

@media (max-width: 767.98px) {
    .mega-menu-categories {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .mega-menu-header {
        padding: 20px;
    }
    
    .mega-menu-content {
        padding: 20px;
    }
    
    .mega-menu-category .icon-container {
        margin-top: -15px;
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
}
