/* ============================================
   MODERN NAVIGATION WITH GLASSMORPHISM
   ============================================ */

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(12px)) {
  .lr-navbar {
    background: rgba(255, 255, 255, 0.95);
  }
  
  .lr-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
  }
}

/* Navbar Container */
.lr-header-modern {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.lr-navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(40, 167, 69, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  height: 90px;  /* Increased from 76px to fit 80px logo */
  display: flex;
  align-items: center;
}

.lr-navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 16px;
  height: 100%;
}

/* Logo/Brand */
.lr-navbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.lr-navbar-logo {
  height: 140px;  /* Increased from 56px - approximately 4x from original 40px */
  width: auto;
  max-height: 140px;  /* Ensure it doesn't exceed navbar */
}

/* Navigation Items Container */
.lr-navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin-left: 32px;
}

/* Individual Nav Items (Links and Dropdown Toggles) */
.lr-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.lr-nav-item i {
  font-size: 16px;
}

/* Hover State */
.lr-nav-item:hover {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  transform: translateY(-1px);
}

/* Active State (Current Page) */
.lr-nav-item.active {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.lr-nav-item.active:hover {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

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

/* Dropdown Toggle (inherits nav-item styles) */
.lr-dropdown-toggle {
  /* Inherits from .lr-nav-item */
}

.lr-dropdown-icon {
  font-size: 12px;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.lr-nav-dropdown.open .lr-dropdown-icon {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.lr-navbar .lr-dropdown-menu {
  display: block !important;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;  /* Slightly wider for better readability */
  background: rgba(255, 255, 255, 0.98);  /* Increased from 0.95 to 0.98 - more opaque */
  backdrop-filter: blur(16px);  /* Increased blur from 12px to 16px */
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);  /* Added subtle border for definition */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);  /* Increased shadow for depth */
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.lr-navbar .lr-nav-dropdown.open .lr-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Items */
.lr-navbar .lr-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 15px;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lr-navbar .lr-dropdown-item i {
  font-size: 16px;
  color: #6b7280;
}

.lr-navbar .lr-dropdown-item:hover {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.lr-navbar .lr-dropdown-item:hover i {
  color: #28a745;
}

/* ============================================
   HIGHLIGHTED DROPDOWN MENU ITEMS
   ============================================ */

/* Calculate OBR - Red Theme */
.lr-navbar .lr-dropdown-item.highlight-calculate {
  background-color: #dc3545 !important;  /* Bootstrap danger red */
  color: white !important;
  border: 1px solid #c82333 !important;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 4px 8px;
}

.lr-navbar .lr-dropdown-item.highlight-calculate:hover,
.lr-navbar .lr-dropdown-item.highlight-calculate:focus {
  background-color: #c82333 !important;
  border-color: #bd2130 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.lr-navbar .lr-dropdown-item.highlight-calculate:active {
  background-color: #bd2130 !important;
  transform: translateY(0);
}

.lr-navbar .lr-dropdown-item.highlight-calculate i {
  color: white !important;
  opacity: 0.95;
}

.lr-navbar .lr-dropdown-item.highlight-calculate:hover i {
  opacity: 1;
}

/* Dashboard - Blue Theme (ACCESSIBLE COLOR) */
.lr-navbar .lr-dropdown-item.highlight-dashboard {
  background-color: #0c7a8e !important;  /* Darker blue - WCAG AA compliant */
  color: white !important;
  border: 1px solid #095f6f !important;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 4px 8px;
}

.lr-navbar .lr-dropdown-item.highlight-dashboard:hover,
.lr-navbar .lr-dropdown-item.highlight-dashboard:focus {
  background-color: #095f6f !important;
  border-color: #074c5a !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(12, 122, 142, 0.2);
}

.lr-navbar .lr-dropdown-item.highlight-dashboard:active {
  background-color: #074c5a !important;
  transform: translateY(0);
}

.lr-navbar .lr-dropdown-item.highlight-dashboard i {
  color: white !important;
  opacity: 0.95;
}

.lr-navbar .lr-dropdown-item.highlight-dashboard:hover i {
  opacity: 1;
}

/* Focus Outline for Keyboard Navigation */
.lr-navbar .lr-dropdown-item.highlight-calculate:focus,
.lr-navbar .lr-dropdown-item.highlight-dashboard:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Dropdown Header (for user menu) */
.lr-dropdown-header {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 8px;
}

.lr-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lr-user-name {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.lr-user-email {
  font-size: 12px;
  color: #6b7280;
}

/* Dropdown Divider */
.lr-dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 8px 0;
}

/* Dropdown Right Aligned (for user menu) */
.lr-navbar .lr-dropdown-menu-right {
  left: auto;
  right: 0;
}

/* Danger Item (Logout) */
.lr-navbar .lr-dropdown-item-danger:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.lr-navbar .lr-dropdown-item-danger:hover i {
  color: #dc3545;
}

/* Right Side Container */
.lr-navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Credits Badge */
.lr-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 20px;
  border: 2px solid #28a745;
  background: rgba(40, 167, 69, 0.05);
  color: #28a745;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.lr-credits-badge i {
  font-size: 16px;
}

/* User Avatar */
.lr-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.lr-user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.lr-avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Login Button (for logged out users) */
.lr-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.lr-btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
  color: white;
}

.lr-btn-login i {
  font-size: 16px;
}

/* Register Button (for logged out users) */
.lr-btn-register {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 20px;
  background: #f87171;
  color: white;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

.lr-btn-register:hover {
  background: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(248, 113, 113, 0.4);
  color: white;
}

.lr-btn-register i {
  font-size: 16px;
}

/* Mobile Toggle Button */
.lr-navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #374151;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lr-navbar-toggle:hover {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

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

@media (max-width: 992px) {
  /* Show mobile toggle */
  .lr-navbar-toggle {
    display: flex;
  }

  /* Hide nav items by default on mobile */
  .lr-navbar-nav {
    position: fixed;
    top: 160px;  /* Default for logged out state with buttons below logo */
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-left: 0;
  }

  /* Show nav when mobile menu is open */
  .lr-navbar-nav.open {
    max-height: calc(100vh - 160px);  /* Default for logged out state */
    opacity: 1;
    overflow-y: auto;
  }

  /* Full width nav items on mobile */
  .lr-nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
  }

  /* Dropdown menus overlay content on mobile */
  .lr-dropdown-menu {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    background: white;
    border: none;
    border-top: 1px solid #e5e7eb;
    border-radius: 0;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 1050;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }

  .lr-nav-dropdown.open .lr-dropdown-menu {
    max-height: 80vh;       /* Use viewport height (was 400px) */
    overflow-y: auto;
  }

  .lr-dropdown-item {
    padding: 16px 20px;
    min-height: 48px;       /* Accessible touch target */
  }

  /* Right side stacks below on mobile */
  .lr-navbar-right {
    position: absolute;
    top: 105px;             /* Move below logo - changed from 60px to prevent overlap */
    right: 16px;
    left: 16px;             /* Full width */
    gap: 8px;
    justify-content: center; /* Center buttons */
    display: flex;
    flex-direction: row;
  }
  
  /* When logged in (avatar + credits) - position beside logo instead of below */
  .lr-navbar-right:has(.lr-user-avatar) {
    position: absolute;
    top: 50%;               /* Center vertically in navbar */
    right: 60px;            /* To left of hamburger menu */
    left: auto;             /* Remove full width */
    transform: translateY(-50%);
    justify-content: flex-end;
  }

  .lr-credits-badge {
    font-size: 11px;
    padding: 4px 10px;
    display: none;          /* Hide on mobile to save space */
  }
  
  .lr-user-avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  /* Mobile responsive buttons */
  .lr-btn-login,
  .lr-btn-register {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;                /* Equal width */
    justify-content: center; /* Center text */
    max-width: 150px;       /* Don't get too wide */
  }
}

@media (max-width: 768px) {
  /* Taller navbar for larger logo */
  .lr-navbar {
    min-height: 100px;      /* Base height for logo */
  }
  
  /* Additional height for login/register buttons when present (not logged in) */
  .lr-navbar:has(.lr-btn-login) {
    height: 160px;          /* 100px logo area + 60px buttons area */
  }
  
  /* Standard height when logged in (no buttons below) */
  .lr-navbar:has(.lr-user-avatar) {
    height: 100px;
  }
  
  /* Larger logo (match footer size) */
  .lr-navbar-logo {
    max-height: 80px;       /* Was 50px */
  }
  
  /* Adjust nav positioning - default for logged out state */
  .lr-navbar-nav {
    top: 160px;             /* When not logged in (buttons visible) */
  }
  
  /* Adjust nav positioning when logged in */
  body:has(.lr-user-avatar) .lr-navbar-nav {
    top: 100px;             /* When logged in (no buttons below logo) */
  }
  
  .lr-navbar-nav.open {
    max-height: calc(100vh - 160px);  /* Default for logged out */
  }
  
  /* Adjust max-height when logged in */
  body:has(.lr-user-avatar) .lr-navbar-nav.open {
    max-height: calc(100vh - 100px);
  }
  
  /* Center hamburger menu vertically */
  .lr-navbar-toggle {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
  }
}

@media (max-width: 576px) {
  .lr-navbar-logo {
    height: 140px;  /* Match footer logo size */
    max-height: 140px;
  }

  /* Avatar sizing for very small screens */
  .lr-user-avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
  
  /* Credits badge already hidden at 992px breakpoint */
}


