/**
 * Mobile Navigation System Module
 *
 * Contains all mobile navigation styles including:
 * - Mobile menu toggle (hamburger)
 * - Full-screen mobile menu panel
 * - Mobile navigation links and items
 * - Mobile overlay backdrop
 * - Mobile menu animations
 * - Mobile language selector
 * - Mobile theme toggle
 * - Mobile auth buttons
 * - Light/dark mode variations
 */

/* ==========================================================================
   Mobile Navigation System
   ========================================================================== */

/* CSS-only mobile menu checkbox (hidden) */
.navbar__mobile-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.navbar__mobile-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px; /* Reduced from 44px for more compact navbar */
  height: 38px; /* Reduced from 44px for more compact navbar */
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--navbar-border-radius);
  transition: all var(--navbar-transition-base);
  position: relative;
  z-index: 1003;
}

.navbar__mobile-toggle:hover {
  background: var(--navbar-hover);
}

.navbar__mobile-toggle-line {
  width: 18px;
  height: 2px;
  background: rgba(17, 24, 39, 0.8); /* Dark lines for light backgrounds */
  border-radius: 1px;
  transition: all var(--navbar-transition-base);
  transform-origin: center;
  margin: 2px 0;
  display: block !important;
}

.navbar__mobile-toggle-line:nth-child(1) {
  margin-bottom: 4px;
}

.navbar__mobile-toggle-line:nth-child(3) {
  margin-top: 4px;
}

.navbar__mobile-toggle[aria-expanded="true"] .navbar__mobile-toggle-line:nth-child(1),
.navbar__mobile-checkbox:checked ~ .navbar__container .navbar__mobile-toggle .navbar__mobile-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.navbar__mobile-toggle[aria-expanded="true"] .navbar__mobile-toggle-line:nth-child(2),
.navbar__mobile-checkbox:checked ~ .navbar__container .navbar__mobile-toggle .navbar__mobile-toggle-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.navbar__mobile-toggle[aria-expanded="true"] .navbar__mobile-toggle-line:nth-child(3),
.navbar__mobile-checkbox:checked ~ .navbar__container .navbar__mobile-toggle .navbar__mobile-toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.navbar__mobile-toggle-label {
  font-size: 0.625rem;
  font-weight: var(--navbar-font-weight-medium);
  color: var(--navbar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  transition: all var(--navbar-transition-base);
  display: none !important; /* Hide the "Menu" text, show only hamburger lines */
}

.navbar__mobile-toggle[aria-expanded="true"] .navbar__mobile-toggle-label,
.navbar__mobile-checkbox:checked ~ .navbar__container .navbar__mobile-toggle .navbar__mobile-toggle-label {
  opacity: 0;
}

/* Full-Screen Mobile Menu */
.navbar__mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: 90vw;
  max-width: 380px;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100); /* Fallback for mobile browsers */
  background: rgba(255, 255, 255, 0.8) !important; /* 80% transparent for light mode - semi-transparent */
  z-index: 10002; /* Above overlay */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--navbar-transition-base);
  overscroll-behavior: contain;
  transform: translateX(100%);
  backdrop-filter: blur(12px) saturate(150%) !important; /* Enhanced backdrop filter for better transparency effect */
  -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  /* Ensure no solid background override */
  background-color: rgba(255, 255, 255, 0.8) !important;
}

/* Dark mode mobile menu background */
[data-theme="dark"] .navbar__mobile-menu,
.dark-mode .navbar__mobile-menu,
html.dark .navbar__mobile-menu {
  /* Modern semi-transparent dark grey with glassmorphism */
  background: rgba(31, 41, 55, 0.85) !important; /* Dark grey instead of blue */
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.navbar__mobile-menu.show,
.navbar__mobile-checkbox:checked ~ .navbar__mobile-menu {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.navbar__mobile-container {
  height: 100%;
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: transparent !important; /* Make container transparent - let menu background show through */
  backdrop-filter: none; /* Remove backdrop filter from container - menu handles it */
  -webkit-backdrop-filter: none;
  overflow: hidden; /* Prevent outer container from scrolling */
  -webkit-overflow-scrolling: touch;
  position: relative; /* Ensure stacking above overlay */
  z-index: 2;
  box-sizing: border-box;
}

/* Dark mode container - keep transparent */
[data-theme="dark"] .navbar__mobile-container,
.dark-mode .navbar__mobile-container,
html.dark .navbar__mobile-container {
  background: transparent !important; /* Keep transparent - menu background handles it */
}

/* REMOVED DUPLICATE - Text colors handled in specific element styles below */

/* Mobile menu link styles */
.navbar__mobile-link {
  color: #1f2937 !important; /* Dark text for light mode */
  text-decoration: none;
  padding: 16px 20px; /* Increased padding for better touch targets and prominence */
  display: flex;
  align-items: center;
  gap: 12px; /* Increased gap for better spacing */
  border-radius: 6px;
  margin: 2px 0;
  transition: all 0.3s ease;
  font-weight: 600; /* Increased from 500 for more prominence */
  border-left: 3px solid transparent;
  font-size: 1.5rem !important; /* 24px - even larger for maximum prominence */
  min-height: 56px; /* Increased for better readability with larger font */
  line-height: 1.5; /* Better line height for readability */
}

.navbar__mobile-link:hover {
  background: rgba(31, 41, 55, 0.1); /* Dark hover for light mode */
  border-left-color: #2563eb;
  transform: translateX(8px);
}

.navbar__mobile-link--active {
  background: rgba(37, 99, 235, 0.15); /* Lighter blue for light mode */
  border-left-color: #2563eb;
}

.navbar__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--navbar-spacing-lg);
  border-bottom: 1px solid var(--navbar-border-dark);
  margin-bottom: var(--navbar-spacing-xl);
  flex-shrink: 0; /* Prevent header from shrinking */
}

/* Ultra-black dark mode header border */
[data-theme="dark"] .navbar__mobile-header,
.dark-mode .navbar__mobile-header,
html.dark .navbar__mobile-header {
  border-bottom-color: #2a2a2a !important; /* Ultra-black border */
}

.navbar__mobile-logo {
  display: flex;
  align-items: center;
  gap: var(--navbar-spacing-sm);
  text-decoration: none;
  color: rgb(17, 24, 39); /* Dark text for light mode */
  font-weight: var(--navbar-font-weight-semibold);
}

/* Mobile logo wrapper */
.navbar__mobile-logo-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
}

.navbar__mobile-logo-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  transition: opacity var(--navbar-transition-base);
}

/* Light mode: Show black logo, hide white logo */
.navbar__mobile-logo-img--light {
  opacity: 1;
}

.navbar__mobile-logo-img--dark {
  opacity: 0;
}

/* Dark mode: Show white logo, hide black logo */
[data-theme="dark"] .navbar__mobile-logo-img--light,
.dark-mode .navbar__mobile-logo-img--light,
html.dark .navbar__mobile-logo-img--light {
  opacity: 0;
}

[data-theme="dark"] .navbar__mobile-logo-img--dark,
.dark-mode .navbar__mobile-logo-img--dark,
html.dark .navbar__mobile-logo-img--dark {
  opacity: 1;
}

.navbar__mobile-logo-text {
  color: inherit; /* Inherit from parent .navbar__mobile-logo */
}

/* Ultra-black dark mode logo colors */
[data-theme="dark"] .navbar__mobile-logo,
.dark-mode .navbar__mobile-logo,
html.dark .navbar__mobile-logo {
  color: #ffffff !important; /* Pure white text for ultra-black */
}

.navbar__mobile-close {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(31, 41, 55, 0.15); /* Dark border for light mode */
  background: rgba(31, 41, 55, 0.05); /* Light gray for light mode */
  border-radius: 12px;
  color: #1f2937 !important; /* Dark icon for light mode */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.navbar__mobile-close:hover {
  background: rgba(239, 68, 68, 0.15); /* Light red for light mode */
  border-color: rgba(239, 68, 68, 0.3);
  transform: scale(1.05) rotate(90deg);
  color: #dc2626 !important; /* Red icon for light mode */
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

/* Ultra-black dark mode close button */
[data-theme="dark"] .navbar__mobile-close,
.dark-mode .navbar__mobile-close,
html.dark .navbar__mobile-close {
  border: 2px solid #2a2a2a !important; /* Ultra-black border */
  background: #0a0a0a !important; /* Ultra-black background */
  color: #ffffff !important; /* Pure white */
}

[data-theme="dark"] .navbar__mobile-close:hover,
.dark-mode .navbar__mobile-close:hover,
html.dark .navbar__mobile-close:hover {
  background: rgba(239, 68, 68, 0.9) !important; /* Red background on hover */
  border-color: rgba(239, 68, 68, 0.6) !important; /* Red border */
  color: #ffffff !important; /* White text */
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4) !important; /* Red shadow */
}

.navbar__mobile-nav {
  flex: 1 1 auto; /* Allow flex growth for proper scrolling */
  min-height: 0; /* Critical for flex scrolling */
  overflow-y: auto; /* Make nav section scrollable */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  /* Ensure smooth scrolling */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.navbar__mobile-nav::-webkit-scrollbar {
  width: 4px;
}

.navbar__mobile-nav::-webkit-scrollbar-track {
  background: transparent;
}

.navbar__mobile-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

[data-theme="dark"] .navbar__mobile-nav::-webkit-scrollbar-thumb,
.dark-mode .navbar__mobile-nav::-webkit-scrollbar-thumb {
  background: #2a2a2a !important; /* Ultra-black scrollbar */
}

[data-theme="dark"] .navbar__mobile-nav::-webkit-scrollbar-thumb:hover,
.dark-mode .navbar__mobile-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5) !important; /* Gold accent on hover */
}

.navbar__mobile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--navbar-spacing-sm);
}

.navbar__mobile-actions {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: auto; /* Push to bottom */
  background: rgba(0, 0, 0, 0.02); /* Light gray for light mode */
  margin-left: -16px;
  margin-right: -16px;
  margin-bottom: 0;
  border-radius: 16px 16px 0 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: none;
  flex-shrink: 0; /* Prevent shrinking - keep at bottom */
  min-height: auto;
  position: relative;
  z-index: 1;
}

/* Ultra-black dark mode actions section */
[data-theme="dark"] .navbar__mobile-actions,
.dark-mode .navbar__mobile-actions,
html.dark .navbar__mobile-actions {
  border-top: 1px solid #2a2a2a !important; /* Ultra-black border */
  /* Ultra-black gradient */
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%) !important; /* Ultra-black gradient */
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid #2a2a2a !important; /* Ultra-black border */
  border-bottom: none !important;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(212, 175, 55, 0.05) !important; /* Enhanced shadow with gold accent */
}

.navbar__mobile-action-group {
  margin-bottom: 16px;
}

.navbar__mobile-action-group:last-child {
  margin-bottom: 0;
}

.navbar__mobile-section-title {
  color: rgba(31, 41, 55, 0.7); /* Dark grey text for light mode */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
  font-weight: var(--navbar-font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding-left: 8px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar__mobile-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(31, 41, 55, 0.2), transparent); /* Dark gradient for light mode */
}

/* Ultra-black dark mode section titles */
[data-theme="dark"] .navbar__mobile-section-title,
.dark-mode .navbar__mobile-section-title,
html.dark .navbar__mobile-section-title {
  color: #e0e0e0 !important; /* Light grey text for ultra-black */
}

[data-theme="dark"] .navbar__mobile-section-title::after,
.dark-mode .navbar__mobile-section-title::after,
html.dark .navbar__mobile-section-title::after {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.2), transparent) !important; /* Gold gradient for ultra-black */
}

/* Mobile Language Selector - Improved Compact Design */
.navbar__mobile-language {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 8px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ultra-black dark mode language container */
[data-theme="dark"] .navbar__mobile-language,
.dark-mode .navbar__mobile-language,
html.dark .navbar__mobile-language {
  background: #0a0a0a !important; /* Ultra-black */
  border: 1px solid #2a2a2a !important; /* Ultra-black border */
}

.navbar__mobile-language-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(31, 41, 55, 0.04); /* Light gray for light mode */
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 8px;
  color: rgba(31, 41, 55, 0.85); /* Dark text for light mode */
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  text-align: left;
  min-height: 38px;
}

.navbar__mobile-language-item:hover {
  background: rgba(31, 41, 55, 0.1); /* Dark hover for light mode */
  border-color: rgba(31, 41, 55, 0.18);
  color: white;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.navbar__mobile-language-item--active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.2)); /* Lighter blue for light mode */
  border-color: rgba(59, 130, 246, 0.3);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.navbar__mobile-language-flag {
  width: 16px;
  height: 11px;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.navbar__mobile-language-flag--en { background-image: url('/static/images/flags/en.svg'); }
.navbar__mobile-language-flag--it { background-image: url('/static/images/flags/it.svg'); }
.navbar__mobile-language-flag--fr { background-image: url('/static/images/flags/fr.svg'); }
.navbar__mobile-language-flag--es { background-image: url('/static/images/flags/es.svg'); }

.navbar__mobile-language-name {
  flex: 1;
  font-size: 0.8rem;
  line-height: 1.2;
}

.navbar__mobile-language-check {
  color: var(--navbar-primary);
  font-size: 0.7rem;
  opacity: 0.9;
}

/* Mobile Dark Mode Toggle - Enhanced Design (Compact) */
.navbar__mobile-theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px; /* Further reduced for more compact design */
  width: 100%;
  padding: 6px 10px; /* Further reduced for more compact design */
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px; /* Slightly reduced border radius */
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.7rem; /* Further reduced for more compact design */
  font-weight: var(--navbar-font-weight-medium);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  min-height: 32px; /* Further reduced for more compact design */
}

.navbar__mobile-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.navbar__mobile-theme-toggle:active {
  transform: translateY(0) scale(0.98);
  transition: transform 0.1s ease-out;
}

.navbar__mobile-theme-icon {
  width: 16px; /* Reduced for more compact design */
  height: 16px; /* Reduced for more compact design */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.navbar__mobile-theme-icon i {
  position: absolute;
  transition: all var(--navbar-transition-base);
}

.navbar__theme-icon--light {
  opacity: 1;
}

.navbar__theme-icon--dark {
  opacity: 0;
}

/* Dark mode active state */
[data-theme="dark"] .navbar__mobile-theme-toggle .navbar__theme-icon--light,
.dark-mode .navbar__mobile-theme-toggle .navbar__theme-icon--light {
  opacity: 0;
}

[data-theme="dark"] .navbar__mobile-theme-toggle .navbar__theme-icon--dark,
.dark-mode .navbar__mobile-theme-toggle .navbar__theme-icon--dark {
  opacity: 1;
}

.navbar__mobile-theme-text {
  flex: 1;
}

.navbar__mobile-theme-switch {
  width: 28px; /* Further reduced for more compact design */
  height: 16px; /* Further reduced for more compact design */
  background: rgba(31, 41, 55, 0.15); /* Dark gray for light mode */
  border-radius: 8px; /* Adjusted for new height */
  position: relative;
  transition: all var(--navbar-transition-base);
  border: 1px solid rgba(31, 41, 55, 0.1);
  flex-shrink: 0;
}

.navbar__mobile-theme-slider {
  width: 12px; /* Further reduced for more compact design */
  height: 12px; /* Further reduced for more compact design */
  background: #1f2937; /* Dark slider for light mode */
  border-radius: 50%;
  position: absolute;
  top: 2px; /* Adjusted for new dimensions */
  left: 2px; /* Adjusted for new dimensions */
  transition: all var(--navbar-transition-base);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Ultra-black dark mode styles for language items */
[data-theme="dark"] .navbar__mobile-language-item,
.dark-mode .navbar__mobile-language-item,
html.dark .navbar__mobile-language-item {
  background: #0a0a0a !important; /* Ultra-black */
  border: 1px solid #2a2a2a !important; /* Ultra-black border */
  color: #ffffff !important; /* Pure white */
}

[data-theme="dark"] .navbar__mobile-language-item:hover,
.dark-mode .navbar__mobile-language-item:hover,
html.dark .navbar__mobile-language-item:hover {
  background: #121212 !important; /* Slightly lighter on hover */
  border-color: rgba(212, 175, 55, 0.3) !important; /* Gold border on hover */
  color: #d4af37 !important; /* Gold text */
}

[data-theme="dark"] .navbar__mobile-language-item--active,
.dark-mode .navbar__mobile-language-item--active,
html.dark .navbar__mobile-language-item--active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(180, 146, 37, 0.25)) !important; /* Gold gradient */
  border-color: #d4af37 !important; /* Gold border */
  color: #ffffff !important; /* White text */
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2) !important; /* Gold shadow */
}

/* Ultra-black dark mode theme toggle */
[data-theme="dark"] .navbar__mobile-theme-toggle,
.dark-mode .navbar__mobile-theme-toggle,
html.dark .navbar__mobile-theme-toggle {
  background: #0a0a0a !important; /* Ultra-black */
  border: 1px solid #2a2a2a !important; /* Ultra-black border */
  color: #ffffff !important; /* Pure white */
}

[data-theme="dark"] .navbar__mobile-theme-toggle:hover,
.dark-mode .navbar__mobile-theme-toggle:hover,
html.dark .navbar__mobile-theme-toggle:hover {
  background: #121212 !important; /* Slightly lighter on hover */
  border-color: #d4af37 !important; /* Gold border */
  color: #d4af37 !important; /* Gold text */
  box-shadow: 0 3px 12px rgba(212, 175, 55, 0.2) !important; /* Gold shadow */
}

/* Ultra-black dark mode slider position and colors */
[data-theme="dark"] .navbar__mobile-theme-switch,
.dark-mode .navbar__mobile-theme-switch,
html.dark .navbar__mobile-theme-switch {
  background: rgba(212, 175, 55, 0.3) !important; /* Gold background */
  border: 1px solid rgba(212, 175, 55, 0.4) !important; /* Gold border */
}

[data-theme="dark"] .navbar__mobile-theme-slider,
.dark-mode .navbar__mobile-theme-slider,
html.dark .navbar__mobile-theme-slider {
  transform: translateX(12px) !important; /* Adjusted for new switch width (28px - 12px - 2px*2 = 12px) */
  background: #d4af37 !important; /* Gold slider */
  box-shadow: 0 1px 3px rgba(212, 175, 55, 0.5) !important; /* Gold shadow */
}

.navbar__mobile-auth {
  display: flex;
  flex-direction: column;
  gap: var(--navbar-spacing-sm);
}

.navbar__mobile-auth-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: rgb(31, 41, 55) !important; /* Dark text for light mode - ensure visibility */
  text-decoration: none;
  border: 2px solid rgba(31, 41, 55, 0.15); /* Dark border for light mode */
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(31, 41, 55, 0.04) !important; /* Light background with dark tint for light mode */
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.navbar__mobile-auth-link i {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
  color: inherit; /* Inherit text color */
}

.navbar__mobile-auth-link:hover {
  background: rgba(31, 41, 55, 0.1) !important; /* Darker hover for light mode */
  color: rgb(17, 24, 39) !important; /* Darker text on hover */
  border-color: rgba(31, 41, 55, 0.25);
}

/* Ultra-black dark mode auth link */
[data-theme="dark"] .navbar__mobile-auth-link,
.dark-mode .navbar__mobile-auth-link,
html.dark .navbar__mobile-auth-link {
  color: #ffffff !important; /* Pure white text */
  border: 2px solid #2a2a2a !important; /* Ultra-black border */
  background: #0a0a0a !important; /* Ultra-black background */
}

[data-theme="dark"] .navbar__mobile-auth-link:hover,
.dark-mode .navbar__mobile-auth-link:hover,
html.dark .navbar__mobile-auth-link:hover {
  background: #121212 !important; /* Slightly lighter on hover */
  color: #d4af37 !important; /* Gold text */
  border-color: #d4af37 !important; /* Gold border */
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2) !important; /* Gold shadow */
}

.navbar__mobile-auth-button {
  display: flex;
  align-items: center;
  gap: var(--navbar-spacing-sm);
  padding: var(--navbar-spacing-sm) var(--navbar-spacing-md);
  background: var(--navbar-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--navbar-border-radius);
  font-weight: var(--navbar-font-weight-semibold);
  font-size: 0.875rem;
  transition: all var(--navbar-transition-base);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  border: none;
}

.navbar__mobile-auth-button i {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
}

.navbar__mobile-auth-button:hover {
  background: var(--navbar-primary-hover);
  transform: translateY(-2px);
}

/* Enhanced Auth Button Variants */
.navbar__mobile-auth-button--danger {
  background: var(--navbar-danger);
  border-color: var(--navbar-danger);
  color: white;
}

.navbar__mobile-auth-button--danger:hover {
  background: rgb(220, 38, 38);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Enhanced Mobile Nav Links for Auth Items */
.navbar__mobile-link--auth {
  background: rgba(31, 41, 55, 0.06) !important; /* Dark tint for light mode */
  border-left-color: rgba(59, 130, 246, 0.5) !important;
}

.navbar__mobile-link--auth-primary {
  /* Modern gold gradient for primary auth buttons */
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(180, 146, 37, 0.2)) !important;
  border-left-color: #d4af37 !important;
  color: #b49225 !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

.navbar__mobile-link--danger {
  background: rgba(239, 68, 68, 0.1) !important;
  border-left-color: var(--navbar-danger) !important;
  color: var(--navbar-danger) !important;
}

.navbar__mobile-link--danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-left-color: var(--navbar-danger) !important;
}

/* Dark mode mobile link styles */
[data-theme="dark"] .navbar__mobile-link,
.dark-mode .navbar__mobile-link,
html.dark .navbar__mobile-link {
  color: white !important;
}

[data-theme="dark"] .navbar__mobile-link:hover,
.dark-mode .navbar__mobile-link:hover,
html.dark .navbar__mobile-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .navbar__mobile-link--active,
.dark-mode .navbar__mobile-link--active,
html.dark .navbar__mobile-link--active {
  /* Modern gold accent for active links */
  background: rgba(212, 175, 55, 0.2);
  border-left-color: var(--accent-color, #d4af37);
}

[data-theme="dark"] .navbar__mobile-link--auth,
.dark-mode .navbar__mobile-link--auth,
html.dark .navbar__mobile-link--auth {
  background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .navbar__mobile-link--auth-primary,
.dark-mode .navbar__mobile-link--auth-primary,
html.dark .navbar__mobile-link--auth-primary {
  /* Modern gold gradient for dark mode */
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(180, 146, 37, 0.25)) !important;
  border-left-color: var(--accent-color, #d4af37) !important;
  color: var(--accent-color, #d4af37) !important;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.2);
  font-weight: 600;
}

/* Auth Section Visual Separators */
.navbar__mobile-item--auth {
  border-top: 1px solid rgba(31, 41, 55, 0.1); /* Dark border for light mode */
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

/* Ultra-black dark mode auth separator */
[data-theme="dark"] .navbar__mobile-item--auth,
.dark-mode .navbar__mobile-item--auth,
html.dark .navbar__mobile-item--auth {
  border-top: 1px solid #2a2a2a !important; /* Ultra-black border */
}

.navbar__mobile-item--auth:first-of-type {
  border-top-width: 2px;
  margin-top: 1rem;
}

[data-theme="light"] .navbar__mobile-item--auth,
:root:not([data-theme="dark"]) .navbar__mobile-item--auth {
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* User Section Styling */
.navbar__mobile-item--user {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.navbar__mobile-item--user:first-of-type {
  border-top-width: 2px;
  margin-top: 1rem;
}

[data-theme="light"] .navbar__mobile-item--user,
:root:not([data-theme="dark"]) .navbar__mobile-item--user {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.navbar__mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10001; /* Below the menu panel */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--navbar-transition-base), visibility var(--navbar-transition-base);
}

/* Ultra-black dark mode overlay */
[data-theme="dark"] .navbar__mobile-overlay,
.dark-mode .navbar__mobile-overlay,
html.dark .navbar__mobile-overlay {
  background: rgba(0, 0, 0, 0.95) !important; /* Ultra-black backdrop */
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.navbar__mobile-overlay.show,
.navbar__mobile-checkbox:checked ~ .navbar__mobile-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile menu item animations */
.navbar__mobile-item {
  opacity: 0;
  transform: translateX(-30px);
  animation: slideInLeft 0.3s ease-out forwards;
  animation-delay: var(--animation-delay, 0s);
}


/* Keyframe animations */
@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
