/* ============================================
   ENTERPRISE NAVBAR - MODERN & PROFESSIONAL
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
  background: rgba(30, 41, 59, 0.95);
  border-bottom-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Logo Section */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.logo:hover {
  transform: scale(1.03);
}

.logo:active {
  transform: scale(0.98);
}

.logo-image {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover .logo-image {
  transform: rotate(-5deg);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-brand img {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
}

/* Navigation Menu - Centered */
.nav-menu-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.main-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .main-menu {
  background: transparent;
  border: none;
  box-shadow: none;
}

.main-menu > li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

[data-theme="dark"] .main-menu > li {
  color: #cbd5e1;
}

/* Animated underline effect */
.main-menu > li::after {
  display: none;
}

.main-menu > li:hover::after {
  display: none;
}

/* Glow effect on hover */
.main-menu > li::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.main-menu > li:hover::before {
  opacity: 1;
}

.main-menu > li:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .main-menu > li:hover {
  background: rgba(71, 85, 105, 0.8);
  color: #a5b4fc;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.2);
}

.main-menu > li:active {
  transform: translateY(0);
}

.main-menu > li i {
  font-size: 1rem;
  opacity: 0.8;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.main-menu > li:hover i {
  opacity: 1;
  transform: scale(1.1) rotate(-5deg);
}

.main-menu > li span {
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Dropdown Menu */
.more-dropdown {
  position: relative;
}

.more-dropdown.is-empty {
  display: none !important;
}

/* Keep hover alive while moving cursor from trigger to dropdown */
.more-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.more-dropdown > i:last-child {
  margin-left: 0.25rem;
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.more-dropdown:hover > i:last-child {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 220px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 0.5rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

[data-theme="dark"] .dropdown-menu {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(51, 65, 85, 0.8);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

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

.more-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.more-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  color: #475569;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .dropdown-menu li {
  color: #cbd5e1;
}

/* Slide-in animation for dropdown items */
.dropdown-menu li {
  animation: slideInDropdown 0.3s ease forwards;
  opacity: 0;
}

.dropdown-menu li:nth-child(1) { animation-delay: 0.05s; }
.dropdown-menu li:nth-child(2) { animation-delay: 0.1s; }
.dropdown-menu li:nth-child(3) { animation-delay: 0.15s; }
.dropdown-menu li:nth-child(4) { animation-delay: 0.2s; }
.dropdown-menu li:nth-child(5) { animation-delay: 0.25s; }
.dropdown-menu li:nth-child(6) { animation-delay: 0.3s; }
.dropdown-menu li:nth-child(7) { animation-delay: 0.35s; }

@keyframes slideInDropdown {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dropdown-menu li::before {
  display: none;
}

.dropdown-menu li:hover::before {
  display: none;
}

.dropdown-menu li:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: #667eea;
  padding-left: 1rem;
}

.dropdown-menu li.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: #667eea;
  padding-left: 1rem;
  border: 1px solid rgba(129, 140, 248, 0.45);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.18) inset;
}

[data-theme="dark"] .dropdown-menu li:hover {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(165, 180, 252, 0.2) 100%);
  color: #a5b4fc;
}

[data-theme="dark"] .dropdown-menu li.active {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(165, 180, 252, 0.2) 100%);
  color: #a5b4fc;
  border: 1px solid rgba(165, 180, 252, 0.45);
  box-shadow: 0 0 0 1px rgba(165, 180, 252, 0.2) inset;
}

.dropdown-menu li.active::before {
  display: none;
}

.dropdown-menu li i {
  font-size: 0.875rem;
  opacity: 0.7;
  width: 16px;
  transition: all 0.3s ease;
}

.dropdown-menu li:hover i {
  opacity: 1;
  transform: scale(1.15);
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Theme Toggle Button - Professional Design */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(248, 250, 252, 0.8);
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.fullscreen-toggle-btn { position:relative; display:flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; color:#5b6fe8; background:linear-gradient(145deg,#fff 0%,#eef2ff 100%); border:1px solid rgba(129,140,248,.45); border-radius:12px; cursor:pointer; transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease,color .18s ease; box-shadow:0 4px 12px rgba(67,56,202,.12); }
.fullscreen-toggle-btn:hover,.fullscreen-toggle-btn:focus-visible { color:#4338ca; border-color:#818cf8; background:linear-gradient(145deg,#fff 0%,#e0e7ff 100%); box-shadow:0 7px 18px rgba(79,70,229,.24); transform:translateY(-1px); }
.fullscreen-toggle-btn:active { transform:translateY(1px) scale(.97); }
.fullscreen-toggle-btn:focus-visible { outline:3px solid rgba(129,140,248,.35); outline-offset:3px; }
.fullscreen-toggle-btn:disabled { cursor:not-allowed; opacity:.5; filter:grayscale(.5); box-shadow:none; }
.fullscreen-toggle-btn.is-restore-pending { color:#0f74d6; border-color:#38a5ff; box-shadow:0 0 0 3px rgba(56,165,255,.16),0 7px 18px rgba(15,116,214,.2); }
.fullscreen-toggle-btn.is-restore-pending::after { content:""; position:absolute; top:5px; right:5px; width:6px; height:6px; border-radius:50%; background:#38a5ff; box-shadow:0 0 0 3px rgba(56,165,255,.15); }
.fullscreen-toggle-btn i { font-size:1.05rem; pointer-events:none; }
[data-theme="dark"] .fullscreen-toggle-btn { color:#c4b5fd; background:linear-gradient(145deg,#293653 0%,#1e293b 100%); border-color:rgba(129,140,248,.5); box-shadow:0 4px 14px rgba(15,23,42,.35); }
[data-theme="dark"] .fullscreen-toggle-btn:hover,[data-theme="dark"] .fullscreen-toggle-btn:focus-visible { color:#e0e7ff; background:linear-gradient(145deg,#35416b 0%,#273454 100%); border-color:#a5b4fc; }

[data-theme="dark"] .theme-toggle-btn {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(71, 85, 105, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle-btn:hover::before {
  opacity: 1;
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-toggle-btn i {
  font-size: 1.125rem;
  position: absolute;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.theme-icon-dark {
  color: #667eea;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon-light {
  color: #f59e0b;
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-icon-dark {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

[data-theme="dark"] .theme-icon-light {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Glow effect on hover */
.theme-toggle-btn:hover .theme-icon-dark {
  filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6));
}

[data-theme="dark"] .theme-toggle-btn:hover .theme-icon-light {
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.logout-btn i {
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .navbar {
    padding: 0 1.5rem;
  }
  
  .main-menu > li span {
    display: none;
  }
  
  .main-menu > li {
    padding: 0.625rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 60px;
    padding: 0 1rem;
  }
  
  .logo {
    margin-right: 1rem;
  }
  
  .logo-text {
    display: none;
  }
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar {
  animation: slideDown 0.4s ease;
}


/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .nav-menu-wrapper {
    position: static;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-menu-wrapper::-webkit-scrollbar {
    display: none;
  }
  
  .main-menu {
    gap: 0.125rem;
    flex-wrap: nowrap;
    width: max-content;
    min-width: max-content;
  }
  
  .main-menu > li {
    padding: 0.625rem 0.75rem;
  }
}

@media (max-width: 1024px) {
  .navbar {
    padding: 0 1.5rem;
  }
  
  .main-menu > li span {
    display: none;
  }
  
  .main-menu > li {
    padding: 0.625rem;
  }
  
  .main-menu > li i {
    margin: 0;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 60px;
    padding: 0 0.5rem;
    gap: 0.35rem;
    overflow: visible;
  }
  
  .logo {
    gap: 0.5rem;
    margin-right: 0.25rem;
  }
  
  .logo-text {
    display: none;
  }
  
  .logo-image {
    width: 36px;
    height: 36px;
  }
  
  .nav-menu-wrapper {
    position: static;
    transform: none !important;
    display: block;
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  }

  .nav-menu-wrapper::-webkit-scrollbar {
    display: none;
  }

  .main-menu {
    display: inline-flex;
    width: max-content;
    min-width: max-content;
    flex-wrap: nowrap;
    padding: 0.2rem;
    gap: 0.1rem;
  }
  
  .main-menu > li {
    flex: 0 0 auto;
    padding: 0.48rem;
    scroll-snap-align: start;
  }
  
  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }
  
  .logout-btn span {
    display: none;
  }
  
  .logout-btn {
    padding: 0.5rem;
    min-width: 36px;
    justify-content: center;
  }

  .user-menu {
    gap: 0.35rem;
    margin-left: 0.2rem;
    flex-shrink: 0;
  }
}

.dropdown-menu li.dynamic-overflow-item {
  animation: none;
  opacity: 1;
}

/* Pulse animation for active menu item */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
  }
}

.main-menu > li.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  color: #667eea;
  animation: pulse 2s infinite;
}

[data-theme="dark"] .main-menu > li.active {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(165, 180, 252, 0.2) 100%);
  color: #a5b4fc;
}
