/* ===== ENHANCED NAVIGATION CSS - COMPREHENSIVE RESPONSIVE DESIGN ===== */

/* ===== HEADER & NAVIGATION BASE STYLES ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(28, 41, 81, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 0.6rem 0;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(28, 41, 81, 0.1);
    padding: 0.4rem 0;
}

.navbar {
    width: 100%;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* ===== RESPONSIVE LOGO SECTION ===== */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    background: transparent;
}

.logo-icon {
    width: 140px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    overflow: visible;
    background: transparent;
}

.header.scrolled .logo-icon {
    width: 120px;
    height: 60px;
}

.main-logo,
.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    filter: brightness(1.1) contrast(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
    max-width: 100%;
    display: block;
    transform: scale(1);
    background: transparent;
    mix-blend-mode: normal;
    opacity: 1;
    visibility: visible;
}

.main-logo:hover,
.logo-image:hover {
    filter: brightness(1.2) contrast(1.2) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transform: scale(1.05);
    background: transparent;
}

/* Fallback styling if image fails to load */
.logo-icon::before {
    content: "MUNDRA LEGAL";
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--deep-navy, #1C2951);
    font-size: 0.8rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo-image[src=""]:not([src*="."])::before,
.logo-image:not([src])::before {
    opacity: 1;
}

.logo-text {
    display: none; /* Hide text since logo includes text */
}

/* ===== DESKTOP NAVIGATION ===== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header.scrolled .nav-menu {
    gap: 1.2rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--deep-navy, #1C2951);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gold, #D4AF37);
    transition: width 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-gold, #D4AF37);
}

/* Dropdown specific styling */
.dropdown-toggle i {
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

/* ===== MEGA DROPDOWN MENU - CLEAN & SIMPLE ===== */
.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(28, 41, 81, 0.15),
        0 0 0 1px rgba(212, 175, 55, 0.1);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
    display: flex;
    min-width: 720px;
    max-width: 750px;
    max-height: 70vh;
    transform-origin: top center;
    overflow: hidden;
}

/* Decorative gradient border */
.mega-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #3b82f6 0%, 
        #8b5cf6 20%,
        #10b981 40%,
        #f59e0b 60%,
        #06b6d4 80%,
        #ec4899 100%
    );
    z-index: 10;
}

.has-dropdown:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Two Column Layout */
.dropdown-grid-simple {
    display: flex;
    width: 100%;
}

/* Left Column - Categories */
.dropdown-grid-simple {
    display: grid;
    grid-template-columns: 320px 1fr;
    width: 100%;
}

/* Category List Column (Left) with subtle gradient */
.dropdown-categories-list {
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    max-height: 70vh;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

/* Category Item */
.dropdown-category {
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.dropdown-category:last-child {
    border-bottom: none;
}

/* Category Header - Hoverable with Color Accents */
.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.category-header:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.04) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.dropdown-category.active .category-header {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.03) 100%);
    border-left: 3px solid #D4AF37;
}

.category-header i:first-child {
    font-size: 1.1rem;
    width: 22px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Color-coded icons for each category */
.dropdown-category:nth-child(1) .category-header i:first-child { 
    color: #3b82f6; /* Blue - Documentation */
}
.dropdown-category:nth-child(2) .category-header i:first-child { 
    color: #ef4444; /* Red - Legal */
}
.dropdown-category:nth-child(3) .category-header i:first-child { 
    color: #8b5cf6; /* Purple - Company */
}
.dropdown-category:nth-child(4) .category-header i:first-child { 
    color: #10b981; /* Green - Taxation */
}
.dropdown-category:nth-child(5) .category-header i:first-child { 
    color: #f59e0b; /* Orange - IP */
}
.dropdown-category:nth-child(6) .category-header i:first-child { 
    color: #06b6d4; /* Cyan - Licenses */
}
.dropdown-category:nth-child(7) .category-header i:first-child { 
    color: #ec4899; /* Pink - Challan */
}

.dropdown-category.active .category-header i:first-child {
    color: #D4AF37;
    transform: scale(1.1);
}

.category-header span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    transition: color 0.3s ease;
}

.dropdown-category.active .category-header span {
    color: #D4AF37;
}

.category-header .expand-icon {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-left: auto;
    transition: color 0.3s ease;
}

.dropdown-category.active .category-header .expand-icon {
    color: #D4AF37;
}

/* Right Column - Services Panel with Gradient */
.category-services-panel {
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 70vh;
    position: relative;
}

/* Decorative accent in services panel */
.category-services-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.3) 0%, 
        rgba(139, 92, 246, 0.3) 25%,
        rgba(16, 185, 129, 0.3) 50%,
        rgba(245, 158, 11, 0.3) 75%,
        rgba(6, 182, 212, 0.3) 100%
    );
}

.category-items {
    display: none;
}

.dropdown-category.active .category-items {
    display: block;
}

.category-items a {
    display: block;
    padding: 0.7rem 1rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: white;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient background on hover */
.category-items a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.08) 0%, transparent 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.category-items a:hover::before {
    width: 100%;
}

.category-items a span,
.category-items a::after {
    position: relative;
    z-index: 1;
}

.category-items a:hover {
    background: white;
    color: #D4AF37;
    padding-left: 1.3rem;
    border-left-color: #D4AF37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
    transform: translateX(2px);
}

/* Active category styling */
.dropdown-category.active .category-header {
    background: #f0f4f8;
    border-left: 3px solid #D4AF37;
}

.dropdown-category.active .category-header span {
    color: #D4AF37;
}

/* Scrollbar Styling */
.dropdown-categories-list::-webkit-scrollbar,
.category-services-panel::-webkit-scrollbar {
    width: 6px;
}

.dropdown-categories-list::-webkit-scrollbar-track,
.category-services-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dropdown-categories-list::-webkit-scrollbar-thumb,
.category-services-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dropdown-categories-list::-webkit-scrollbar-thumb:hover,
.category-services-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== MOBILE HAMBURGER MENU ===== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.3rem;
    padding: 0.5rem;
    z-index: 1002;
    background: none;
    border: none;
}

/* Show hamburger on ALL mobile devices */
@media (max-width: 1023px) {
    .hamburger {
        display: flex !important;
        position: relative;
        z-index: 1003;
    }
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--deep-navy, #1C2951);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Extra Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .dropdown-menu {
        width: 1000px;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }
    
    .nav-container {
        padding: 0 2rem;
    }
}

/* Large Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .dropdown-menu {
        width: 90vw;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }
    
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
}

/* Medium Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .mega-dropdown {
        min-width: 950px;
        max-width: 90vw;
    }
    
    .dropdown-grid {
        gap: 0;
    }
    
    .dropdown-col {
        padding: 1.2rem;
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .dropdown-col h4 {
        font-size: 0.95rem;
    }
    
    .services-list a {
        font-size: 0.8rem;
        padding: 0.55rem 0.7rem;
    }
}

/* Large Desktop - Optimize spacing */
@media (min-width: 1200px) {
    .mega-dropdown {
        min-width: 1150px;
    }
    
    .dropdown-grid {
        padding: 2rem;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .dropdown-menu {
        width: 80vw;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }
    
    .nav-menu {
        gap: 0.6rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
    }
    
    .logo-icon {
        width: 110px;
        height: 55px;
    }
    
    .header.scrolled .logo-icon {
        width: 95px;
        height: 47px;
    }
    
    .main-logo,
    .logo-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 4px;
        filter: brightness(1.1) contrast(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        transition: all 0.3s ease;
        max-width: 100%;
        display: block;
        transform: scale(1);
        background: transparent;
        mix-blend-mode: normal;
        opacity: 1;
        visibility: visible;
    }
}

/* ===== MOBILE NAVIGATION (BELOW 1024px) ===== */
@media (max-width: 1023px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0;
        transition: all 0.3s ease;
        overflow-y: auto;
        z-index: 9999;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
    }

    .nav-link::before {
        display: none;
    }

    /* Mobile Mega Dropdown - Stacked Layout */
    .mega-dropdown {
        position: static;
        width: 100%;
        min-width: auto;
        max-width: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: white;
        margin: 0;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        max-height: none;
        overflow: visible;
        display: block;
    }

    .dropdown-grid-simple {
        display: block;
        grid-template-columns: none;
    }

    .dropdown-categories-list {
        border-right: none;
        max-height: none;
    }

    .dropdown-category {
        border-bottom: 1px solid #e2e8f0;
    }

    .category-header {
        padding: 1rem 1.5rem;
    }

    .category-header i:first-child {
        font-size: 1.1rem;
    }

    .category-header span {
        font-size: 0.95rem;
    }

    /* Mobile: Make it expandable with click */
    .category-services-panel {
        display: none;
    }

    .category-items {
        display: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: #f8fafc;
        padding: 0;
    }

    .dropdown-category.active .category-items {
        display: block;
        max-height: 1000px;
        padding: 0.5rem 0;
    }

    .category-items a {
        padding: 0.75rem 1.5rem 0.75rem 3.5rem;
        font-size: 0.9rem;
        border-radius: 0;
        margin-bottom: 0;
    }

    .hamburger {
        display: flex;
        position: relative;
        z-index: 1003;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .logo-icon {
        width: 100px;
        height: 50px;
    }
    
    .header.scrolled .logo-icon {
        width: 85px;
        height: 42px;
    }
    
    .main-logo,
    .logo-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 4px;
        filter: brightness(1.1) contrast(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        transition: all 0.3s ease;
        max-width: 100%;
        display: block;
        transform: scale(1);
        background: transparent;
        mix-blend-mode: normal;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu {
        padding: 1.5rem;
    }
    
    .hamburger {
        display: flex;
        position: relative;
        z-index: 1003;
    }
}

/* Mobile Portrait (below 576px) */
@media (max-width: 575px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo-icon {
        width: 90px;
        height: 45px;
    }
    
    .header.scrolled .logo-icon {
        width: 75px;
        height: 37px;
    }
    
    .main-logo,
    .logo-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 4px;
        filter: brightness(1.1) contrast(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        transition: all 0.3s ease;
        max-width: 100%;
        display: block;
        transform: scale(1);
        background: transparent;
        mix-blend-mode: normal;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu {
        padding: 1rem;
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .hamburger {
        display: flex;
        position: relative;
        z-index: 1003;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.8rem 0;
    }
    
    .dropdown-link {
        font-size: 0.8rem;
        padding: 0.6rem 0;
    }
    
    .dropdown-menu {
        padding: 0.8rem;
        margin-top: 0.8rem;
    }
    
    .dropdown-title {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .hamburger span {
        width: 20px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

/* Focus styles for better keyboard navigation */
.nav-link:focus,
.dropdown-link:focus,
.hamburger:focus {
    outline: 2px solid var(--primary-gold, #D4AF37);
    outline-offset: 2px;
    border-radius: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .header {
        border-bottom: 2px solid #000;
    }
    
    .nav-link {
        color: #000;
    }
    
    .dropdown-menu {
        border: 2px solid #000;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .header,
    .nav-link,
    .dropdown-menu,
    .hamburger span,
    .logo-image {
        transition: none;
    }
    
    .dropdown-toggle i {
        transform: none !important;
    }
}

/* ===== TOUCH-FRIENDLY IMPROVEMENTS ===== */
@media (max-width: 1023px) {
    /* Ensure all touch targets are at least 44px */
    .nav-link {
        min-height: 48px;
        min-width: 48px;
    }
    
    .dropdown-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .hamburger {
        min-height: 48px;
        min-width: 48px;
        padding: 12px;
    }
    
    /* Improve touch scrolling */
    .nav-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .dropdown-menu {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* GPU acceleration for smooth animations */
.nav-menu,
.dropdown-menu,
.hamburger span,
.logo-image {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce repaints during scroll */
.header {
    contain: layout style;
}

/* ===== PRINT STYLES ===== */
@media print {
    .header {
        position: static;
        background: none;
        box-shadow: none;
        padding: 1rem 0;
        border-bottom: 1px solid #000;
    }
    
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: none;
    }
    
    .logo-icon {
        width: 120px;
        height: 60px;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .header {
        background: rgba(30, 41, 59, 0.98);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-link {
        color: #e2e8f0;
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: var(--primary-gold, #D4AF37);
    }
    
    .dropdown-menu {
        background: rgba(30, 41, 59, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-title {
        color: #e2e8f0;
    }
    
    .dropdown-link {
        color: #94a3b8;
    }
    
    .dropdown-link:hover {
        color: var(--primary-gold, #D4AF37);
    }
    
    .hamburger span {
        background: #e2e8f0;
    }
    
    .nav-menu {
        background: rgba(30, 41, 59, 0.98);
    }
}

/* ===== LANDSCAPE ORIENTATION ADJUSTMENTS ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        height: 100vh;
        top: 0;
        padding-top: 80px;
    }
    
    .dropdown-menu {
        max-height: 200px;
        overflow-y: auto;
    }
}

