/* ═══════════════════════════════════════════════════════════════════
   EXTRAORDINARY NAVBAR ANIMATIONS
   CyberShield Enterprise - Premium UI/UX
   ═══════════════════════════════════════════════════════════════════ */

/* Enhanced Header with Advanced Animations */
.header {
  padding: 1rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(30, 41, 59, 0.9) 50%,
    rgba(15, 23, 42, 0.95) 100%
  );
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(
    90deg,
    transparent,
    rgba(37, 99, 235, 0.6),
    rgba(59, 130, 246, 0.6),
    transparent
  ) 1;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 
    0 4px 30px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: headerSlideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Animated gradient border on scroll */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(29, 78, 216, 0.8),
    rgba(37, 99, 235, 0.8),
    rgba(59, 130, 246, 0.8),
    transparent
  );
  animation: borderGlow 3s linear infinite;
}

/* Floating particles in header */
.header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
  animation: headerPulse 4s ease-in-out infinite;
}

@keyframes headerSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes borderGlow {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

@keyframes headerPulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.header:hover {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 1) 0%,
    rgba(30, 41, 59, 0.95) 50%,
    rgba(15, 23, 42, 1) 100%
  );
  box-shadow: 
    0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(37, 99, 235, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════════════════
   LOGO ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: logoFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.6));
}

.logo-icon {
  width: 45px;
  height: 45px;
  background: linear-gradient(
    135deg,
    #1e40af 0%,
    #2563eb 50%,
    #3b82f6 100%
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 15px rgba(37, 99, 235, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: logoIconRotate 20s linear infinite;
}

/* Animated shine effect on logo */
.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  animation: logoShine 3s ease-in-out infinite;
}

/* Rotating border effect */
.logo-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    45deg,
    #1e40af,
    #2563eb,
    #3b82f6,
    #1e40af
  );
  border-radius: 12px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: logoRotate 3s linear infinite;
}

.logo:hover .logo-icon::after {
  opacity: 1;
}

@keyframes logoShine {
  0%, 100% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  50% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

@keyframes logoRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes logoIconRotate {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
}

.logo-icon i {
  position: relative;
  z-index: 1;
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(5deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   NAVIGATION MENU ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

.nav-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  position: relative;
}

.nav-item {
  position: relative;
  animation: navItemFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.15s; }
.nav-item:nth-child(3) { animation-delay: 0.2s; }
.nav-item:nth-child(4) { animation-delay: 0.25s; }
.nav-item:nth-child(5) { animation-delay: 0.3s; }
.nav-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes navItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-item a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  display: block;
  overflow: hidden;
  background: transparent;
  border: 1px solid transparent;
}

/* Animated gradient background on hover */
.nav-item a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.15) 0%,
    rgba(37, 99, 235, 0.15) 50%,
    rgba(59, 130, 246, 0.15) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 12px;
}

/* Animated underline */
.nav-item a::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #1e40af,
    #2563eb,
    #3b82f6,
    transparent
  );
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

/* Hover effects */
.nav-item a:hover {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-3px);
  box-shadow: 
    0 8px 20px rgba(37, 99, 235, 0.4),
    0 0 30px rgba(37, 99, 235, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item a:hover::before {
  opacity: 1;
  animation: gradientShift 2s ease infinite;
}

.nav-item a:hover::after {
  transform: translateX(-50%) scaleX(1);
  animation: underlineGlow 1.5s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes underlineGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
  }
  50% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.9);
  }
}

/* Active state */
.nav-item a.active,
.nav-item.active a {
  color: #ffffff;
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.25) 0%,
    rgba(37, 99, 235, 0.25) 100%
  );
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 
    0 4px 15px rgba(37, 99, 235, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item a.active::after,
.nav-item.active a::after {
  transform: translateX(-50%) scaleX(1);
}

/* Ripple effect on click */
.nav-item a:active {
  transform: translateY(-1px) scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════
   STATUS INDICATORS ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */

.status-indicators {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: nowrap;
  animation: statusFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

/* Ensure text is visible and properly sized */
.status-indicator span,
.system-online-status span,
.last-updated-status span {
  font-size: 0.875rem;
  line-height: 1.2;
  color: #e2e8f0;
  font-weight: 600;
  white-space: nowrap;
}

.status-indicator i,
.system-online-status i,
.last-updated-status i {
  font-size: 0.875rem;
  flex-shrink: 0;
}

@keyframes statusFadeIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.status-indicator,
.system-online-status,
.last-updated-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px;
  height: 44px;
  white-space: nowrap;
  line-height: 1.2;
  position: relative;
  overflow: hidden;
}

/* Animated background gradient */
.status-indicator::before,
.system-online-status::before,
.last-updated-status::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.15) 0%,
    rgba(37, 99, 235, 0.15) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.status-indicator:hover,
.system-online-status:hover,
.last-updated-status:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.5);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 8px 20px rgba(37, 99, 235, 0.4),
    0 0 30px rgba(37, 99, 235, 0.3);
}

.status-indicator:hover::before,
.system-online-status:hover::before,
.last-updated-status:hover::before {
  opacity: 1;
}

/* System Online Status - Green Theme */
.system-online-status {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.system-online-status::before {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(52, 211, 153, 0.1) 100%
  );
}

.system-online-status:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 
    0 8px 20px rgba(16, 185, 129, 0.3),
    0 0 30px rgba(16, 185, 129, 0.2);
}

/* Last Updated Status - Dark Blue Theme */
.last-updated-status {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

.last-updated-status:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.5);
}

/* Status Dots with Pulse Animation */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  animation: statusRipple 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes statusRipple {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.status-dot.online {
  background: #10b981;
  box-shadow: 
    0 0 10px rgba(16, 185, 129, 0.5),
    0 0 20px rgba(16, 185, 129, 0.3);
}

.status-dot.warning {
  background: #f59e0b;
  box-shadow: 
    0 0 10px rgba(245, 158, 11, 0.5),
    0 0 20px rgba(245, 158, 11, 0.3);
}

.status-dot.critical {
  background: #ef4444;
  box-shadow: 
    0 0 10px rgba(239, 68, 68, 0.5),
    0 0 20px rgba(239, 68, 68, 0.3);
  animation: criticalPulse 1s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 0 10px rgba(239, 68, 68, 0.5),
      0 0 20px rgba(239, 68, 68, 0.3);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 
      0 0 20px rgba(239, 68, 68, 0.8),
      0 0 40px rgba(239, 68, 68, 0.5);
  }
}

/* Icon animations in status indicators */
.last-updated-status i {
  animation: clockRotate 4s linear infinite;
}

@keyframes clockRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .nav-menu {
    gap: 0.25rem;
  }
  
  .nav-item a {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
  
  .status-indicators {
    gap: 0.5rem;
  }
  
  .status-indicator,
  .system-online-status,
  .last-updated-status {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
    min-height: 40px;
    height: 40px;
  }
  
  .status-indicator span,
  .system-online-status span,
  .last-updated-status span {
    font-size: 0.8rem;
  }
}

@media (max-width: 992px) {
  .header {
    padding: 1rem 1.5rem;
  }
  
  .nav-menu {
    gap: 0.25rem;
  }
  
  .nav-item a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .status-indicator,
  .system-online-status,
  .last-updated-status {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    min-height: 38px;
    height: 38px;
  }
  
  .status-indicator span,
  .system-online-status span,
  .last-updated-status span {
    font-size: 0.75rem;
  }
  
  .status-dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .status-indicators {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE MENU TOGGLE (Optional Enhancement)
   ═══════════════════════════════════════════════════════════════════ */

.mobile-menu-toggle {
  display: none;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}

.mobile-menu-toggle i {
  font-size: 1.5rem;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SCROLL EFFECTS
   ═══════════════════════════════════════════════════════════════════ */

.header.scrolled {
  padding: 0.75rem 2rem;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 
    0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(37, 99, 235, 0.2);
}

.header.scrolled .logo-icon {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.header.scrolled .logo {
  font-size: 1.3rem;
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════ */

.nav-item a:focus,
.status-indicator:focus,
.system-online-status:focus,
.last-updated-status:focus {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
