/* ===== CSS Custom Properties ===== */
:root {
  --primary: #1a5fb4;
  --primary-dark: #134a8e;
  --primary-light: #4a8add;
  --accent: #3584e4;
  --accent-dark: #2a6dbd;
  --bg-warm: #fafafa;
  --text-dark: #1a1a2e;
  --text-muted: #6b7280;
}

/* ===== Tailwind Config Override ===== */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* ===== Font Families ===== */
.font-display {
  font-family: 'Archivo Black', sans-serif;
}
.font-body {
  font-family: 'Nunito Sans', sans-serif;
}
body {
  font-family: 'Nunito Sans', sans-serif;
}

/* ===== Color Utilities ===== */
.bg-primary { background-color: var(--primary); }
.bg-primary-dark { background-color: var(--primary-dark); }
.bg-accent { background-color: var(--accent); }
.bg-accent-dark { background-color: var(--accent-dark); }
.text-primary { color: var(--primary); }
.text-primary-dark { color: var(--primary-dark); }
.text-accent { color: var(--accent); }
.hover\:bg-primary:hover { background-color: var(--primary); }
.hover\:bg-primary-dark:hover { background-color: var(--primary-dark); }
.hover\:bg-accent:hover { background-color: var(--accent); }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:text-accent:hover { color: var(--accent); }
.border-primary { border-color: var(--primary); }
.focus\:border-primary:focus { border-color: var(--primary); }
.focus\:ring-primary\/30:focus { --tw-ring-color: rgba(26, 95, 180, 0.3); }
.shadow-primary\/20 { --tw-shadow-color: rgba(26, 95, 180, 0.2); }
.shadow-primary\/40 { --tw-shadow-color: rgba(26, 95, 180, 0.4); }
.shadow-accent\/30 { --tw-shadow-color: rgba(53, 132, 228, 0.3); }
.bg-primary\/10 { background-color: rgba(26, 95, 180, 0.1); }
.bg-primary\/15 { background-color: rgba(26, 95, 180, 0.15); }
.bg-accent\/10 { background-color: rgba(53, 132, 228, 0.1); }

/* ===== Hero Gradient ===== */
.hero-gradient {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(53, 132, 228, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(26, 95, 180, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(74, 138, 221, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #0f3460 100%);
}

/* ===== CTA Gradient ===== */
.cta-gradient {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(53, 132, 228, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* ===== Blob Shapes ===== */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}
.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -10%;
  left: -10%;
  animation: blobFloat 15s ease-in-out infinite;
}
.blob-2 {
  width: 400px;
  height: 400px;
  background: #4a8add;
  bottom: -5%;
  right: -5%;
  animation: blobFloat 18s ease-in-out infinite reverse;
}
.blob-3 {
  width: 300px;
  height: 300px;
  background: white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: blobFloat 12s ease-in-out infinite;
  opacity: 0.08;
}
.blob-section-1 {
  position: absolute;
  width: 600px;
  height: 600px;
  background: var(--primary);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.05;
  top: -200px;
  right: -200px;
  pointer-events: none;
}
.blob-cta-1 {
  width: 400px;
  height: 400px;
  background: white;
  top: -100px;
  left: -100px;
  opacity: 0.08;
}
.blob-cta-2 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: -50px;
  right: -50px;
  opacity: 0.1;
}
.blob-service {
  position: absolute;
  width: 200px;
  height: 200px;
  background: white;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.08;
  top: -50px;
  right: -50px;
  pointer-events: none;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== Floating Cards (Hero) ===== */
.floating-card {
  position: absolute;
  z-index: 10;
}
.card-1 {
  top: 20%;
  left: 4%;
  animation: floatCard 6s ease-in-out infinite;
}
.card-2 {
  top: 15%;
  right: 4%;
  animation: floatCard 7s ease-in-out infinite 1s;
}
.card-3 {
  bottom: 25%;
  left: 6%;
  animation: floatCard 8s ease-in-out infinite 0.5s;
}
.card-4 {
  bottom: 20%;
  right: 6%;
  animation: floatCard 6.5s ease-in-out infinite 1.5s;
}

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

/* ===== Header States ===== */
#header {
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
#header.scrolled {
  background-color: var(--primary);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
#header.scrolled .header-scrolled-text {
  color: white;
}
#header.scrolled .nav-link {
  color: rgba(255, 255, 255, 0.9);
}
#header.scrolled .nav-link:hover {
  color: white;
}

/* ===== Scroll Reveal Animation ===== */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== FAQ Accordion ===== */
.faq-item.active .faq-icon {
  transform: rotate(180deg);
}
.faq-item.active {
  border-color: var(--primary);
  background-color: rgba(26, 95, 180, 0.03);
}
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}
.faq-content.show {
  max-height: 300px;
}

/* ===== Chat Widget ===== */
.chat-pulse {
  animation: chatPulse 2.5s ease-in-out infinite;
}
@keyframes chatPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}

#chat-panel {
  animation: chatSlideUp 0.3s ease-out;
}
@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg-assistant {
  background-color: #f3f4f6;
  color: #1f2937;
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0.75rem 1rem;
  max-width: 85%;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg-assistant a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}
.chat-msg-user {
  background-color: var(--primary);
  color: white;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.75rem 1rem;
  max-width: 85%;
  margin-left: auto;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: #f3f4f6;
  border-radius: 1rem;
  width: fit-content;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

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

/* ===== Selection ===== */
::selection {
  background-color: var(--primary);
  color: white;
}

/* ===== Scrollbar ===== */
#chat-messages::-webkit-scrollbar {
  width: 4px;
}
#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

/* ===== Lightbox ===== */
#lightbox.active {
  display: flex;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
  .floating-card {
    display: none;
  }
  #chat-panel {
    width: calc(100vw - 2rem);
    right: -0.5rem;
  }
}
