/* 
 * TECA Canada - Mega Menu Styles
 * Premium, modern and professional mega-dropdown styling
 */

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

.mega-dropdown-menu {
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    margin-top: 0 !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    animation: fadeIn 0.25s ease-out;
    left: 0;
    right: 0;
    border-top: 3px solid #1e40af;
    background-color: #ffffff;
}

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

/* Mega Menu Wrapper - Centers Content */
.mega-menu-wrapper {
    max-width: 1140px;
    margin: 0 auto;
    padding: 35px 20px;
    position: relative;
}

/* Header Styling */
.mega-menu-header {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.mega-menu-header:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1e40af, #facc15);
    border-radius: 3px;
}

.mega-menu-header h4 {
    color: #1e40af;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

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

/* Main Content Container */
.mega-menu-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

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

.mega-menu-category {
    display: flex;
    background-color: #f9fafb;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
    height: auto;
}

.mega-menu-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: rgba(30, 64, 175, 0.15);
}

/* Icon Container */
.mega-menu-category .icon-container {
    width: 44px;
    min-width: 44px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #1e40af, #3b82f6);
    color: white;
    font-size: 0.9rem;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.mega-menu-category .icon-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom right, rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s;
}

.mega-menu-category:hover .icon-container::after {
    opacity: 1;
}

/* Category Content Styling */
.category-content {
    padding: 12px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mega-menu-category h5 {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
}

.category-description {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 8px;
    height: 32px;
    overflow: hidden;
}

.category-link {
    display: inline-flex;
    align-items: center;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.category-link span {
    margin-right: 6px;
    position: relative;
}

.category-link i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.category-link:hover {
    color: #facc15;
}

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

/* Featured Content Styling */
.mega-menu-featured {
    width: 320px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0,0,0,0.06);
}

.featured-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

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

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

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.featured-tag {
    background-color: #facc15;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 0 8px 0 0;
    position: absolute;
    left: 0;
    top: 0;
}

.featured-content {
    padding: 24px;
}

.featured-content h5 {
    color: #1e40af;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

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

.featured-actions {
    display: flex;
    justify-content: center;
}

.featured-actions .btn-primary {
    background-color: #1e40af;
    border-color: #1e40af;
    padding: 8px 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.featured-actions .btn-primary:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

/* Mobile Optimization */
@media (max-width: 991.98px) {
    .mega-dropdown {
        position: relative !important;
    }
    
    .mega-dropdown-menu {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .mega-menu-wrapper {
        padding: 20px;
    }
    
    .mega-menu-content {
        flex-direction: column;
        gap: 25px;
    }
    
    .mega-menu-categories {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-featured {
        width: 100%;
    }
    
    .mega-menu-header h4 {
        font-size: 1.25rem;
    }
    
    .mega-menu-header:after {
        width: 60px;
    }
}

/* Medium screens */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .mega-menu-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .mega-menu-featured {
        width: 280px;
    }
}

/* Dropdown behavior */
@media (min-width: 992px) {
    .mega-dropdown:hover .mega-dropdown-menu {
        display: block;
    }
}

/* Accessibility */
.dropdown-toggle:focus + .mega-dropdown-menu {
    display: block;
}
