/* Advanced Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 10px;
  border: 2px solid #f8fafc;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Aurora Background Utility */
.bg-aurora {
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15), transparent 50%),
    radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.1), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.1), transparent 50%);
  filter: blur(40px);
  z-index: 0;
}

/* Glassmorphism 3.0 */
.glass-nav {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

/* Mesh Grid Pattern */
.bg-grid-slate-100 {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(241 245 249 / 0.8)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
}

/* Shine Effect */
.shine {
  background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

.nav-link.active {
  color: #4f46e5;
}

/* Custom selection color */
::selection {
  background-color: #6366f1;
  color: white;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Slight stagger helper */
.reveal[data-delay="100"] {
  transition-delay: 100ms;
}
.reveal[data-delay="200"] {
  transition-delay: 200ms;
}
.reveal[data-delay="300"] {
  transition-delay: 300ms;
}

/* Parallax hero background */
.parallax-bg {
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* Accessibility: focus visible for interactive elements */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 3px solid rgba(99, 102, 241, 0.16);
  outline-offset: 3px;
}

/* Slight card lift on hover */
.group:hover {
  transform: translateY(-6px);
  transition: transform 300ms ease;
}

/* Improve CTA hover */
.bg-brand-600:hover,
.bg-slate-900:hover {
  transform: translateY(-4px);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

/* Make nav link active more visible */
.nav-link.active {
  color: #4f46e5;
  font-weight: 700;
}

/* Mobile Menu Improvements */
@media (max-width: 768px) {
  #mobile-menu {
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-menu-link {
    display: flex;
    align-items: center;
    transform: translateX(-20px);
    opacity: 0;
    animation: slideInMobile 0.3s ease-out forwards;
  }

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

  #navbar.glass-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  }
}

@keyframes slideInMobile {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile menu button improvements */
#mobile-btn:active {
  transform: scale(0.95);
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ============================================
   MODERN UI ENHANCEMENTS
   ============================================ */

/* Improved hover transitions and micro-interactions */
.card-enhanced {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.card-enhanced:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(79, 70, 229, 0.1);
}

/* Enhanced gradient text with smoother animation */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Better button hover effects with scale */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  font-weight: 700;
  line-height: 1.2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-3px) scale(1.05);
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background: #fff;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  border-color: #cbd5e1;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

/* Improved CTA glow animation with better timing */
.cta-glow {
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.35), 0 0 0 0 rgba(124, 58, 237, 0.3);
  animation: ctaPulse 3s ease-in-out infinite;
}

@keyframes ctaPulse {
  0% {
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.35), 0 0 0 0 rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.45), 0 0 0 20px rgba(124, 58, 237, 0);
  }
  100% {
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.35), 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

/* Enhanced team card interactions with smoother border gradient */
.team-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.team-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
  pointer-events: none;
}

.team-card:hover::before,
.team-card:focus::before {
  opacity: 1;
}

.team-card:hover,
.team-card:focus {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
}

/* Better stat card animations */
.stat-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transition: left 0.6s;
}

.stat-card:hover::before {
  left: 100%;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.15);
}

/* Enhanced program card hover with better shadow */
.program-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.program-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.program-card:hover::after {
  opacity: 1;
}

.program-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 50px rgba(79, 70, 229, 0.2);
}

/* Improved image hover zoom */
.img-hover-zoom {
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-hover-zoom img {
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-hover-zoom:hover img {
  transform: scale(1.15);
}

/* Better glassmorphism effect */
.glass-enhanced,
.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

/* Enhanced navbar glass effect */
#navbar.glass-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Improved badge hover effects */
.badge-modern {
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.badge-modern::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.badge-modern:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.badge-modern:hover::before {
  left: 100%;
}

/* Better chip styles with hover */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.3s;
}

.chip:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chip-indigo {
  background: #eef2ff;
  color: #4338ca;
  border-color: #e0e7ff;
}
.chip-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}
.chip-green {
  background: #ecfdf3;
  color: #15803d;
  border-color: #dcfce7;
}
.chip-rose {
  background: #fff1f2;
  color: #be123c;
  border-color: #ffe4e6;
}
.chip-amber {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

/* Enhanced focus states for better accessibility */
*:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 3px;
  border-radius: 6px;
  transition: outline 0.2s;
}

/* Better smooth scrolling */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Improved mobile menu animations */
#mobile-menu {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  transform: translateX(-30px);
  opacity: 0;
  animation: slideInMobile 0.4s ease-out forwards;
}

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

@keyframes slideInMobile {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Better scroll progress bar */
.scroll-progress-initial {
  width: 0%;
}

#scroll-progress {
  transition: width 0.15s ease-out;
  height: 3px;
}

/* Enhanced toast notifications */
.toast {
  background: white;
  padding: 18px 22px;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  transform: translateX(450px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid #4f46e5;
}

.toast.show {
  transform: translateX(0) translateY(0);
  opacity: 1;
}

.toast:hover {
  transform: translateX(-4px) translateY(0);
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.22);
}

/* Improved loading states */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.8s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Better image loading transitions */
img {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

img.loaded {
  opacity: 1;
}

img[loading="lazy"] {
  opacity: 1;
}

/* Enhanced responsive utilities */
@media (max-width: 768px) {
  .card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
  }

  .stat-card:hover {
    transform: translateY(-4px) scale(1.03);
  }

  .program-card:hover {
    transform: translateY(-6px) scale(1.01);
  }
}

/* Better performance optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.card-enhanced,
.program-card,
.team-card,
.stat-card {
  will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   UX IMPROVEMENTS
   ============================================ */

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Image Loading States */
img {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img.loaded {
  opacity: 1;
}

img[loading="lazy"] {
  opacity: 1;
}

/* Better Touch Targets for Mobile */
@media (max-width: 768px) {
  button,
  a,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }

  .mobile-menu-link {
    min-height: 56px;
  }
}

/* Smooth Page Transitions */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: pageFadeIn 0.4s ease-out;
}

/* Improved Focus Indicators */
*:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip to Content Link (Accessibility) */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #4f46e5;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
  top: 0;
}

/* Toast Notification Styles */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid #4f46e5;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left-color: #10b981;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  color: #64748b;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  padding: 4px;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #64748b;
}

/* Improved Button States */
button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Better Link States */
a:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* Improved Card Interactions */
.card-interactive {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-interactive:active {
  transform: scale(0.98);
}

/* Better Form UX */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.form-input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.form-error {
  color: #ef4444;
  font-size: 13px;
  margin-top: 4px;
}

/* Improved Scroll Behavior */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Better Mobile Swipe Gestures */
.swipeable {
  touch-action: pan-y;
}

/* Improved Content Readability */
.content-readable {
  max-width: 65ch;
  line-height: 1.7;
}

.content-readable p {
  margin-bottom: 1.25em;
}

/* Better Empty States */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
}

.empty-state-icon {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.empty-state-message {
  font-size: 14px;
  color: #64748b;
}

/* Improved Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
transform: translateX(-50%) translateY(-8px);
}
