/* style.css - Modern NextGen Animation System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+Sinhala:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --transition-speed: 0.3s;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --glow-blue: rgba(59, 130, 246, 0.4);
  --glow-indigo: rgba(99, 102, 241, 0.4);
}

/* ═══════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════ */

body {
  font-family: 'Inter', 'Noto Sans Sinhala', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

a, button, input {
  transition: all var(--transition-speed) ease-in-out;
}

/* ═══════════════════════════════════════════
   CUSTOM SCROLLBAR
   ═══════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-indigo));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-indigo), var(--accent-purple));
}

/* ═══════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes gradientSlide {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.5); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes drawLine {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes bounceArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  25% { transform: translate(10px, -20px) scale(1.1); opacity: 0.6; }
  50% { transform: translate(-5px, -35px) scale(0.9); opacity: 0.4; }
  75% { transform: translate(15px, -15px) scale(1.05); opacity: 0.5; }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(59, 130, 246, 0.2); }
  50% { border-color: rgba(99, 102, 241, 0.5); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   ANIMATION UTILITY CLASSES
   ═══════════════════════════════════════════ */

.animate-fade-in-up { animation: fadeInUp 0.7s ease-out forwards; }
.animate-fade-in-down { animation: fadeInDown 0.7s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.7s ease-out forwards; }
.animate-fade-in-right { animation: fadeInRight 0.7s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.6s ease-out forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-float-slow { animation: floatSlow 6s ease-in-out infinite; }
.animate-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}
.animate-gradient {
  background-size: 200% 200%;
  animation: gradientSlide 6s ease infinite;
}
.animate-pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }
.animate-draw-line { animation: drawLine 1.5s ease-out forwards; }
.animate-bounce-arrow { animation: bounceArrow 1.5s ease-in-out infinite; }
.animate-spin-slow { animation: spin-slow 20s linear infinite; }

/* Stagger Delay Utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ═══════════════════════════════════════════
   SCROLL REVEAL (Intersection Observer fallback)
   ═══════════════════════════════════════════ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════════
   GLASSMORPHISM & CARD EFFECTS
   ═══════════════════════════════════════════ */

.glass-card {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(59, 130, 246, 0.1);
  transform: translateY(-4px);
}

.card-3d {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: translateY(-8px) rotateX(2deg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════════
   GRADIENT TEXT EFFECTS
   ═══════════════════════════════════════════ */

.text-gradient {
  background: linear-gradient(135deg, #e2e8f0, #ffffff, #93c5fd, #e2e8f0);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientSlide 8s ease infinite;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #60a5fa, #818cf8, #a78bfa, #60a5fa);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientSlide 5s ease infinite;
}

/* ═══════════════════════════════════════════
   BUTTON EFFECTS
   ═══════════════════════════════════════════ */

.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-25deg);
  transition: left 0.6s ease;
}

.btn-shine:hover::before {
  left: 125%;
}

.btn-glow {
  position: relative;
  transition: all 0.3s ease;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo), var(--accent-purple));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(12px);
}

.btn-glow:hover::after {
  opacity: 0.6;
}

/* ═══════════════════════════════════════════
   NAVBAR ANIMATION
   ═══════════════════════════════════════════ */

.navbar-scroll-active .main-header-row {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  transition: padding 0.4s ease;
}

.navbar-scroll-active .main-header-row .logo-circle {
  width: 50px;
  height: 50px;
  transition: all 0.4s ease;
}

header {
  transition: box-shadow 0.4s ease, background-color 0.4s ease;
}

header.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Nav link animated underline */
.nav-link-animated {
  position: relative;
}

.nav-link-animated::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-indigo));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link-animated:hover::after {
  width: 70%;
}

/* ═══════════════════════════════════════════
   SECTION DIVIDERS
   ═══════════════════════════════════════════ */

.section-divider {
  position: relative;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), var(--accent-indigo), transparent);
  opacity: 0.3;
  margin: 3rem auto;
  max-width: 200px;
}

.section-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--glow-blue);
}

/* ═══════════════════════════════════════════
   WAVE SEPARATOR (Footer)
   ═══════════════════════════════════════════ */

.wave-separator {
  position: relative;
  overflow: hidden;
  height: 60px;
}

.wave-separator svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 60px;
  animation: waveMove 8s linear infinite;
}

/* ═══════════════════════════════════════════
   PARTICLES / DECORATIVE ELEMENTS
   ═══════════════════════════════════════════ */

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFloat 8s ease-in-out infinite;
}

.particle-1 {
  width: 6px; height: 6px;
  background: rgba(59, 130, 246, 0.3);
  top: 20%; left: 10%;
  animation-delay: 0s;
}

.particle-2 {
  width: 4px; height: 4px;
  background: rgba(99, 102, 241, 0.4);
  top: 40%; right: 15%;
  animation-delay: 2s;
}

.particle-3 {
  width: 8px; height: 8px;
  background: rgba(139, 92, 246, 0.2);
  bottom: 30%; left: 20%;
  animation-delay: 4s;
}

.particle-4 {
  width: 5px; height: 5px;
  background: rgba(59, 130, 246, 0.3);
  top: 60%; right: 25%;
  animation-delay: 1s;
}

.particle-5 {
  width: 3px; height: 3px;
  background: rgba(147, 197, 253, 0.4);
  top: 15%; right: 30%;
  animation-delay: 3s;
}

/* ═══════════════════════════════════════════
   HOVER ICON EFFECTS
   ═══════════════════════════════════════════ */

.icon-hover-lift {
  transition: transform 0.3s ease, color 0.3s ease;
}

.icon-hover-lift:hover {
  transform: translateY(-3px);
}

.social-icon {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
  transform: translateY(-4px) scale(1.15);
  filter: drop-shadow(0 4px 12px currentColor);
}

/* ═══════════════════════════════════════════
   IMAGE HOVER EFFECTS
   ═══════════════════════════════════════════ */

.img-zoom-container {
  overflow: hidden;
}

.img-zoom-container img {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), filter 0.8s ease;
}

.img-zoom-container:hover img {
  transform: scale(1.08);
}

/* ═══════════════════════════════════════════
   COUNTER ANIMATION
   ═══════════════════════════════════════════ */

.counter-number {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════
   BACKGROUND MESH GRADIENT
   ═══════════════════════════════════════════ */

.bg-mesh {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
}

/* ═══════════════════════════════════════════
   HIDE SCROLLBAR UTILITY
   ═══════════════════════════════════════════ */

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ═══════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════
   LOGO ROTATION ANIMATION
   ═══════════════════════════════════════════ */

.logo-3d-wrapper {
  perspective: 1000px; /* depth */
}

@keyframes logo3DRotate {
  0% {
    transform: rotateY(-15deg);
  }
  50% {
    transform: rotateY(15deg);
  }
  100% {
    transform: rotateY(-15deg);
  }
}

.logo-3d {
  animation: logo3DRotate 6s ease-in-out infinite;
  transform-style: preserve-3d;
}