/* Critical CSS first - load this first for immediate rendering */
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --background: 0 0% 100%;
  --foreground: 250 20% 8%;
  --card: 0 0% 100%;
  --card-foreground: 250 20% 8%;
  --popover: 0 0% 100%;
  --popover-foreground: 250 20% 8%;
  --primary: 210 100% 50%;  /* Blue-based primary */
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%; /* Light blue secondary */
  --secondary-foreground: 250 25% 15%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 250 15% 40%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 250 25% 15%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 210 31.8% 91.4%;
  --input: 210 31.8% 91.4%;
  --ring: 210 100% 50%; /* Blue-based ring */
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 210 91.2% 59.8%; /* Blue-based primary for dark mode */
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 210 32.6% 17.5%; /* Dark blue secondary */
  --secondary-foreground: 210 40% 98%;
  --muted: 210 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 210 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 210 32.6% 17.5%;
  --input: 210 32.6% 17.5%;
  --ring: 210 76.3% 48%; /* Blue-based ring for dark mode */
}

/* Base styles that are needed immediately */
html, body, #root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", 
    Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override container class to ensure proper padding */
.container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Lazy loading images */
.lazy-load-image {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  will-change: opacity;
}

.lazy-loaded {
  opacity: 1;
}

@keyframes heading-reveal {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes expand-underline {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.heading-reveal {
  overflow: hidden;
  animation: heading-reveal 1s ease-out forwards;
}

.heading-underline {
  height: 3px;
  background: linear-gradient(to right, #1e40af, #60a5fa);
  margin-top: 0.5rem;
  width: 0;
  margin-left: auto;
  margin-right: auto;
  animation: expand-underline 1.5s ease-out 0.5s forwards;
}

.gradient-text {
  background: linear-gradient(to right, #1e40af, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes grid-line-subtle {
  0%, 100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes ambient-shift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(5%, 5%);
  }
  50% {
    transform: translate(0, 10%);
  }
  75% {
    transform: translate(-5%, 5%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.service-line {
  opacity: 0;
  transform: scaleX(0);
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
  transform-origin: left;
}

.service-card:hover .service-line {
  opacity: 1;
  transform: scaleX(1);
}

.service-icon-container {
  transition: transform 0.3s ease-out, background-color 0.3s ease-out;
}

.service-card:hover .service-icon-container {
  transform: translateY(-5px);
  background-color: rgba(30, 64, 175, 0.1);
}

.service-progress {
  width: 100%;
  transform: translateX(-100%);
  animation: service-progress 3s infinite linear;
}

@keyframes service-progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.service-tooltip {
  transform-origin: top center;
  animation: tooltip-appear 0.3s ease-out forwards;
}

@keyframes tooltip-appear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.data-point-pro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transform: translateY(20px);
  animation: data-point-appear 0.5s ease-out forwards;
}

@keyframes data-point-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scan-line-pro {
  top: 50%;
  animation: scan-line 4s linear infinite;
}

@keyframes scan-line {
  0% {
    top: 0%;
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.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);
}

.apple-button {
  position: relative;
  overflow: hidden;
  background-color: #3b82f6;
  color: white;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.apple-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.apple-button:active {
  transform: translateY(0);
}

.apple-button-secondary {
  background-color: transparent;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  transition: background-color 0.2s ease-out, transform 0.2s ease-out;
}

.apple-button-secondary:hover {
  background-color: #f3f4f6;
  transform: translateY(-2px);
}

.glass-effect {
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.8);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.glass-effect:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.light-shadow {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.shine-overlay {
  overflow: hidden;
}

.shine-overlay::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: transform 0.7s;
  opacity: 0;
}

.apple-button:hover .shine-overlay::before {
  transform: translateX(100%) rotate(30deg);
  opacity: 1;
  transition: transform 0.7s, opacity 0.1s;
}
