/**
 * Navigation Enhancements for ISCASTLE
 * Active state highlighting and smooth transitions
 */

/* ===== NAVIGATION ACTIVE STATES ===== */
.navbar-nav .nav-item {
  position: relative;
  margin: 0 2px;
}

.navbar-nav .nav-link {
  transition: all 0.3s ease;
  position: relative;
  padding: 8px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #333 !important;
  font-weight: 500;
}

/* Active navigation item styling */
.navbar-nav .nav-item.active .nav-link {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white !important;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  transform: translateY(-2px);
}

.navbar-nav .nav-item.active .nav-link::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-radius: 8px;
  z-index: -1;
  opacity: 0.2;
}

/* Active state indicator arrow */
.navbar-nav .nav-item.active .nav-link::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #007bff;
  animation: fadeInUp 0.3s ease;
}

/* Hover effects for non-active items */
.navbar-nav .nav-link:hover:not(.active) {
  color: #007bff !important;
  background: rgba(0, 123, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

/* Icon animations */
.navbar-nav .nav-link i {
  transition: all 0.3s ease;
  font-size: 16px;
}

.navbar-nav .nav-link:hover i {
  transform: scale(1.1) rotate(5deg);
}

.navbar-nav .nav-item.active .nav-link i {
  transform: scale(1.1);
  animation: pulse 2s infinite;
}

/* ===== MOBILE NAVIGATION ===== */
@media (max-width: 991.98px) {
  .navbar-nav .nav-item {
    margin: 2px 0;
  }
  
  .navbar-nav .nav-link {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 0;
  }
  
  .navbar-nav .nav-item.active .nav-link::after {
    display: none; /* Hide arrow on mobile */
  }
  
  .navbar-nav .nav-item.active .nav-link {
    background: linear-gradient(135deg, #007bff, #0056b3);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  }
}

/* ===== NAVIGATION ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1.1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== LOADING STATES ===== */
.navbar-nav .nav-link.loading {
  opacity: 0.7;
  pointer-events: none;
}

.navbar-nav .nav-link.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== FOCUS STATES ===== */
.navbar-nav .nav-link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.navbar-nav .nav-item.active .nav-link:focus {
  outline-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ===== NAVBAR BRAND HIGHLIGHTING ===== */
.navbar-brand {
  transition: all 0.3s ease;
  position: relative;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-brand:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== NAVBAR TOGGLE ===== */
.navbar-toggler {
  border: none;
  padding: 4px 8px;
  transition: all 0.3s ease;
}

.navbar-toggler:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.navbar-toggler:hover {
  background: rgba(0, 123, 255, 0.1);
}

/* ===== DROPDOWN MENUS (if any) ===== */
.navbar-nav .dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin-top: 8px;
  animation: slideIn 0.3s ease;
}

.navbar-nav .dropdown-item {
  padding: 10px 20px;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 2px 8px;
}

.navbar-nav .dropdown-item:hover {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
  transform: translateX(5px);
}

.navbar-nav .dropdown-item.active {
  background: #007bff;
  color: white;
}

/* ===== SCROLL EFFECTS ===== */
.navbar-scrolled .navbar-nav .nav-item.active .nav-link {
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .navbar-nav .nav-item.active .nav-link {
    background: #000000;
    color: #ffffff !important;
    border: 2px solid #ffffff;
  }
  
  .navbar-nav .nav-link:hover:not(.active) {
    background: #ffffff;
    color: #000000 !important;
    border: 1px solid #000000;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .navbar-nav .nav-link,
  .navbar-nav .nav-link i,
  .navbar-brand,
  .navbar-toggler {
    transition: none;
  }
  
  .navbar-nav .nav-item.active .nav-link i {
    animation: none;
  }
  
  .navbar-nav .nav-item.active .nav-link::after {
    animation: none;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar-nav .nav-item.active .nav-link {
    background: #000000 !important;
    color: #ffffff !important;
    box-shadow: none;
  }
  
  .navbar-nav .nav-item.active .nav-link::after {
    display: none;
  }
}
