/* ===========================================================================
   APAS AI LAB - Modern Professional Design System
   Version: 3.0 - Complete Redesign
   =========================================================================== */

/* ---------------------------
   0. CSS RESET & BASE STYLES
   --------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #ffffff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------
   1. MODERN DESIGN TOKENS
   --------------------------- */
:root {
  /* Primary Colors - Vibrant Blue */
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  
  /* Accent Colors */
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f59e0b;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  
  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-blue: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-sunset: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
  --gradient-ocean: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --gradient-forest: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  
  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Shadows - More Dramatic */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.3);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------
   2. TYPOGRAPHY SYSTEM
   --------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--space-6);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-6);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-4);
  color: var(--gray-600);
  font-size: 1.125rem;
  line-height: 1.75;
}

.text-lg {
  font-size: 1.25rem;
  line-height: 1.75;
}

.text-xl {
  font-size: 1.5rem;
  line-height: 1.75;
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------------------------
   3. NAVIGATION - GLASSMORPHISM
   --------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: all var(--transition);
}

.navbar.scrolled {
  padding: 0.75rem 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: scale(1.02);
}

.logo-img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-blue);
  border-radius: var(--radius-full);
}

.nav-cta {
  background: var(--gradient-blue);
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-900);
}

/* ---------------------------
   4. HERO SECTION - MODERN & BOLD
   --------------------------- */
.hero {
  min-height: 100vh;
  padding-top: 120px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 50%, #f3f4f6 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(5deg); }
  66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.8s ease-out;
}

.hero .subtitle {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  color: var(--gray-700);
  margin-bottom: var(--space-4);
  font-weight: 600;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero p {
  font-size: 1.125rem;
  color: var(--gray-600);
  margin-bottom: var(--space-8);
  max-width: 600px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-visual {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease-out 0.4s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-illustration {
  position: relative;
  width: 100%;
  max-width: 550px;
  aspect-ratio: 1;
}

/* Animated Orb */
.animated-orb {
  position: absolute;
  width: 400px;
  height: 400px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gradient-blue);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morphOrb 8s ease-in-out infinite;
  box-shadow: var(--shadow-glow);
  opacity: 0.9;
}

@keyframes morphOrb {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
  50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
}

/* Floating Elements */
.floating-element {
  position: absolute;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  animation: floatElement 6s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  top: 20%;
  right: 10%;
  animation-delay: 1s;
}

.floating-element:nth-child(3) {
  bottom: 20%;
  right: 5%;
  animation-delay: 2s;
}

.floating-element:nth-child(4) {
  bottom: 15%;
  left: 10%;
  animation-delay: 3s;
}

@keyframes floatElement {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-25px); }
}

.floating-element .icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.floating-element .text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* ---------------------------
   5. BUTTON SYSTEM - MODERN
   --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  gap: var(--space-2);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 2px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

/* ---------------------------
   6. SECTION LAYOUTS
   --------------------------- */
.section {
  padding: var(--space-20) 0;
  position: relative;
}

.section-light {
  background: var(--white);
}

.section-gray {
  background: var(--gray-50);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-16);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: 1.25rem;
  color: var(--gray-600);
}

/* ---------------------------
   7. SERVICE CARDS - PREMIUM
   --------------------------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
}

.service-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

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

.service-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  display: inline-block;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
  color: var(--gray-900);
}

.service-card p {
  color: var(--gray-600);
  margin-bottom: var(--space-4);
  font-size: 1rem;
}

.service-features {
  list-style: none;
  margin-top: var(--space-6);
}

.service-features li {
  padding: var(--space-2) 0;
  color: var(--gray-600);
  position: relative;
  padding-left: var(--space-6);
  font-size: 0.9375rem;
}

.service-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.125rem;
}

/* ---------------------------
   8. FEATURE CARDS
   --------------------------- */
.feature-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-100);
}

.feature-card .icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  margin-bottom: var(--space-3);
}

.feature-card p {
  font-size: 1rem;
  color: var(--gray-600);
}

/* ---------------------------
   9. GRID SYSTEM
   --------------------------- */
.grid {
  display: grid;
  gap: var(--space-8);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---------------------------
   10. FORMS - MODERN
   --------------------------- */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.9375rem;
}

.input {
  width: 100%;
  padding: var(--space-4);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

textarea.input {
  min-height: 150px;
  resize: vertical;
}

/* ---------------------------
   11. CARDS
   --------------------------- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.card-lg {
  padding: var(--space-8);
  border-radius: var(--radius-xl);
}

/* ---------------------------
   12. FOOTER - MODERN
   --------------------------- */
.footer {
  background: var(--gray-900);
  color: white;
  padding: var(--space-20) 0 var(--space-8);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer h3 {
  color: white;
  margin-bottom: var(--space-4);
}

.footer h4 {
  color: white;
  margin-bottom: var(--space-4);
  font-size: 1rem;
}

.footer p {
  color: var(--gray-400);
  font-size: 0.9375rem;
}

.footer a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-size: 0.9375rem;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-8);
  text-align: center;
}

.footer-bottom p {
  color: var(--gray-400);
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
}

.badge {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--gray-800);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--gray-400);
}

/* ---------------------------
   13. UTILITIES
   --------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }

.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }

.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }
.space-y-8 > * + * { margin-top: var(--space-8); }

/* ---------------------------
   14. RESPONSIVE DESIGN
   --------------------------- */
@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-16) 0;
  }
  
  .navbar {
    padding: 0.75rem 0;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: var(--space-6);
    box-shadow: var(--shadow-xl);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .hero {
    padding-top: 100px;
    text-align: center;
  }
  
  .hero-content {
    max-width: 100%;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .hero-visual {
    margin-top: var(--space-12);
  }
  
  .animated-orb {
    width: 300px;
    height: 300px;
  }
  
  .grid, .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .service-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
}