/* KrawlX Global Navigation System Styles */

/* Mega Menu Animations */
.group:hover .group-hover\:opacity-100 {
    opacity: 1 !important;
}

.group:hover .group-hover\:visible {
    visibility: visible !important;
}

.group:hover .group-hover\:rotate-180 {
    transform: rotate(180deg) !important;
}

/* Mega Menu Items */
.mega-menu-item {
    position: relative;
    overflow: hidden;
}

.mega-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: width 0.3s ease;
    z-index: 0;
}

.mega-menu-item:hover::before {
    width: 100%;
}

.mega-menu-item > * {
    position: relative;
    z-index: 1;
}

.mega-menu-icon {
    transition: all 0.2s ease;
}

.group\/item:hover .mega-menu-icon {
    transform: scale(1.1);
}

/* Mobile Menu Animations */
.mobile-menu {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu:not(.hidden) {
    max-height: 100vh;
    overflow-y: auto;
}

/* Mobile menu slide animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease forwards;
}

.mobile-menu.hidden {
    animation: slideUp 0.3s ease forwards;
}

/* Navigation backdrop effects */
nav {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Mega menu backdrop effects */
.group > div[class*="bg-white"] {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced hover states for navigation links */
nav a {
    position: relative;
    transition: all 0.2s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3B82F6, #10B981);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 100%;
}

/* Mobile navigation specific styles */
.mobile-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.mobile-menu::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 2px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Logo enhancements */
.krawlx-logo {
    transition: all 0.3s ease;
}

.krawlx-logo:hover {
    transform: scale(1.02);
}

.krawlx-logo-image {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.group:hover .krawlx-logo-image {
    filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.2));
}

/* Button enhancements */
nav .bg-primary {
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

nav .bg-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mobile-menu {
        max-height: calc(100vh - 64px);
    }
    
    nav {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* Loading states */
.navigation-loading {
    opacity: 0.7;
    pointer-events: none;
}

.navigation-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Focus states for accessibility */
nav a:focus,
nav button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    nav {
        background: #000;
        border-bottom: 2px solid #fff;
    }
    
    nav a {
        color: #fff;
    }
    
    nav a:hover {
        background: #fff;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    nav {
        display: none;
    }
    
    body {
        padding-top: 0 !important;
    }
}