/* Design System Variables */
:root {
  /* Typography */
  --font-serif: 'Crimson Text', Georgia, serif;
  --font-sans: 'Source Sans Pro', system-ui, sans-serif;
  
  /* Custom Colors */
  --primary-blue: #2563eb;
  --primary-indigo: #4f46e5;
  --secondary-slate: #475569;
  --accent-gold: #f59e0b;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--primary-indigo));
  --gradient-background: linear-gradient(135deg, #f8fafc, #e0f2fe);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  
  /* Shadows */
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-large: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --transition-fast: all 0.2s ease;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--secondary-slate);
  overflow-x: hidden;
}

/* Typography Enhancements */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  font-size: clamp(1rem, 2vw, 1.125rem);
}

/* Basic Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Navigation Enhancements */
#navbar {
  transition: var(--transition-smooth);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-medium);
}

.nav-link {
  position: relative;
  transition: var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 50%;
  background: var(--gradient-primary);
  transition: var(--transition-fast);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Button Enhancements */
button, .btn {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

button::before, .btn::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;
}

button:hover::before, .btn:hover::before {
  left: 100%;
}

/* Enhanced Service Card Hover Effects */
.service-card, .feature-card {
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: visible;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 300px;
}

.service-card:hover, .feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-large);
}

/* Service section debugging */
#services {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#services .grid {
  display: grid !important;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
  pointer-events: none;
}

.service-card:hover::before {
  left: 100%;
}

/* Service card text fix */
.service-card h3, .service-card p, .service-card ul, .service-card li {
  color: inherit !important;
  display: block !important;
  visibility: visible !important;
}

/* Service icons enhanced animations */
.service-card .w-16 {
  transition: all 0.3s ease;
  display: flex !important;
  visibility: visible !important;
}

.service-card:hover .w-16 {
  transform: scale(1.1) rotate(-5deg);
  filter: drop-shadow(0 10px 20px rgba(37, 99, 235, 0.3));
}

/* Form Styling */
input, textarea, select {
  transition: var(--transition-fast);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

input:focus, textarea:focus, select:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
}

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1e40af, #3730a3);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f4f6;
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --h1-size: 2.5rem;
    --h2-size: 2rem;
    --h3-size: 1.5rem;
    --body-size: 1rem;
  }
}

/* Mobile Navigation */
#mobile-menu {
  transition: var(--transition-smooth);
  max-height: 0;
  overflow: hidden;
}

#mobile-menu.open {
  max-height: 300px;
}

/* Contact Form Enhancements */
#contact-form {
  position: relative;
}

.form-success {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.form-success.show {
  opacity: 1;
  visibility: visible;
}

/* Removed problematic animations - keep simple */

/* Hero Background Animation */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(-45deg, #f8fafc, #e0f2fe, #dbeafe, #f1f5f9);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
  opacity: 0.5;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Stats Counter Animation */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* Professional Polish */
.backdrop-blur-custom {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Dark mode ready */
@media (prefers-color-scheme: dark) {
  .glass-effect {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    color: black !important;
    background: white !important;
  }
  
  a {
    color: black !important;
    text-decoration: underline !important;
  }
}