﻿/*
 * Kluey – Global Styles
 * Supplements Tailwind CDN with custom utilities and animations.
 * Brand: Nunito body, Baloo 2 headings, Indigo #4F46E5 / Amber #F59E0B / Emerald #10B981
 */

/* ─── Smooth scroll ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ─── Selection colour ──────────────────────────────────────────────── */
::selection {
  background-color: rgba(79, 70, 229, 0.2);
  color: #1e1b4b;
}

/* ─── Custom scrollbar (Webkit) ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a5b4fc;
}

/* ─── Fade-in-up animation ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in-up {
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Stagger children */
.stagger-children > *:nth-child(1) {
  animation-delay: 0.06s;
}
.stagger-children > *:nth-child(2) {
  animation-delay: 0.12s;
}
.stagger-children > *:nth-child(3) {
  animation-delay: 0.18s;
}
.stagger-children > *:nth-child(4) {
  animation-delay: 0.24s;
}
.stagger-children > *:nth-child(5) {
  animation-delay: 0.3s;
}
.stagger-children > *:nth-child(6) {
  animation-delay: 0.36s;
}

/* ─── Chat bubble styles ────────────────────────────────────────────── */
.chat-bubble-child {
  background: #eef2ff;
  color: #312e81;
  border-radius: 1.25rem 1.25rem 0.25rem 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 85%;
  margin-left: auto;
  font-weight: 600;
}
.chat-bubble-ai {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem 1.25rem 1.25rem 0.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 85%;
}

/* ─── Chat mockup floating animation ────────────────────────────────── */
@keyframes floatSoft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.chat-mockup {
  animation: floatSoft 5s ease-in-out infinite;
}

/* ─── FAQ accordion ─────────────────────────────────────────────────── */
.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.35s ease;
  padding-top: 0;
  padding-bottom: 0;
}
.faq-item.active .faq-content {
  max-height: 400px;
  padding-bottom: 1.25rem;
}

/* ─── Nav hide/show on scroll ───────────────────────────────────────── */
#main-nav {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
#main-nav.nav-hidden {
  transform: translateY(-100%);
}
#main-nav.nav-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ─── Focus ring ────────────────────────────────────────────────────── */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* ─── Comparison card hover ─────────────────────────────────────────── */
.comparison-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.comparison-card:hover {
  transform: translateY(-4px);
}

/* ─── Badge card shimmer ────────────────────────────────────────────── */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.badge-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.badge-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.12);
}

/* ─── Pricing card hover ────────────────────────────────────────────── */
.pricing-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.pricing-card:hover {
  transform: translateY(-4px);
}

/* ─── Loading spinner ───────────────────────────────────────────────── */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: spin 0.7s linear infinite;
}
.btn-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: spin 0.7s linear infinite;
}

/* ─── Page-level top progress bar ───────────────────────────────────── */
#page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #818cf8);
  z-index: 9999;
  transition: width 0.2s ease;
  pointer-events: none;
}
#page-progress.done {
  width: 100%;
  opacity: 0;
  transition:
    width 0.3s ease,
    opacity 0.4s ease 0.3s;
}

/* ─── Responsive table scroll ───────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 600px;
}

/* ─── Chat layout: full-height on mobile ────────────────────────────── */
@media (max-width: 768px) {
  .chat-outer {
    height: calc(100dvh - 4rem);
    display: flex;
    flex-direction: column;
  }
  .chat-messages {
    flex: 1;
    overflow-y: auto;
  }
  .chat-input-bar {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem;
    z-index: 10;
  }
}
