/* ==========================================================================
   Navigation Component Styles - PREMIUM MODERN DESIGN
   Ultra-compact with sophisticated visual effects and enhanced UX
   ========================================================================== */

/* ==========================================================================
   NAVBAR SPACING CONTROL - ULTRA COMPACT HEIGHT
   ========================================================================== */

.navbar-modern {
  margin-bottom: 0 !important;
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 28px; /* Further reduced for ultra compact */
  height: auto;
  overflow: visible;
}

.navbar-modern.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px) saturate(1.8);
  -webkit-backdrop-filter: blur(25px) saturate(1.8);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

/* Main content area - no top padding */
.main-content {
  padding-top: 0 !important;
  min-height: calc(100vh - 400px);
}

/* Messages container - only shows space when has content */
.messages-container {
  padding: 1rem 0 0.5rem;
  margin: 0;
}

.messages-container:empty {
  display: none;
  padding: 0;
}

/* First container in main content gets spacing */
.main-content > .container:first-of-type,
.main-content > .container-fluid:first-of-type,
.main-content > .container-modern:first-of-type {
  padding-top: 1.5rem;
}

/* When messages exist, adjust spacing below them */
.messages-container + * {
  padding-top: 0.5rem !important;
}

/* ==========================================================================
   IMPROVED NAVBAR LAYOUT - ULTRA COMPACT SPREAD OUT DESIGN
   ========================================================================== */

/* Container with minimal padding for ultra compact height */
.navbar-modern .container-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.05rem 1.5rem; /* Further reduced vertical padding */
}

/* Navbar main wrapper - full width spread */
.navbar-modern .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    gap: 0;
}

/* Brand Section - Far Left, minimal spacing */
.navbar-brand-modern {
    flex-shrink: 0;
    margin-right: 0;
    padding-right: 1.5rem;
    padding: 0.05rem 0; /* Ultra minimal padding */
    display: flex;
    align-items: center;
}

/* Navbar collapse - take remaining space */
.navbar-collapse {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-grow: 1;
}

/* Ensure all navbar items are properly aligned and sized */
.navbar-collapse .navbar-nav {
    height: auto;
    align-items: center;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

/* Navigation Menu - Center with better spacing */
.navbar-nav.me-auto {
    margin-left: 2rem !important;
    margin-right: auto !important;
    display: flex;
    align-items: center;
    gap: 0.6rem; /* Slightly increased for better separation */
}

/* Auth Buttons - Far Right, minimal spacing */
.navbar-nav.ms-auto.auth-buttons {
    margin-left: auto !important;
    margin-right: 0 !important;
    padding-left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Hide navbar collapse on mobile by default */
@media (max-width: 991.98px) {
  .navbar-collapse:not(.show) {
    display: none !important;
  }
  
  .navbar-collapse.show {
    display: flex !important;
  }
}

/* ==========================================================================
   MAIN NAVIGATION STYLES
   ========================================================================== */

/* Main Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-600);
  background-color: var(--primary-50);
  text-decoration: none;
}

.nav-link.active {
  color: var(--primary-600);
  background-color: var(--primary-50);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background-color: var(--primary-600);
  border-radius: var(--radius-full);
}

/* Modern Nav Link Styles - PREMIUM EFFECTS with LARGER FONT */
.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.1rem 0.5rem !important; /* Ultra minimal vertical padding */
    color: var(--text-secondary, #475569);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem; /* INCREASED for better readability */
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.0; /* Ultra tight line height */
    position: relative;
    overflow: hidden;
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 0.5rem;
}

.nav-link-modern:hover {
    color: var(--primary-600, #4338ca);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(99, 102, 241, 0.1);
}

.nav-link-modern:hover::before {
    opacity: 1;
}

.nav-link-modern:hover i {
    transform: scale(1.1);
    color: var(--primary-600, #4338ca);
}

.nav-link-modern.active {
    color: var(--primary-600, #4338ca);
    font-weight: 600;
    position: relative;
}

.nav-link-modern.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
    animation: activeIndicator 0.3s ease-out;
}

@keyframes activeIndicator {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 24px;
        opacity: 1;
    }
}

.nav-link-modern i {
    font-size: 0.95rem; /* INCREASED for better balance */
    margin-right: 0.15rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary, #64748b);
}

/* ==========================================================================
   MOBILE NAVIGATION
   ========================================================================== */

.nav-mobile {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: var(--z-fixed);
}

.nav-toggle-line {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  transform-origin: 1px;
}

.nav-toggle.active .nav-toggle-line:nth-child(1) {
  transform: rotate(45deg);
}

.nav-toggle.active .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .nav-toggle-line:nth-child(3) {
  transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.nav-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background-color: white;
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  z-index: var(--z-modal);
  overflow-y: auto;
}

.nav-mobile-menu.active {
  transform: translateX(0);
}

.nav-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.nav-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-mobile-close:hover {
  background-color: var(--neutral-100);
  color: var(--text-primary);
}

.nav-mobile-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-mobile-item {
  margin-bottom: var(--space-2);
}

.nav-mobile-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-mobile-link:hover {
  color: var(--primary-600);
  background-color: var(--primary-50);
  text-decoration: none;
}

.nav-mobile-link.active {
  color: var(--primary-600);
  background-color: var(--primary-50);
}

/* ==========================================================================
   DROPDOWN NAVIGATION - FIXED FOR MOBILE
   ========================================================================== */

/* Desktop Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

/* Desktop hover - only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* Touch device & Mobile support - show dropdown on click */
.nav-dropdown.show .nav-dropdown-menu,
.dropdown.show .dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  display: block !important;
}

.nav-dropdown-item {
  margin: 0;
}

.nav-dropdown-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-dropdown-link:hover {
  color: var(--primary-600);
  background-color: var(--primary-50);
  text-decoration: none;
}

/* Dropdown Menu Modern Styles - Premium Glassmorphism */
.dropdown-menu-modern {
    min-width: 240px;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    position: relative;
    overflow: hidden;
}

.dropdown-menu-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #334155;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.dropdown-item-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.08), transparent);
    transition: left 0.3s ease;
}

.dropdown-item-modern:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    text-decoration: none;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.dropdown-item-modern:hover::before {
    left: 100%;
}

.dropdown-item-modern i {
    font-size: 0.875rem;
    width: 1.25rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item-modern:hover i {
    transform: scale(1.1) rotate(5deg);
    color: #4338ca;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   CTA BUTTONS (Login & Get Started) - ULTRA COMPACT with LARGER FONT
   ========================================================================== */

.nav-link-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.35rem 1rem !important; /* Increased padding for better visibility */
    font-weight: 600 !important;
    font-size: 0.95rem !important; /* INCREASED for better readability */
    border-radius: 0.75rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
    margin: 0 !important;
    white-space: nowrap;
    line-height: 1.0; /* Ultra tight line height */
    height: auto;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-height: 32px; /* Ensure minimum touch target */
}

/* Login Button - Modern Outline with Glass Effect */
.nav-link-button.btn-login {
    color: var(--primary-600) !important;
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-link-button.btn-login:hover {
    color: white !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border-color: transparent !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3), 0 4px 12px rgba(99, 102, 241, 0.2) !important;
    border: none !important;
}

/* Get Started Button - Premium Gradient with 3D Effect */
.nav-link-button.btn-get-started {
    color: white !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25), 0 2px 8px rgba(139, 92, 246, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.nav-link-button.btn-get-started::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link-button.btn-get-started:hover::before {
    left: 100%;
}

.nav-link-button.btn-get-started:hover {
    background: linear-gradient(135deg, #5b5bde 0%, #7c3aed 50%, #c026d3 100%) !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4), 0 6px 20px rgba(139, 92, 246, 0.3) !important;
}

/* Icon styling inside buttons with micro-animations */
.nav-link-button i {
    font-size: 0.95rem; /* INCREASED for better balance */
    margin-right: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.nav-link-button:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Ensure buttons maintain proper spacing in auth section */
.navbar-nav.ms-auto.auth-buttons {
    margin-left: auto !important;
    margin-right: 0 !important;
    padding-left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Increased gap for better button separation */
    flex-shrink: 0;
}

/* ==========================================================================
   BADGE STYLES
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-full);
    background-color: var(--primary-500);
    margin-left: var(--space-2);
}

/* ==========================================================================
   ALERT STYLES FOR MESSAGES
   ========================================================================== */

.alert {
    position: relative;
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error,
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* ==========================================================================
   REMOVE BLUE BOX ON LOGO CLICK
   ========================================================================== */

.navbar-brand-modern:focus {
    outline: none;
    box-shadow: none;
}

.navbar-brand-modern:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.5);
    outline-offset: 4px;
    border-radius: var(--radius-lg);
}

.navbar-brand-modern {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.brand-icon-modern:focus {
    outline: none;
    box-shadow: none;
}

/* ==========================================================================
   CONTAINER STYLES
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ==========================================================================
   JVAULT PREMIUM DROPDOWN STYLING
   Premium styling for employer-only JVault menu item
   ========================================================================== */

.dropdown-item-jvault {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 193, 7, 0.08) 100%);
    border-left: 3px solid #ffc107;
    font-weight: 600 !important;
    color: #d97706 !important;
    margin: 0.25rem 0;
    transition: all 0.3s ease;
}

.dropdown-item-jvault:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18) 0%, rgba(255, 193, 7, 0.18) 100%);
    color: #b45309 !important;
    transform: translateX(3px);
    border-left-width: 4px;
}

.dropdown-item-jvault:active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 193, 7, 0.25) 100%);
}

/* Crown icon with pulse animation */
.dropdown-item-jvault i.fa-crown {
    color: #ffc107;
    margin-right: 0.5rem;
    animation: crownPulse 2s ease-in-out infinite;
}

@keyframes crownPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.15);
        filter: brightness(1.3);
    }
}

/* Premium badge styling */
.badge-jvault {
    font-size: 0.65rem !important;
    padding: 0.25em 0.6em !important;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    color: #000 !important;
    font-weight: 700 !important;
    border: 1px solid rgba(255, 193, 7, 0.5);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.dropdown-item-jvault:hover .badge-jvault {
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.5);
    transform: scale(1.05);
    border-color: #ffc107;
}

/* Add subtle glow effect on hover */
.dropdown-item-jvault:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #ffd700, #ffc107);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

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

/* Large Desktop - maximum spread */
@media (min-width: 1400px) {
    .navbar-modern .container-modern {
        max-width: 1600px;
        padding: 0.1rem 2.5rem; /* Further reduced */
    }
    
    .navbar-nav.me-auto {
        margin-left: 3rem !important;
        gap: 0.7rem; /* Consistent spacing */
    }
    
    .nav-link-modern {
        padding: 0.15rem 0.8rem !important;
        font-size: 1.05rem; /* INCREASED for large screens */
    }
    
    .navbar-nav.ms-auto.auth-buttons {
        padding-left: 2rem;
    }
    
    .nav-link-button {
        font-size: 1rem !important; /* INCREASED for large screens */
        padding: 0.4rem 1.2rem !important; /* Better proportion for large screens */
    }
}

/* Standard Desktop */
@media (min-width: 992px) and (max-width: 1399px) {
    .navbar-modern .container-modern {
        max-width: 100%;
        padding: 0.1rem 2rem; /* Further reduced */
    }
    
    .navbar-nav.me-auto {
        margin-left: 2rem !important;
        gap: 0.6rem; /* Consistent spacing */
    }
    
    .navbar-nav.ms-auto.auth-buttons {
        padding-left: 1.5rem;
        gap: 0.75rem; /* Better button separation */
    }
}

/* Tablet & Mobile Responsive - Premium Card Design */
@media (max-width: 991.98px) {
    /* Container adjustments */
    .navbar-modern .container-modern {
        padding: 0.2rem 1rem; /* Slightly more padding on mobile for touch */
    }
    
    .navbar-brand-modern {
        padding-right: 1rem;
    }
    
    /* Display hamburger button - Modern Glassmorphic Design */
    .navbar-toggler-modern {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px; /* Slightly larger for better touch */
        height: 40px;
        padding: 0.5rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 0.75rem;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        z-index: 1031;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-toggler-modern:hover {
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.3);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    }
    
    .navbar-toggler-modern:focus {
        outline: 2px solid rgba(79, 70, 229, 0.5);
        outline-offset: 2px;
        border-color: rgba(79, 70, 229, 0.3);
    }
    
    /* Hide navbar-collapse by default on mobile */
    .navbar-collapse {
        display: none !important;
    }
    
    /* Show navbar-collapse when Bootstrap adds 'show' class - Premium Card */
    .navbar-collapse.show {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px) saturate(1.8);
        -webkit-backdrop-filter: blur(25px) saturate(1.8);
        padding: 1.5rem;
        border-radius: 1.25rem;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 10px 30px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0;
        z-index: 1030;
        animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .navbar-collapse.show::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Stack nav items vertically */
    .navbar-nav {
        width: 100% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
        margin: 0 !important;
    }
    
    .navbar-nav.me-auto,
    .navbar-nav.ms-auto {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
    }
    
    .navbar-nav.ms-auto.auth-buttons {
        margin-top: 1.25rem !important;
        padding-top: 1.25rem !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        gap: 0.5rem; /* Consistent button spacing in mobile */
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link-modern {
        width: 100%;
        padding: 1rem 1.25rem !important;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        border-radius: 0.75rem;
        font-size: 1rem !important; /* INCREASED for mobile readability */
        margin-bottom: 0.25rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }
    
    .nav-link-modern::before {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    }
    
    /* Auth buttons full width - Premium Design */
    .nav-link-button {
        width: 100% !important;
        text-align: center;
        padding: 0.875rem 1.25rem !important;
        justify-content: center !important;
        font-size: 1rem !important; /* INCREASED for mobile */
        margin-bottom: 0.5rem;
        border-radius: 0.75rem !important;
        position: relative;
        overflow: hidden;
        min-height: 44px; /* Ensure proper touch target size */
    }
    
    /* Mobile dropdown styling */
    .nav-item.dropdown {
        width: 100%;
    }
    
    .dropdown-menu,
    .dropdown-menu-modern,
    .dropdown-menu-end {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(79, 70, 229, 0.05) !important;
        border-radius: 0.5rem !important;
        padding: 0.5rem !important;
        float: none !important;
    }
    
    .dropdown-toggle,
    .nav-link-modern.dropdown-toggle,
    .nav-link-button.dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }
    
    .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }
    
    .show > .dropdown-toggle::after {
        transform: rotate(180deg);
    }
    
    .dropdown-item,
    .dropdown-item-modern {
        padding: 1rem 1.25rem !important;
        font-size: 1rem !important; /* INCREASED */
        border-radius: 0.75rem !important;
        margin-bottom: 0.25rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .dropdown-item:hover,
    .dropdown-item-modern:hover {
        background: rgba(99, 102, 241, 0.12) !important;
        transform: translateX(6px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    }
    
    .dropdown-divider {
        margin: 0.5rem 0;
    }
    
    /* JVault mobile adjustments */
    .dropdown-item-jvault {
        margin: 0.5rem 0;
        padding: 1rem !important;
    }
    
    .dropdown-item-jvault i.fa-crown {
        font-size: 1.1rem;
    }
    
    .badge-jvault {
        font-size: 0.7rem !important;
        padding: 0.3em 0.7em !important;
    }
}

/* Hide hamburger on desktop */
@media (min-width: 992px) {
    .navbar-toggler-modern {
        display: none !important;
    }
    
    .navbar-collapse {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: transparent;
        padding: 0;
        border: none;
        box-shadow: none;
        margin: 0;
    }
    
    .navbar-nav {
        flex-direction: row !important;
        align-items: center !important;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .navbar-modern .container-modern {
        padding: 0.15rem 0.75rem; /* Ultra minimal */
    }
    
    .navbar-brand-modern {
        padding-right: 0.5rem;
        font-size: 0.9rem;
    }
    
    .navbar-collapse.show {
        left: 0.5rem;
        right: 0.5rem;
    }
}

/* ==========================================================================
   PREMIUM ENHANCEMENTS - LOADING STATES & MICRO-INTERACTIONS
   ========================================================================== */

/* Navbar Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.navbar-modern.loading {
    position: relative;
    overflow: hidden;
}

.navbar-modern.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
    z-index: 1031;
}

/* Pulse Effect for Active Elements */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.nav-link-modern.active {
    animation: pulseGlow 2s infinite;
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
.nav-link-modern:focus-visible,
.nav-link-button:focus-visible,
.navbar-brand-modern:focus-visible,
.navbar-toggler-modern:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .nav-link-modern,
    .nav-link-button,
    .dropdown-item-modern {
        border: 1px solid currentColor;
    }
    
    .navbar-modern {
        border: 2px solid;
    }
}

/* Print Styles */
@media print {
    .navbar-modern,
    .navbar-collapse,
    .nav-mobile,
    .nav-toggle {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0 !important;
    }
}
/* ==========================================================================
   APP-SPECIFIC SUB-NAVIGATION - PREMIUM DESIGN (REDESIGNED)
   Matches main navigation aesthetic with ultra-compact spacing
   ========================================================================== */

.app-subnav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin: 0;
    position: sticky;
    top: 28px; /* Matches ultra-compact navbar height */
    z-index: 1020;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 36px; /* Ultra-compact sub-nav height */
}

.app-subnav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px) saturate(1.8);
    -webkit-backdrop-filter: blur(25px) saturate(1.8);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.subnav-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0; /* Ultra-compact vertical padding */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.25) transparent;
    max-width: 1400px;
    margin: 0 auto;
}

.subnav-wrapper::-webkit-scrollbar {
    height: 3px;
}

.subnav-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.subnav-wrapper::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.subnav-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

.subnav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.6rem; /* Ultra-compact padding matching nav */
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem; /* Slightly smaller for secondary nav */
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    line-height: 1.0;
}

.subnav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 0.5rem;
}

.subnav-link:hover {
    color: var(--primary-600, #4338ca);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15), 0 2px 4px rgba(99, 102, 241, 0.1);
    background: rgba(99, 102, 241, 0.05);
}

.subnav-link:hover::before {
    opacity: 1;
}

.subnav-link:hover i {
    transform: scale(1.1);
    color: var(--primary-600, #4338ca);
}

.subnav-link.active {
    color: var(--primary-600, #4338ca);
    background: rgba(99, 102, 241, 0.12);
    font-weight: 600;
    position: relative;
}

.subnav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
    animation: activeIndicator 0.3s ease-out;
}

@keyframes activeIndicator {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 20px;
        opacity: 1;
    }
}

.subnav-link i {
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary, #64748b);
    margin-right: 0.1rem;
}

.subnav-link.active i {
    color: var(--primary-600, #4338ca);
}

/* Micro-interaction enhancements */
.subnav-link {
    animation: subtleSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes subtleSlideIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE ENHANCEMENTS - PREMIUM MOBILE DESIGN
   ========================================================================== */

@media (max-width: 991.98px) {
    .app-subnav {
        top: 28px; /* Matches mobile navbar height */
    }
    
    .subnav-wrapper {
        gap: 0.3rem;
        padding: 0.3rem 0;
    }
    
    .subnav-link {
        padding: 0.2rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .subnav-link i {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .subnav-link span {
        display: none;
    }
    
    .subnav-link {
        padding: 0.4rem;
        justify-content: center;
        min-width: 44px;
        border-radius: 0.75rem;
    }
    
    .subnav-link i {
        font-size: 1rem;
        margin: 0;
    }
    
    .subnav-wrapper {
        padding: 0.25rem 0;
    }
}

/* Large desktop optimization */
@media (min-width: 1400px) {
    .subnav-wrapper {
        max-width: 1600px;
        gap: 0.6rem;
    }
    
    .subnav-link {
        padding: 0.2rem 0.8rem;
        font-size: 0.95rem;
    }
    
    .subnav-link i {
        font-size: 0.9rem;
    }
}


/* ==========================================================================
   FLOATING CARD SUBNAVIGATION - PREMIUM DESIGN
   Completely different approach with individual floating cards
   ========================================================================== */

.app-subnav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 0;
    margin: 0;
    position: sticky;
    top: 28px;
    z-index: 1020;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.app-subnav.scrolled {
    background: rgba(255, 255, 255, 0.99);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Centered container */
.app-subnav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.subnav-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem; /* Increased spacing for card breathing room */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
    padding: 0.5rem 0;
}

.subnav-wrapper::-webkit-scrollbar {
    height: 2px;
}

.subnav-wrapper::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 2px;
}

/* Floating Card Design - Core Styles */
.subnav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 70px; /* Taller cards for better presence */
    padding: 0.75rem;
    text-decoration: none;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Card hover effects */
.subnav-link:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(99, 102, 241, 0.15);
}

/* Active card styling */
.subnav-link.active {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 8px 24px rgba(99, 102, 241, 0.15),
        0 4px 12px rgba(99, 102, 241, 0.1),
        0 2px 6px rgba(99, 102, 241, 0.05);
}

/* Icon styling */
.subnav-link i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subnav-link:hover i {
    color: var(--primary-600, #4338ca);
    transform: scale(1.1);
}

.subnav-link.active i {
    color: var(--primary-600, #4338ca);
    transform: scale(1.05);
}

/* Text styling */
.subnav-link span {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    line-height: 1.2;
}

.subnav-link:hover span {
    color: var(--primary-600, #4338ca);
    font-weight: 600;
}

.subnav-link.active span {
    color: var(--primary-600, #4338ca);
    font-weight: 600;
}

/* Active indicator - bottom border pulse */
.subnav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 3px 3px 0 0;
    animation: cardPulse 2s infinite;
}

@keyframes cardPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scaleX(1);
    }
    50% {
        opacity: 1;
        transform: scaleX(1.05);
    }
}

/* Card entrance animation */
.subnav-link {
    animation: cardFloatIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

@keyframes cardFloatIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Stagger animation delays for each card */
.subnav-link:nth-child(1) { animation-delay: 0.1s; }
.subnav-link:nth-child(2) { animation-delay: 0.2s; }
.subnav-link:nth-child(3) { animation-delay: 0.3s; }
.subnav-link:nth-child(4) { animation-delay: 0.4s; }
.subnav-link:nth-child(5) { animation-delay: 0.5s; }
.subnav-link:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 991.98px) {
    .app-subnav {
        top: 28px;
        padding: 0.75rem 0;
    }
    
    .app-subnav-container {
        padding: 0 1rem;
    }
    
    .subnav-wrapper {
        gap: 0.75rem;
        padding: 0.25rem 0;
    }
    
    .subnav-link {
        min-width: 70px;
        height: 60px;
        padding: 0.6rem;
    }
    
    .subnav-link i {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }
    
    .subnav-link span {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .app-subnav-container {
        padding: 0 0.75rem;
    }
    
    .subnav-wrapper {
        gap: 0.5rem;
    }
    
    .subnav-link {
        min-width: 60px;
        height: 55px;
        padding: 0.5rem;
    }
    
    .subnav-link i {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .subnav-link span {
        font-size: 0.65rem;
        display: block; /* Ensure text is visible */
    }
}

@media (min-width: 1400px) {
    .app-subnav-container {
        max-width: 1600px;
        padding: 0 2rem;
    }
    
    .subnav-wrapper {
        gap: 1.25rem;
    }
    
    .subnav-link {
        min-width: 90px;
        height: 75px;
        padding: 1rem;
    }
    
    .subnav-link i {
        font-size: 1.4rem;
        margin-bottom: 0.6rem;
    }
    
    .subnav-link span {
        font-size: 0.8rem;
    }
}


/* ==========================================================================
   ACCESSIBILITY & ENHANCEMENTS
   ========================================================================== */

/* Focus states */
.subnav-link:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .subnav-link,
    .subnav-link i,
    .subnav-link span {
        transition: none !important;
        animation: none !important;
    }
    
    .subnav-link:hover {
        transform: none !important;
    }
    
    .subnav-link.active {
        transform: none !important;
    }
    
    @keyframes cardFloatIn,
    @keyframes cardPulse {
        from, to {
            transform: none;
            opacity: 1;
        }
    }
}

/* Loading state */
.app-subnav.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1, transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}