/* Custom Styles & Utilities */
body {
  overflow-x: hidden;
  /* Allow text selection (highlighting) for user preference */
  user-select: text;
  -webkit-user-select: text;
  /* Subtle noise texture */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
}

/* =====================================================
   DARK MODE RICH BACKGROUND
   ===================================================== */
/* Deep-space background for dark mode */
.dark body,
html.dark body {
  background-color: #03071e;
}

/* Rich dark gradient used on fixed background layer */
.dark .dark-bg-gradient {
  background: radial-gradient(ellipse 80% 50% at 20% 0%, rgba(67, 20, 136, 0.18) 0%, transparent 60%),
              radial-gradient(ellipse 60% 40% at 80% 100%, rgba(14, 116, 144, 0.14) 0%, transparent 60%),
              radial-gradient(ellipse 50% 60% at 50% 50%, rgba(15, 23, 42, 0.95) 0%, transparent 100%),
              #030718;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.dark .glass {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}



/* Gradient Text */
.text-gradient {
  background: linear-gradient(to right, #38bdf8, #c084fc, #fb7185);
  /* Brighter gradient */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}



/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 5px;
  border: 2px solid #0f172a;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Typing Cursor */
.typing-cursor::after {
  content: "|";
  animation: blink 1s step-end infinite;
  color: #0ea5e9;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Card Hover Glow & Lift */
.hover-glow {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px -10px rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.3);
}

/* Reveal on Scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* MagicUI Custom Pointer Animations */
@keyframes pointerBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-5px) rotate(-5deg);
  }
  50% {
    transform: translateY(5px) rotate(5deg);
  }
  75% {
    transform: translateY(-5px) rotate(-5deg);
  }
}

@keyframes pointerPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.custom-pointer-wrapper {
  position: absolute;
  top: 10px;
  right: -10px;
  z-index: 20;
  pointer-events: none; /* Let clicks pass through to card */
  /* Hidden by default, shown on card hover */
  opacity: 0;
  transform: translate(10px, -10px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .custom-pointer-wrapper,
.group:hover .custom-pointer-wrapper {
  opacity: 1;
  transform: translate(-20px, 20px);
}

.custom-pointer-animate {
  animation: pointerBounce 1.5s ease-in-out infinite;
}

.custom-pointer-svg-animate {
  animation: pointerPulse 0.8s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* MagicUI Interactive Hover Button */
.interactive-hover-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  overflow: hidden;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: white;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #0f172a;
}

.dark .interactive-hover-btn {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* The arrow initially hidden/left */
.interactive-hover-btn .btn-arrow {
  position: absolute;
  left: -20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  color: white;
  z-index: 10;
}

/* The text span */
.interactive-hover-btn .btn-text {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

/* The background dot that expands */
.interactive-hover-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background-color: #0ea5e9; /* primary color */
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

/* Hover States */
.interactive-hover-btn:hover {
  color: white;
  border-color: #0ea5e9;
}

.interactive-hover-btn:hover::after {
  transform: translate(-50%, -50%) scale(40);
}

.interactive-hover-btn:hover .btn-text {
  transform: translateX(12px);
}

.interactive-hover-btn:hover .btn-arrow {
  opacity: 1;
  left: 20px;
}

/* Education Animation Styles - Premium & Calm */

/* Timeline Line Reveal */
.edu-line-reveal {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  /* Custom ease-out-quint for silky smoothness */
}

.edu-line-reveal.active {
  transform: scaleY(1);
}

/* Timeline Dot Scale In */
.edu-dot-reveal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Slight pop/overshoot but gentle */
}

/* Note: translate(-50%, -50%) is needed because existing dot uses absolute centering potentially? 
   Checking existing code: class="absolute left-1/2 top-0 transform -translate-x-1/2 -translate-y-1/2"
   So we need to maintain that existing transform while animating scale.
*/
.edu-dot-reveal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Card Slides - Desktop */
@media (min-width: 768px) {
  .edu-card-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .edu-card-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .edu-card-left.active,
  .edu-card-right.active {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Card Slides - Mobile (Fade Up only) */
@media (max-width: 767px) {
  .edu-card-left,
  .edu-card-right {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .edu-card-left.active,
  .edu-card-right.active {
    opacity: 1;
    transform: translateY(0);
  }
}
.logo-slider {
  overflow: hidden;
  padding: 16px 0;
  background: transparent;
  white-space: nowrap;
  position: relative;
  width: 100%;
  text-decoration: none;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
}

.logo-track {
  display: flex;
  align-items: center;
  gap: 5rem;
  width: max-content;
  animation: scroll 30s linear infinite;
  text-decoration: none;
  line-height: 0;
}

.logo-track:hover {
  animation-play-state: paused;
}

.logo-track img {
  height: 40px; /* ← change this to resize all logos */
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  text-decoration: none !important;
  border: none;
  outline: none;
  filter: none;
  opacity: 0.85;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Invert black logos (Vercel, Replit) to make them white */
.logo-track img.invert {
  filter: invert(1);
}

.logo-track img.bolt-logo {
  max-width: 60px;
  height: 30px;
}

.logo-track img:hover {
  opacity: 1;
  transform: scale(1.1);
  filter: none; /* Reset filter on hover? No, keep invert for those that need it, or assume hover background doesn't change? */
}

.logo-track img.invert:hover {
  filter: invert(1); /* Keep inverted on hover if background is still dark */
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Zoho-style Scroll Interaction - Stacked Deck Folder Look */
.pin-section {
  position: relative;
  height: 400vh; /* Allow sufficient scroll distance */
  background: transparent;
}

.pin-wrapper {
  position: sticky;
  top: 64px; /* exactly the navbar height — keeps slider below nav */
  left: 0;
  width: 100%;
  height: calc(100vh - 64px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1.5rem;
}

/* Header inside pinned section needs to stay visible */
.pin-wrapper h3,
.pin-wrapper p {
  position: relative;
  z-index: 50;
}

.pin-wrapper .absolute.top-10 {
  position: absolute;
  top: 5vh;
  z-index: 50;
  width: 100%;
}

.expertise-card {
  position: absolute !important;
  top: 20vh; /* sits below header text inside the pinned viewport */
  left: 50%;
  transform: translateX(-50%) translateY(120vh) scale(0.9); /* Start off-screen */
  width: 100%;
  max-width: 900px;
  min-height: 380px; /* spec: minHeight */
  height: auto; /* Allow growth */
  background: white;
  border-radius: 24px !important; /* spec: borderRadius - forced to ensure bottom is rounded */
  padding: 48px; /* spec: padding */
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.15); /* Top shadow is key for folder look */
  transition: box-shadow 0.3s ease;
  will-change: transform, opacity;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dark .expertise-card {
  background: #0f172a;
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.expertise-card.active {
  opacity: 1;
  /* Transformation is controlled by JS */
}

/* Ensure content inside card is laid out well */
.expertise-card .flex {
  height: 100%;
}

/* Stacking Order */
.expertise-card:nth-child(2) {
  z-index: 10;
}
.expertise-card:nth-child(3) {
  z-index: 20;
}
.expertise-card:nth-child(4) {
  z-index: 30;
}
.expertise-card:nth-child(5) {
  z-index: 40;
}

/* AntiGravity Animation */
@keyframes float-ag {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px); /* spec: floatDistance */
  }
}

.animate-antigravity {
  animation: float-ag 4s ease-in-out infinite; /* spec: duration, timing */
}

/* Section Padding Utility */
.section-padding {
  padding-top: 0;
  padding-bottom: 80px;
  padding-left: 16px;
  padding-right: 16px;
}

/* On mobile: hide card image — show only title + para + skill tags */
@media (max-width: 1023px) {
  .card-image {
    display: none;
  }

  .expertise-card {
    padding: 28px 24px;
    min-height: 0;
  }

  .expertise-card .flex {
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* Keep skill tags in a horizontal row */
  .expertise-card .flex.flex-wrap {
    flex-direction: row !important;
    gap: 8px !important;
  }

  .expertise-card .flex > div:not(.card-image) {
    width: 100%;
    flex: 1;
    min-width: 0 !important;
  }
}

/* Floating Dock Tooltips */
.dock-item {
  position: relative;
}

.dock-tooltip {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.9);
  background-color: rgba(15, 23, 42, 0.9); /* Dark background */
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  z-index: 100;
}

.dark .dock-tooltip {
  background-color: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.1);
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Hover Scaling for Dock Icons */
.dock-item .dock-icon-wrapper {
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom center;
}

.dock-item:hover .dock-icon-wrapper {
  transform: translateY(-8px) scale(1.3);
  margin-left: 8px;
  margin-right: 8px;
}

.dock-item:hover {
  z-index: 10;
}

/* Theme Toggle Animation (Sliding Upside) */
.theme-switch-icon-wrapper {
  overflow: hidden;
  position: relative;
}

.theme-sun, .theme-moon {
  transition: transform 0.6s cubic-bezier(0.87, 0, 0.13, 1), opacity 0.6s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
}

/* Light Mode (Sun visible, Moon below) */
.theme-sun {
  transform: translateY(0) rotate(0deg);
  opacity: 1;
}

.theme-moon {
  transform: translateY(150%) rotate(45deg);
  opacity: 0;
}

/* Dark Mode (Sun pushed up, Moon raised up) */
.dark .theme-sun {
  transform: translateY(-150%) rotate(-45deg);
  opacity: 0;
}

.dark .theme-moon {
  transform: translateY(0) rotate(0deg);
  opacity: 1;
}

/* Skill Tag - Smooth Hover Animation */
.skill-tag {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              background 0.25s ease;
  cursor: default;
}

.skill-tag:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Entrance pop-in animation for skill tags */
@keyframes skill-pop-in {
  0%   { opacity: 0; transform: translateY(8px) scale(0.88); }
  70%  { opacity: 1; transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.expertise-card.active .skill-tag {
  animation: skill-pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.expertise-card.active .skill-tag:nth-child(1) { animation-delay: 0.15s; opacity: 0; }
.expertise-card.active .skill-tag:nth-child(2) { animation-delay: 0.25s; opacity: 0; }
.expertise-card.active .skill-tag:nth-child(3) { animation-delay: 0.35s; opacity: 0; }
.expertise-card.active .skill-tag:nth-child(4) { animation-delay: 0.45s; opacity: 0; }

/* =====================================================
   TECH BADGE COMPONENT
   ===================================================== */
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              background 0.22s ease;
  cursor: default;
  white-space: nowrap;
}

.dark .tech-badge {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.tech-badge:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.18);
}

.dark .tech-badge:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
}

.tech-badge img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Pop-in for tech badges */
@keyframes badge-pop-in {
  0%   { opacity: 0; transform: translateY(10px) scale(0.85); }
  70%  { opacity: 1; transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.tech-badge-wrap .tech-badge {
  animation: badge-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.tech-badge-wrap .tech-badge:nth-child(1)  { animation-delay: 0.05s; }
.tech-badge-wrap .tech-badge:nth-child(2)  { animation-delay: 0.10s; }
.tech-badge-wrap .tech-badge:nth-child(3)  { animation-delay: 0.15s; }
.tech-badge-wrap .tech-badge:nth-child(4)  { animation-delay: 0.20s; }
.tech-badge-wrap .tech-badge:nth-child(5)  { animation-delay: 0.25s; }
.tech-badge-wrap .tech-badge:nth-child(6)  { animation-delay: 0.30s; }
.tech-badge-wrap .tech-badge:nth-child(7)  { animation-delay: 0.35s; }
.tech-badge-wrap .tech-badge:nth-child(8)  { animation-delay: 0.40s; }
.tech-badge-wrap .tech-badge:nth-child(9)  { animation-delay: 0.45s; }
.tech-badge-wrap .tech-badge:nth-child(10) { animation-delay: 0.50s; }

/* =====================================================
   DARK MODE ENHANCED BLOB COLORS
   ===================================================== */
/* Override blob colors for richer dark mode feel */
.dark .blob-primary {
  background: rgba(99, 102, 241, 0.22) !important; /* indigo */
}
.dark .blob-secondary {
  background: rgba(139, 92, 246, 0.18) !important; /* violet */
}
.dark .blob-accent {
  background: rgba(14, 165, 233, 0.14) !important; /* sky */
}

/* Aurora shimmer line at top – dark mode only */
.dark-aurora-line {
  display: none;
}
.dark .dark-aurora-line {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1 20%, #a855f7 50%, #06b6d4 80%, transparent);
  opacity: 0.6;
  z-index: 9998;
  animation: aurora-move 6s ease-in-out infinite alternate;
}

@keyframes aurora-move {
  0%   { background-position: 0% 50%; opacity: 0.4; }
  100% { background-position: 100% 50%; opacity: 0.8; }
}

/* Star/particle background dots – dark mode only */
.dark-stars {
  display: none;
}
.dark .dark-stars {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1.5px 1.5px at 40% 30%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 55% 75%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 80% 55%, rgba(255,255,255,0.22), transparent),
    radial-gradient(1.2px 1.2px at 90% 80%, rgba(255,255,255,0.28), transparent),
    radial-gradient(1px 1px at 15% 88%, rgba(255,255,255,0.20), transparent),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1.5px 1.5px at 35% 92%, rgba(255,255,255,0.18), transparent);
}
