/* ============================================
   3D MEGA MENU - ADVANCED NAVBAR EFFECTS
   ============================================ */

:root {
    --primary-color: #0c3c63;
    --secondary-color: #32d314;
    --accent-color: #1e5a8e;
    --gold-color: #d4af37;
    --menu-bg: #ffffff;
    --menu-shadow: rgba(12, 60, 99, 0.15);
    --menu-hover: rgba(12, 60, 99, 0.05);
    --transition-speed: 0.4s;
    --transition-ease: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   NAVBAR ENHANCEMENTS
   ============================================ */

.navbar-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(12, 60, 99, 0.12);
    border-bottom: 1px solid rgba(12, 60, 99, 0.08);
}

/* ============================================
   3D MEGA MENU CONTAINER
   ============================================ */

.mega-menu-wrapper {
    position: relative;
    display: inline-block;
}

.mega-menu-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
}

.mega-menu-trigger:hover {
    color: var(--secondary-color);
    background: var(--menu-hover);
    transform: translateY(-2px);
}

.mega-menu-trigger i {
    transition: transform 0.4s var(--transition-ease);
    font-size: 12px;
}

.mega-menu-wrapper:hover .mega-menu-trigger i,
.mega-menu-wrapper.active .mega-menu-trigger i {
    transform: rotate(180deg);
}

/* ============================================
   3D MEGA MENU DROPDOWN
   ============================================ */

.mega-menu-dropdown {
    position: absolute;
    top: calc(100% + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(-20px) rotateX(-15deg);
    transform-origin: top center;
    perspective: 1500px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s var(--transition-ease);
    z-index: 9999;
    min-width: 800px;
    max-width: 1000px;
}

.mega-menu-wrapper:hover .mega-menu-dropdown,
.mega-menu-wrapper.active .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0) rotateX(0deg);
}

.mega-menu-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 30px 90px rgba(12, 60, 99, 0.2),
        0 10px 40px rgba(12, 60, 99, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(12, 60, 99, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

/* Animated Background Gradient */
.mega-menu-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(50, 211, 20, 0.03) 0%,
        rgba(12, 60, 99, 0.05) 50%,
        transparent 70%
    );
    animation: menuGradientRotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes menuGradientRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   MEGA MENU GRID LAYOUT
   ============================================ */

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    position: relative;
    z-index: 2;
}

/* ============================================
   3D MENU ITEMS
   ============================================ */

.mega-menu-item {
    position: relative;
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 100%);
    border: 1px solid rgba(12, 60, 99, 0.08);
    transition: all 0.4s var(--transition-ease);
    transform-style: preserve-3d;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    display: block;
    z-index: 1;
}

/* 3D Hover Effect */
.mega-menu-item:hover {
    transform: translateY(-8px) translateZ(20px) rotateX(5deg);
    box-shadow: 
        0 20px 60px rgba(12, 60, 99, 0.2),
        0 10px 30px rgba(50, 211, 20, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

/* Shine Effect on Hover */
.mega-menu-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.mega-menu-item:hover::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* ============================================
   MENU ITEM ICON
   ============================================ */

.mega-menu-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    font-size: 28px;
    margin-bottom: 16px;
    transition: all 0.4s var(--transition-ease);
    box-shadow: 0 8px 24px rgba(12, 60, 99, 0.3);
    position: relative;
    overflow: hidden;
}

/* Icon Glow Effect */
.mega-menu-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
    border-radius: 50%;
}

.mega-menu-item:hover .mega-menu-icon {
    transform: rotateY(360deg) scale(1.1);
    background: linear-gradient(135deg, var(--secondary-color) 0%, #28a810 100%);
    box-shadow: 0 12px 32px rgba(50, 211, 20, 0.4);
}

.mega-menu-item:hover .mega-menu-icon::after {
    transform: translate(-50%, -50%) scale(1.5);
}

/* ============================================
   MENU ITEM TEXT
   ============================================ */

.mega-menu-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu-item:hover .mega-menu-title {
    color: var(--secondary-color);
    transform: translateX(4px);
}

.mega-menu-title i.arrow {
    font-size: 14px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.mega-menu-item:hover .mega-menu-title i.arrow {
    opacity: 1;
    transform: translateX(0);
}

.mega-menu-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.mega-menu-item:hover .mega-menu-description {
    color: #333;
}

/* ============================================
   FEATURED BADGE
   ============================================ */

.mega-menu-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--gold-color) 0%, #f4d03f 100%);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   MEGA MENU FOOTER
   ============================================ */

.mega-menu-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid rgba(12, 60, 99, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.mega-menu-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.4s var(--transition-ease);
    box-shadow: 0 8px 24px rgba(12, 60, 99, 0.3);
    position: relative;
    overflow: hidden;
}

.mega-menu-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.mega-menu-cta:hover::before {
    width: 300px;
    height: 300px;
}

.mega-menu-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 36px rgba(12, 60, 99, 0.4);
    background: linear-gradient(135deg, var(--secondary-color) 0%, #28a810 100%);
}

.mega-menu-cta i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.mega-menu-cta:hover i {
    transform: translateX(4px);
}

.mega-menu-cta span {
    position: relative;
    z-index: 1;
}

.mega-menu-help {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.mega-menu-help i {
    font-size: 24px;
    color: var(--secondary-color);
    animation: phoneRing 2s ease-in-out infinite;
}

@keyframes phoneRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-15deg); }
    20%, 40% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
}

.mega-menu-help strong {
    color: var(--primary-color);
    font-size: 16px;
}

/* ============================================
   STAGGERED ANIMATION
   ============================================ */

.mega-menu-item {
    animation: menuItemFadeIn 0.5s ease backwards;
}

.mega-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mega-menu-item:nth-child(2) { animation-delay: 0.15s; }
.mega-menu-item:nth-child(3) { animation-delay: 0.2s; }
.mega-menu-item:nth-child(4) { animation-delay: 0.25s; }
.mega-menu-item:nth-child(5) { animation-delay: 0.3s; }
.mega-menu-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes menuItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(-15deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .mega-menu-dropdown {
        min-width: 700px;
    }
    
    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    .mega-menu-dropdown {
        min-width: 600px;
    }
    
    .mega-menu-content {
        padding: 30px;
    }
    
    .mega-menu-grid {
        gap: 20px;
    }
    
    .mega-menu-item {
        padding: 20px;
    }
    
    .mega-menu-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    /* Hide mega menu on mobile, use standard mobile menu */
    .mega-menu-dropdown {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .mega-menu-dropdown,
    .mega-menu-item,
    .mega-menu-icon,
    .mega-menu-trigger i,
    .mega-menu-cta {
        animation: none !important;
        transition: none !important;
    }
    
    .mega-menu-item:hover {
        transform: none;
    }
}

/* Focus States for Keyboard Navigation */
.mega-menu-trigger:focus,
.mega-menu-item:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 4px;
}

/* ============================================
   LOADING SKELETON (Optional)
   ============================================ */

.mega-menu-skeleton {
    background: linear-gradient(
        90deg,
        rgba(12, 60, 99, 0.05) 25%,
        rgba(12, 60, 99, 0.1) 50%,
        rgba(12, 60, 99, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 16px;
    height: 200px;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   ADDITIONAL ENHANCEMENTS
   ============================================ */

/* Dropdown Arrow Indicator */
.mega-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--menu-bg);
    filter: drop-shadow(0 -4px 8px rgba(12, 60, 99, 0.1));
    z-index: 1;
}

/* Backdrop Blur Effect */
.mega-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9996;
    pointer-events: none;
}

.mega-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Smooth Scroll Padding for Fixed Navbar */
html {
    scroll-padding-top: 100px;
}