/* ==========================================================================
   MyFedPath Navigation CSS - TWO-PANEL MOBILE NAV
   Clean, reliable mobile navigation with desktop dropdowns preserved
   ========================================================================== */

/* CSS Variables */
:root {
    --mfp-primary: #001A45;
    --mfp-primary-hover: #002255;
    --mfp-accent: #3B82F6;
    --mfp-gold: #FBBF24;
    --mfp-text: #1F2937;
    --mfp-white: #FFFFFF;
    --mfp-header-height: 80px;
    --mfp-mobile-header-height: 76px;
    --mfp-max-width: 1200px;
    --z-header: 100;
    --z-dropdown: 1000;
    --z-mobile-nav: 9999;
}

/* ==========================================================================
   Header Base Styles
   ========================================================================== */
.mfp-header {
    position: sticky;
    top: 0;
    background: var(--mfp-primary);
    height: var(--mfp-header-height);
    z-index: var(--z-header);
    box-shadow: 0 2px 8px rgba(0, 26, 69, 0.1);
}

.mfp-header-container {
    max-width: var(--mfp-max-width);
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo - Fixed positioning and sizing */
.mfp-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 10px; /* Reduced from 20px to move logo left */
    flex-shrink: 0; /* Prevents logo from shrinking */
}

.mfp-logo-mark {
    width: auto;
    height: 74px; /* Almost full header height (80px) */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.mfp-logo-mark img,
.mfp-logo img {
    height: 74px; /* Almost full header height */
    width: auto;
    object-fit: contain;
    max-width: 280px; /* Increased to accommodate larger logo */
}

/* ==========================================================================
   Desktop Navigation - COMPLETE WITH ALL YOUR MENU ITEMS
   ========================================================================== */
.mfp-desktop-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mfp-desktop-nav > a,
.mfp-dropdown-trigger,
.mfp-nav-trigger {
    color: var(--mfp-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.mfp-desktop-nav > a:hover,
.mfp-dropdown-trigger:hover,
.mfp-nav-trigger:hover {
    opacity: 0.8;
}

/* Dropdown Container - Enhanced for your complex structure */
.mfp-dropdown {
    position: relative;
}

.mfp-dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--mfp-white);
    border-radius: 8px; /* Smaller radius for compact look */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 420px; /* Fixed width, more compact */
    padding: 8px; /* Reduced padding */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    transition-delay: 0.15s; /* Small delay before hiding */
    z-index: var(--z-dropdown);
    margin-top: 6px;
    
    /* SCROLL FIXES */
    max-height: 70vh; /* Slightly shorter */
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Right-aligned dropdowns for last items */
.mfp-dropdown:nth-last-child(-n+2) .mfp-dropdown-content {
    left: auto;
    right: 0;
    transform: none;
}

/* Show dropdown on hover - Desktop only */
@media (min-width: 992px) {
    .mfp-dropdown:hover .mfp-dropdown-content,
    .mfp-dropdown:focus-within .mfp-dropdown-content {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s; /* No delay when showing */
    }
    
    /* Keep dropdown open when hovering over the content */
    .mfp-dropdown-content:hover {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s; /* No delay when showing */
    }
    
    /* Ensure clickable area for dropdown trigger */
    .mfp-dropdown-trigger {
        position: relative;
        z-index: 1;
    }
}

/* Grid layout - SINGLE COLUMN for better space usage */
.mfp-dropdown-grid {
    display: block; /* Changed from grid to single column */
    gap: 0;
}

.mfp-dropdown-section {
    padding: 12px 20px 8px 20px; /* Much more compact */
    border-bottom: 1px solid #F3F4F6; /* Subtle separator between sections */
}

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

/* Remove full-width class since we're single column now */
.mfp-dropdown-section.full-width {
    /* No special styling needed */
}

.mfp-dropdown-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #4B5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px; /* Reduced from 20px */
    display: block;
    /* Removed border - using section borders instead */
}

/* Dropdown Links - COMPACT single-line layout */
.mfp-dropdown-content a {
    display: block; /* Changed to block for full width usage */
    width: 100%;
    padding: 8px 16px; /* Much more compact */
    color: var(--mfp-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    position: relative;
    line-height: 1.3;
    margin-bottom: 2px; /* Small gap between items */
}

.mfp-dropdown-content a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--mfp-accent);
    transform: translateX(2px);
}

.mfp-dropdown-link-content {
    display: block; /* Full width usage */
    width: 100%;
}

.mfp-dropdown-link-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--mfp-text);
    line-height: 1.2;
}

.mfp-dropdown-description {
    font-size: 12px;
    color: #6B7280;
    font-weight: 400;
    line-height: 1.3;
    display: block;
    opacity: 0.85;
    margin-top: 1px;
    /* Now uses full width of container */
}

/* Arrow indicators */
.mfp-nav-arrow,
.mfp-dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.mfp-dropdown:hover .mfp-nav-arrow,
.mfp-dropdown:hover .mfp-dropdown-arrow {
    transform: rotate(180deg);
}

/* Featured Badge */
.mfp-featured-badge,
.mfp-start-here-badge { /* Keep old class for backwards compatibility */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    color: #001A45;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    animation: mfp-badge-glow 2s ease-in-out infinite alternate;
}

/* Free Badge */
.mfp-free-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mfp-badge-icon {
    font-size: 12px;
}

/* Glow animation for the badge */
@keyframes mfp-badge-glow {
    from { box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4); }
    to { box-shadow: 0 4px 16px rgba(251, 191, 36, 0.6); }
}

/* Featured tool styling */
.mfp-featured-tool {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.04));
    border-left: 3px solid #FBBF24;
}

.mfp-featured-tool .mfp-dropdown-link-title {
    font-weight: 600;
}

.mfp-featured-tool:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.06));
}

.mfp-featured-tool:hover .mfp-featured-badge,
.mfp-featured-tool:hover .mfp-start-here-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.6);
}

/* ==========================================================================
   Desktop Auth Section - CORRECTED
   ========================================================================== */
.mfp-desktop-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.mfp-auth-btn,
.mfp-login-btn {
    padding: 8px 16px;
    border: 2px solid var(--mfp-white);
    border-radius: 6px;
    color: var(--mfp-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    background: none;
    cursor: pointer;
    white-space: nowrap; /* Prevents text from wrapping to multiple lines */
    display: inline-block; /* Ensures consistent button display */
}

.mfp-auth-btn:hover,
.mfp-login-btn:hover {
    background: var(--mfp-white);
    color: var(--mfp-primary);
}

/* ==========================================================================
   TWO-PANEL MOBILE NAVIGATION
   ========================================================================== */

/* Mobile menu button - FIXED */
.mfp-mobile-menu-btn {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    transition: background 0.2s;
}

.mfp-mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hamburger lines - FIXED */
.mfp-hamburger-line {
    position: absolute;
    left: 8px;
    width: 24px;
    height: 2px;
    background-color: #ffffff;
    display: block;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
}

.mfp-hamburger-line:nth-child(1) {
    top: 11px;
}

.mfp-hamburger-line:nth-child(2) {
    top: 19px;
}

.mfp-hamburger-line:nth-child(3) {
    top: 27px;
}

/* Hamburger animation to X */
.mfp-mobile-menu-btn.active .mfp-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mfp-mobile-menu-btn.active .mfp-hamburger-line:nth-child(2) {
    opacity: 0;
}

.mfp-mobile-menu-btn.active .mfp-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Mobile overlay */
.mfp-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-mobile-nav);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mfp-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Two-Panel Mobile Navigation System
   ========================================================================== */

/* Mobile Navigation Container */
.mfp-mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: var(--mfp-primary);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
}

.mfp-mobile-nav.active {
    right: 0;
}

/* Nav Header */
.mfp-nav-header {
    background: var(--mfp-primary);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mfp-nav-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.mfp-close-btn, 
.mfp-back-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.mfp-close-btn:hover, 
.mfp-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mfp-back-btn {
    display: none;
}

.mfp-mobile-nav.show-sub .mfp-back-btn {
    display: flex;
}

.mfp-mobile-nav.show-sub .mfp-close-btn {
    display: none;
}

/* Panel Container */
.mfp-nav-panels {
    position: relative;
    height: calc(100% - 60px);
    overflow: hidden;
}

.mfp-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: var(--mfp-primary);
}

.mfp-nav-panel.main {
    transform: translateX(0);
}

.mfp-nav-panel.sub {
    transform: translateX(100%);
    background: rgba(0, 0, 0, 0.2); /* Slightly darker for sub panel */
}

/* Slide Animation */
.mfp-mobile-nav.show-sub .mfp-nav-panel.main {
    transform: translateX(-100%);
}

.mfp-mobile-nav.show-sub .mfp-nav-panel.sub {
    transform: translateX(0);
}

/* Main Menu Items */
.mfp-main-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    color: white;
    text-decoration: none;
}

.mfp-main-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 24px;
}

.mfp-main-menu-item-content {
    flex: 1;
}

.mfp-main-menu-item-title {
    font-size: 16px;
    font-weight: 500;
    color: white;
    margin-bottom: 4px;
}

.mfp-main-menu-item-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.mfp-main-menu-arrow {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
}

/* Badge adjustments for mobile nav */
.mfp-mobile-nav .mfp-featured-badge {
    padding: 2px 6px;
    font-size: 10px;
}

/* Free badge in mobile nav */
.mfp-mobile-nav .mfp-free-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    vertical-align: middle;
}

/* Sub Panel */
.mfp-sub-panel-header {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.mfp-sub-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.mfp-sub-panel-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

/* Category Sections */
.mfp-category-section {
    padding: 0;
}

.mfp-category-title {
    padding: 12px 20px 8px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--mfp-gold);
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 0.05em;
}

.mfp-sub-menu-item {
    display: block;
    padding: 14px 20px 14px 24px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.mfp-sub-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--mfp-gold);
    padding-left: 28px;
}

.mfp-sub-menu-item.featured {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.04));
    border-left-color: var(--mfp-gold);
}

.mfp-sub-menu-item-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.3;
}

.mfp-sub-menu-item-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
}

/* Auth Section */
.mfp-auth-section {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    background: rgba(0, 0, 0, 0.1);
}

.mfp-auth-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.mfp-auth-button:last-child {
    margin-bottom: 0;
}

.mfp-auth-button.primary {
    background: var(--mfp-accent);
    color: white;
    border: 2px solid var(--mfp-accent);
}

.mfp-auth-button.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.mfp-auth-button.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.mfp-auth-button.secondary:hover {
    background: white;
    color: var(--mfp-primary);
}

/* ==========================================================================
   Mobile Styles
   ========================================================================== */
@media (max-width: 991px) {
    .mfp-header {
        height: var(--mfp-mobile-header-height);
    }
    
    .mfp-desktop-nav,
    .mfp-desktop-auth {
        display: none !important;
    }
    
    .mfp-mobile-menu-btn {
        display: block !important;
    }
    
    .mfp-hamburger-line {
        display: block !important;
    }
    
    /* Mobile logo adjustments */
    .mfp-logo-mark {
        height: 70px; /* Slightly smaller on mobile but still prominent */
    }
    
    .mfp-logo-mark img,
    .mfp-logo img {
        height: 70px; /* Slightly smaller on mobile */
        max-width: 220px;
    }
    
    /* Ensure logo doesn't crowd mobile layout */
    .mfp-logo {
        margin-right: 8px; /* Even less margin on mobile */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .mfp-logo-mark {
        height: 60px; /* Proportionally smaller for very small screens */
    }
    
    .mfp-logo-mark img,
    .mfp-logo img {
        height: 60px;
        max-width: 180px;
    }
    
    .mfp-logo {
        margin-right: 6px; /* Minimal margin on very small screens */
    }
    
    .mfp-header-container {
        padding: 0 12px; /* Reduce padding on very small screens */
    }
}

@media (min-width: 992px) {
    .mfp-mobile-menu-btn,
    .mfp-mobile-overlay,
    .mfp-mobile-nav {
        display: none !important;
    }
}

/* ==========================================================================
   Authentication States - FIXED & STRENGTHENED
   ========================================================================== */

/* Default state - show login options, hide authenticated options */
.login-only { 
    display: inline-flex !important;
}

.auth-only { 
    display: none !important;
}

/* When logged in - hide login options, show authenticated options */
body.user-logged-in .login-only { 
    display: none !important;
}

body.user-logged-in .auth-only { 
    display: inline-flex !important;
}

/* MOBILE AUTH STATES - Block display for mobile */
.mfp-mobile-nav .login-only {
    display: block !important;
}

.mfp-mobile-nav .auth-only {
    display: none !important;
}

body.user-logged-in .mfp-mobile-nav .login-only {
    display: none !important;
}

body.user-logged-in .mfp-mobile-nav .auth-only {
    display: block !important;
}

/* ==========================================================================
   Focus styles for accessibility
   ========================================================================== */
.mfp-mobile-menu-btn:focus,
button:focus {
    outline: 2px solid var(--mfp-accent);
    outline-offset: 2px;
}

/* Body State when menu is open */
body.mfp-mobile-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ==========================================================================
   Badge Utility
   ========================================================================== */
.mfp-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--mfp-gold);
    color: var(--mfp-primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
