@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Poppins:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #1E3A8A;
  --secondary: #F97316;
  --dark: #0f172a;
  --accent: #8B5CF6;
}

body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #1e293b;
}

.dark body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
}

.orbitron {
  font-family: 'Orbitron', monospace;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Fixed Navigation - Improved for mobile */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  z-index: 50;
  transition: none;
  padding: 0.75rem 0;
  /* Reduced padding for mobile */
}

.dark .navbar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: rgba(51, 65, 85, 0.5);
}

/* Enhanced Loading Screen */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  color: white;
}

.loader-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.loader-ring {
  position: absolute;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.loader-ring:nth-child(1) {
  width: 120px;
  height: 120px;
  border-top-color: white;
}

.loader-ring:nth-child(2) {
  width: 90px;
  height: 90px;
  top: 15px;
  left: 15px;
  border-top-color: var(--secondary);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.loader-ring:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 30px;
  left: 30px;
  border-top-color: var(--accent);
  animation-duration: 1s;
}

.loading-text {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, white, var(--secondary));
  border-radius: 2px;
  animation: loadingProgress 2s ease-in-out;
}

@keyframes loadingProgress {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}

/* Enhanced Hero Background */
.hero-bg {
  background:
    radial-gradient(circle at 20% 80%, rgba(30, 58, 138, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 70%),
    linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  min-height: 100dvh;
}

.dark .hero-bg {
  background:
    radial-gradient(circle at 20% 80%, rgba(30, 58, 138, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.2) 0%, transparent 70%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Advanced Animated Background */
.animated-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

/* Fixed Geometric Shapes */
.geometric-shape {
  position: absolute;
  opacity: 0.15;
  animation: float 15s infinite ease-in-out;
  pointer-events: none;
}

.dark .geometric-shape {
  opacity: 0.25;
}

/* Hexagon Shape */
.hexagon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  position: relative;
  margin: 30px 0;
}

.hexagon:before,
.hexagon:after {
  content: "";
  position: absolute;
  width: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
}

.hexagon:before {
  bottom: 100%;
  border-bottom: 15px solid var(--primary);
}

.hexagon:after {
  top: 100%;
  border-top: 15px solid var(--primary);
}

/* Triangle Shape */
.triangle {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 52px solid var(--secondary);
  animation: float 12s infinite ease-in-out;
}

/* Diamond Shape */
.diamond {
  width: 40px;
  height: 40px;
  background: var(--accent);
  transform: rotate(45deg);
  animation: float 14s infinite ease-in-out;
}

/* Circle Shape */
.circle {
  width: 50px;
  height: 50px;
  background: var(--secondary);
  border-radius: 50%;
  animation: float 16s infinite ease-in-out;
}

/* Square Shape */
.square {
  width: 45px;
  height: 45px;
  background: var(--primary);
  animation: float 13s infinite ease-in-out;
}

/* Tech Icons */
.tech-icon {
  position: absolute;
  opacity: 0.2;
  animation: float 12s infinite ease-in-out;
  font-size: 1.5rem;
  color: var(--primary);
  pointer-events: none;
}

.dark .tech-icon {
  opacity: 0.3;
  color: var(--secondary);
}

/* Math Symbols */
.math-symbol {
  position: absolute;
  opacity: 0.2;
  animation: float 14s infinite ease-in-out;
  font-size: 2rem;
  color: var(--accent);
  font-family: 'Orbitron', monospace;
  pointer-events: none;
}

.dark .math-symbol {
  opacity: 0.3;
  color: var(--secondary);
}

/* Circuit Board Pattern */
.circuit-board {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  pointer-events: none;
}

.dark .circuit-board {
  opacity: 0.1;
}

.circuit-line {
  stroke: var(--primary);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 10, 5;
  animation: circuit 8s linear infinite;
}

/* Neural Network Visualization */
.neural-network {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.08;
  pointer-events: none;
}

.dark .neural-network {
  opacity: 0.12;
}

.neural-node {
  fill: var(--secondary);
  animation: neuralNetwork 12s ease-in-out infinite;
}

.neural-connection {
  stroke: var(--primary);
  stroke-width: 1;
  opacity: 0.5;
  animation: neuralNetwork 12s ease-in-out infinite;
}

/* Data Flow Animation */
.data-flow {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--secondary);
  border-radius: 50%;
  animation: dataFlow 6s linear infinite;
  pointer-events: none;
}

/* Holographic Effects */
.hologram-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: hologram 4s ease-in-out infinite;
}

.dark .hologram-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.1);
}

/* Enhanced Service Cards */
.service-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid #e2e8f0;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  position: relative;
  overflow: hidden;
  height: 100%;
  /* Ensure consistent height */
}

.dark .service-card {
  border-color: #334155;
  background: linear-gradient(145deg, #1e293b, #0f172a);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.1), transparent);
  transition: left 0.5s;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-color: var(--secondary);
}

.dark .service-card:hover {
  box-shadow: 0 25px 50px -12px rgba(249, 115, 22, 0.3);
}

/* 3D Card Effect */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.card-3d:hover {
  transform: rotateY(10deg) rotateX(10deg);
}

/* Glowing Effects */
.glow-effect {
  position: relative;
}

.glow-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}

.glow-effect:hover::after {
  opacity: 1;
}

/* Typing Effect */
.typing-text {
  overflow: hidden;
  border-right: 3px solid var(--secondary);
  white-space: nowrap;
  margin: 0 auto;
  animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes blink-caret {

  from,
  to {
    border-color: transparent
  }

  50% {
    border-color: var(--secondary)
  }
}

/* Enhanced Navigation Links */
.nav-link {
  position: relative;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 8px;
  transition: width 0.3s ease;
  z-index: -1;
}

.nav-link:hover::before {
  width: 100%;
}

.nav-link:hover {
  color: white;
  transform: translateY(-2px);
}

/* Button Enhancements */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #fb923c);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-secondary:hover::before {
  left: 100%;
}

/* Scroll Animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.scroll-animate.animate {
  opacity: 1;
  transform: translateY(0);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  width: 60px;
  height: 30px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  border-radius: 15px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .dark-mode-toggle {
  background: linear-gradient(135deg, #334155, #475569);
}

.toggle-circle {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--secondary), #fb923c);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark .toggle-circle {
  transform: translateX(30px);
  background: linear-gradient(135deg, var(--primary), #3b82f6);
}

/* Mobile Menu - Improved for responsiveness */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.dark .mobile-menu {
  background: rgba(15, 23, 42, 0.95);
}

.mobile-menu.active {
  right: 0;
}

/* Scroll to Top */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), #fb923c);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

.scroll-top.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scroll-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.4);
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
  }

  .hero-bg {
    padding-top: 100px;
  }

  .geometric-shape {
    display: block !important;
    opacity: 0.1;
  }

  .tech-icon {
    opacity: 0.1;
  }

  .math-symbol {
    opacity: 0.1;
  }

  .circuit-board {
    opacity: 0.03;
  }

  .neural-network {
    opacity: 0.05;
  }

  /* Mobile menu button spacing */
  .mobile-menu-btn {
    margin-left: 0.5rem;
  }

  /* Navbar logo spacing */
  .navbar-logo {
    margin-right: 0.5rem;
  }

  /* Hero section adjustments */
  .hero-content {
    text-align: center;
    padding-top: 4rem;
  }

  .hero-image {
    margin-top: 2rem;
    max-width: 90%;
  }

  /* Typing text height fix */
  .typing-text {
    min-height: 3rem;
  }

  /* Service cards spacing */
  .service-card {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 640px) {
  .neural-network {
    opacity: 0.03;
  }

  /* Hero section padding */
  .hero-bg {
    padding-top: 80px;
  }

  /* Navbar height reduction */
  .navbar {
    padding: 0.5rem 0;
  }

  /* Button sizes */
  .btn-primary,
  .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  /* Mobile menu links */
  .mobile-menu-link {
    font-size: 1.25rem;
    padding: 0.75rem 0;
  }

  /* Stats section grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}