/* Custom CSS for Nikhil Jiby Portfolio */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #000000;
}

::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8b5cf6;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Eliminate 300ms mobile tap delay instantly on all interactive elements */
a,
button,
input {
  touch-action: manipulation;
}

/* Animations */
@keyframes glowPulse {
  0% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
  }

  50% {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  }

  100% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
  }
}

.animate-glow {
  animation: glowPulse 3s infinite;
}

/* Utility classes for glassmorphism */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

.glass-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.skill-item:hover .skill-progress,
.skill-item.touch-hover .skill-progress {
  width: var(--progress, 0%);
}

.skill-item:hover .skill-percentage,
.skill-item.touch-hover .skill-percentage {
  opacity: 1;
}

.skill-item:hover .skill-icon-container,
.skill-item.touch-hover .skill-icon-container {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
  border-color: rgba(139, 92, 246, 0.8);
}

/* Utility to reveal elements on scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Logo Unlocking Animations */
@keyframes logo-fade {
  0% {
    transform: translateY(-30px) scale(0.9);
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(6, 182, 212, 0));
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.5));
  }
}

.logo-fade-in {
  animation: logo-fade 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Light Mode Global Filter */
html.light-mode {
  filter: invert(1) hue-rotate(180deg);
  background-color: white;
  /* Ensure background inverts cleanly */
}

/* Re-invert most images so photos stay normal */
html.light-mode img:not([src="logo.svg"]),
html.light-mode video,
html.light-mode iframe,
html.light-mode canvas {
  filter: invert(1) hue-rotate(180deg);
}

/* Force the logo to stay inverted (turns black on white) */
html.light-mode img[src="logo.svg"] {
  filter: none !important;
}

/* Force Glass Cards to have a solid dark inner gradient in light mode 
   (because the global filter inverts this rgba(0,0,0) into white/light grey, 
   we actually need to specify the *opposite* color to get black!) */
html.light-mode #work .glass-card {
  background: rgba(255, 255, 255, 0.9) !important;
}

/* Un-invert the dark gradient overlay in Light Mode so it stays a black gradient */
html.light-mode #work .glass-card .bg-gradient-to-t {
  filter: invert(1) hue-rotate(180deg);
}

/* Un-invert the text content container in Light Mode so titles & tags stay white */
html.light-mode #work .glass-card .p-6.z-20 {
  filter: invert(1) hue-rotate(180deg);
}

/* Animated Setup for Background */
.bg-animated {
  background: linear-gradient(120deg, #09090b, #111827, #0f172a, #030712, #171124);
  background-size: 300% 300%;
  animation: gradientBG 20s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Custom Scrollbar for CV Preview */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.3);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.5);
}