/* Base styles (no Tailwind @apply to ensure CDN compatibility) */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-feature-settings: "case" on, "rlig" on, "calt" on; }
/* Better focus visibility */
:focus-visible { outline: 2px solid #3B82F6; outline-offset: 2px; }

/* Utility components */
.nav-link { color: #1f2937; text-decoration: none; transition: color .2s ease; }
.nav-link:hover { color: #2563EB; }

.btn-primary { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.75rem; background: #2563EB; color: #fff; padding: 0.5rem 1rem; box-shadow: 0 5px 18px rgba(37,99,235,0.35); transition: background .2s ease, transform .2s ease; }
.btn-primary:hover { background: #1D4ED8; transform: translateY(-1px); }

.btn-secondary { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.75rem; border: 1px solid #d1d5db; color: #374151; padding: 0.5rem 1rem; background: rgba(255,255,255,0.9); transition: background .2s ease, transform .2s ease; }
.btn-secondary:hover { background: rgba(243,244,246,0.9); transform: translateY(-1px); }

.label { display: block; font-size: 0.875rem; font-weight: 600; color: #cbd5e1; margin-bottom: 0.25rem; }

.input { width: 100%; border-radius: 0.75rem; border: 1px solid #334155; background: rgba(2,6,23,0.7); padding: 0.5rem 0.75rem; outline: none; transition: box-shadow .15s ease, border-color .15s ease; color: #e2e8f0; }
.input:focus { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }

.section-title { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; font-family: 'Playfair Display', 'Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica Neue', serif; }
.section-sub { margin-top: 0.5rem; color: #6b7280; }

.card { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: rgba(255,255,255,0.9); padding: 1.5rem; box-shadow: 0 10px 20px rgba(0,0,0,0.04); transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: 0 14px 26px rgba(0,0,0,0.08); transform: translateY(-2px); }

.card-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; font-family: 'Poppins', 'Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Helvetica Neue', sans-serif; }

.project-card { overflow: hidden; border-radius: 0.75rem; border: 1px solid #e5e7eb; background: rgba(255,255,255,0.9); box-shadow: 0 10px 20px rgba(0,0,0,0.06); transition: box-shadow .2s ease, transform .2s ease; display: block; }
.project-card:hover { box-shadow: 0 18px 32px rgba(0,0,0,0.12); transform: translateY(-2px); }
.project-img { height: 140px; background: radial-gradient(60% 80% at 20% 20%, #f9fafb 0%, transparent 60%), linear-gradient(135deg, #ffffff 0%, #f9fafb 100%); object-fit: cover; width: 100%; }
.project-body { padding: 1rem; }

.demo-block { border-radius: 0.75rem; border: 1px solid #e5e7eb; background: rgba(255,255,255,0.9); padding: 1.5rem; }

/* Performance: render only when in viewport */
section { content-visibility: auto; contain-intrinsic-size: 600px; }
.card, .project-card, .tilt, .reveal { will-change: transform; }

/* Skip link */
.skip-link { position: absolute; left: -999px; top: -999px; background: #3B82F6; color: #fff; padding: 0.5rem 0.75rem; border-radius: 0.5rem; box-shadow: 0 10px 24px rgba(59,130,246,0.35); z-index: 1000; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* Scroll progress indicator */
#scrollProgress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: transparent; z-index: 60; }
#scrollProgressBar { height: 100%; width: 0%; background: linear-gradient(90deg, #93C5FD, #3B82F6); box-shadow: 0 0 12px rgba(59,130,246,0.6); transition: width .1s linear; }

/* Hero background (CSS-only animated gradient) */
.hero-bg {
  width: 100%; height: 100%;
  background: radial-gradient(1200px 400px at 20% 20%, rgba(255,107,107,0.2), transparent 60%),
              radial-gradient(1200px 400px at 80% 80%, rgba(224,49,49,0.15), transparent 60%);
  filter: blur(10px);
  animation: floatBg 12s ease-in-out infinite;
}
@keyframes floatBg {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Hero canvas overlay */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-bg { animation: none; }
  #scrollProgressBar { transition: none; }
}

/* Pricing cards */
.plan-card { display: flex; flex-direction: column; gap: 0.5rem; }
.plan-card .badge { display: inline-block; font-weight: 700; color: #3B82F6; }
.plan-card .price { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-card .list-check { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.plan-card .list-check li { display: flex; align-items: center; gap: 0.5rem; margin: 0.3rem 0; }
.plan-card .list-check li::before { content: "✔"; color: #10b981; }
.plan-card.highlighted { border-color: #3B82F6; box-shadow: 0 18px 36px rgba(59,130,246,0.15); }

/* Showcase layout */
.showcase-card { padding: 0; }
.showcase-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 768px) { .showcase-layout { grid-template-columns: 2fr 3fr; } }
.showcase-media { border-right: 1px solid #e2e8f0; }
.dark .showcase-media { border-color: #1f2937; }
.showcase-img { height: 220px; background: radial-gradient(50% 80% at 25% 25%, #f5f5dc 0%, transparent 60%), linear-gradient(135deg, #fafafa 0%, #f5f5dc 100%); }
@media (min-width: 768px) { .showcase-img { height: 100%; } }
.showcase-body { padding: 1.25rem; }

/* Gallery */
.gallery { position: relative; padding: 1rem; }
.gallery-track { position: relative; overflow: hidden; border-radius: 0.5rem; border: 1px solid #e2e8f0; background: #fff; }
.dark .gallery-track { border-color: #1f2937; background: #0b1220; }
.gallery-track img { width: 100%; height: auto; display: block; }
.gallery-prev, .gallery-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(2,6,23,0.6); color: #fff; border: none; width: 36px; height: 36px; border-radius: 999px; cursor: pointer; }
.gallery-prev { left: 0.5rem; }
.gallery-next { right: 0.5rem; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 0.5rem; }
.gallery-dots .dot { width: 8px; height: 8px; border-radius: 999px; border: 1px solid #3B82F6; background: transparent; cursor: pointer; }
.gallery-dots .dot.active { background: #3B82F6; }

/* Metrics */
.metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.metric { font-size: 0.8rem; padding: 0.25rem 0.5rem; border-radius: 0.5rem; background: rgba(2,6,23,0.06); border: 1px solid #e2e8f0; }
.dark .metric { background: rgba(2,6,23,0.4); border-color: #1f2937; }

/* Performance metrics progress circles */
.metric-circle path:nth-child(2)[data-progress="85"] { stroke-dasharray: 85, 100; }
.metric-circle path:nth-child(2)[data-progress="95"] { stroke-dasharray: 95, 100; }
.metric-circle path:nth-child(2)[data-progress="98"] { stroke-dasharray: 98, 100; }

/* Analytics bars */
.analytics-bar[data-width="80"] { width: 80%; }
.analytics-bar[data-width="84"] { width: 84%; }
.analytics-bar[data-width="88"] { width: 88%; }
.analytics-bar[data-width="92"] { width: 92%; }

/* Currency toggle */
.currency-toggle { margin-top: 0.75rem; display: inline-flex; border: 1px solid #e2e8f0; border-radius: 999px; overflow: hidden; }
.dark .currency-toggle { border-color: #1f2937; }
.toggle-btn { background: transparent; color: inherit; border: none; padding: 0.4rem 0.8rem; cursor: pointer; font-size: 0.9rem; }
.toggle-btn.active { background: rgba(59,130,246,0.12); color: #3B82F6; }

/* WhatsApp button */
.btn-whatsapp { display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 0.75rem; background: #25D366; color: #fff; padding: 0.5rem 0.9rem; box-shadow: 0 6px 18px rgba(37,211,102,0.3); transition: background .2s ease, transform .2s ease; }
.btn-whatsapp:hover { background: #128C7E; transform: translateY(-1px); }
.btn-whatsapp svg { width: 18px; height: 18px; }

/* Chatbot styles */
#chatbot-widget button {
  transform: scale(1);
}

#chatbot-widget button:hover {
  transform: scale(1.05);
}

#chatbot-modal {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  #chatbot-modal {
    animation: fadeIn 0.3s ease-out;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}

#chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.dark #chat-messages::-webkit-scrollbar-thumb {
  background: #475569;
}

/* Upcoming Projects Animations */
.upcoming-project {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.upcoming-project:nth-child(1) { animation-delay: 0.1s; }
.upcoming-project:nth-child(2) { animation-delay: 0.2s; }
.upcoming-project:nth-child(3) { animation-delay: 0.3s; }
.upcoming-project:nth-child(4) { animation-delay: 0.4s; }
.upcoming-project:nth-child(5) { animation-delay: 0.5s; }
.upcoming-project:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Coming Soon badge pulse */
.coming-soon-badge {
  animation: badgePulse 2s ease-in-out infinite;
}

/* Coming Soon Badge Variants */
.coming-soon-badge.purple { background: linear-gradient(to right, #9333ea, #ec4899); }
.coming-soon-badge.blue { background: linear-gradient(to right, #2563eb, #06b6d4); }
.coming-soon-badge.green { background: linear-gradient(to right, #16a34a, #10b981); }
.coming-soon-badge.orange { background: linear-gradient(to right, #ea580c, #dc2626); }
.coming-soon-badge.indigo { background: linear-gradient(to right, #4f46e5, #9333ea); }

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(147, 197, 253, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(147, 197, 253, 0);
  }
}

/* Upcoming Project Cards */
.upcoming-project-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  transition: all 0.5s;
  padding: 2rem;
}

.upcoming-project-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.upcoming-project-card .project-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.upcoming-project-card .project-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upcoming-project-card .project-content {
  margin-top: 2rem;
}

.upcoming-project-card .project-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: rgb(17 24 39);
  color: rgb(75 85 99);
  line-height: 1.625;
  margin-bottom: 1rem;
  transition: color 0.3s;
}

.upcoming-project-card .project-description {
  color: #6b7280;
  line-height: 1.625;
  margin-bottom: 1rem;
}

.upcoming-project-card .tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.upcoming-project-card .project-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  background-color: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.upcoming-project-card .status-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}


/* Reusable Icon Classes */
.icon-checkmark {
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
}

/* Performance Metrics Animations */
@keyframes progress-fill {
  from {
    stroke-dasharray: 0, 100;
  }
  to {
    stroke-dasharray: var(--progress), 100;
  }
}

.metric-circle path:nth-child(2) {
  animation: progress-fill 2s ease-out forwards;
}

/* Metric cards hover effects */
.metric-card {
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Analytics bars animation */
.analytics-bar {
  animation: bar-fill 1.5s ease-out forwards;
}

@keyframes bar-fill {
  from {
    width: 0%;
  }
  to {
    width: var(--bar-width);
  }
}

/* Pulse animation for metrics */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  }
}

.metric-highlight {
  animation: pulse-glow 3s ease-in-out infinite;
}
