@import "./xterm.css";
@import "tailwindcss";

/* Custom Fonts */
@layer base {
  html {
    font-family: 'Inter', system-ui, sans-serif;
  }

  code, pre, .font-mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
  }
}

/* Custom Animations */
@layer utilities {
  /* Fade in up animation */
  @keyframes fade-in-up {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out;
  }

  /* Fade in animation */
  @keyframes fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .animate-fade-in {
    animation: fade-in 0.8s ease-out;
  }

  /* Slow pulse animation */
  @keyframes pulse-slow {
    0%, 100% {
      opacity: 0.4;
    }
    50% {
      opacity: 0.7;
    }
  }

  .animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
  }

  /* Blink cursor animation */
  @keyframes blink {
    0%, 50% {
      opacity: 1;
    }
    51%, 100% {
      opacity: 0;
    }
  }

  .animate-blink {
    animation: blink 1s step-end infinite;
  }

  /* Scroll indicator animation */
  @keyframes scroll-down {
    0% {
      transform: translateY(0);
      opacity: 1;
    }
    50% {
      transform: translateY(6px);
      opacity: 0.5;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .animate-scroll-down {
    animation: scroll-down 1.5s ease-in-out infinite;
  }

  /* Animation delay utilities */
  .animation-delay-500 {
    animation-delay: 0.5s;
  }

  .animation-delay-1000 {
    animation-delay: 1s;
  }

  .animation-delay-2000 {
    animation-delay: 2s;
  }

  /* Reveal animation for scroll */
  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-reveal {
    animation: reveal 0.6s ease-out forwards;
  }

  /* Gradient text animation */
  @keyframes gradient-shift {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }

  .animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
  }
}

/* Navigation link styles */
.nav-link {
  @apply px-4 py-2 rounded-lg text-slate-400 text-sm font-medium transition-all duration-300;
  @apply hover:text-white hover:bg-slate-800/50;
}

.nav-link.active {
  @apply text-cyan-400 bg-cyan-500/10;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgb(15 23 42);
}

::-webkit-scrollbar-thumb {
  background: rgb(51 65 85);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(71 85 105);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgb(51 65 85) rgb(15 23 42);
}

/* Selection colors */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: rgb(165, 243, 252);
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Enhanced Focus styles for accessibility */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgb(6, 182, 212);
  outline-offset: 3px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgb(6, 182, 212);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.focus\:not-sr-only:focus {
  position: absolute;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Reveal animation initial state */
[data-reveal-target="item"] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal-target="item"].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Respect user motion preferences - CRITICAL for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-fade-in-up,
  .animate-fade-in,
  .animate-pulse-slow,
  .animate-blink,
  .animate-scroll-down,
  .animate-reveal,
  .animate-gradient {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  [data-reveal-target="item"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .text-slate-400 {
    color: rgb(203, 213, 225);
  }

  .text-slate-500 {
    color: rgb(148, 163, 184);
  }

  .border-slate-800 {
    border-color: rgb(100, 116, 139);
  }

  a, button {
    text-decoration-thickness: 2px;
  }
}
