/* Anthropic-inspired Design System CSS */

/* Dark Mode Variables */
:root {
  /* Light mode (default) */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F2ED;
  --bg-tertiary: #E8E4DD;
  --bg-card: #FFFFFF;
  --text-primary: #102E4A;
  --text-secondary: #666666;
  --text-tertiary: #1A1A1A;
  --text-muted: rgba(102, 102, 102, 0.7);
  --border-color: rgba(16, 46, 74, 0.1);
  --border-hover: rgba(245, 158, 11, 0.5);
  --scrollbar-track: #F5F2ED;
  --scrollbar-thumb: #D4CFC5;
  --nav-bg: rgba(245, 242, 237, 0.95);
  --input-bg: #FFFFFF;
  --input-border: #e5e7eb;
}

html.dark {
  /* Dark mode */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #e2e8f0;
  --text-muted: rgba(203, 213, 225, 0.7);
  --border-color: rgba(71, 85, 105, 0.3);
  --border-hover: rgba(245, 158, 11, 0.7);
  --scrollbar-track: #1e293b;
  --scrollbar-thumb: #475569;
  --nav-bg: rgba(15, 23, 42, 0.95);
  --input-bg: #334155;
  --input-border: #475569;
}

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

/* Example Query Buttons - Override defaults */
button[data-action*="standalone-ai-chat#useExample"],
button[data-action*="ai-chat#useExampleFromWelcome"] {
  background-color: #E8E4DD !important;
  color: #1A1A1A !important;
  border-color: #D4CFC5 !important;
}

button[data-action*="standalone-ai-chat#useExample"]:hover,
button[data-action*="ai-chat#useExampleFromWelcome"]:hover {
  background-color: #F5F2ED !important;
  border-color: #f59e0b !important;
}

button[data-action*="standalone-ai-chat#useExample"]:hover span,
button[data-action*="ai-chat#useExampleFromWelcome"]:hover {
  color: #f59e0b !important;
}

/* AI Research Send Button */
button[type="submit"] svg {
  color: #666666 !important;
  stroke: #666666 !important;
}

/* AI Research dropdown menu text */
button[data-action*="ai-chat#selectAgent"] span {
  color: #1A1A1A !important;
}

button[data-action*="ai-chat#selectAgent"] p {
  color: #666666 !important;
}

/* Base Typography & Body */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Fix: Ensure white text works on dark backgrounds (overrides body color) */
.bg-ink,
.bg-ink\/90,
.bg-navy,
.bg-primary-dark,
[class*="bg-ink"] {
  color: #FFFFFF;
}

.text-white {
  color: #FFFFFF !important;
}

/* Pricing button hover state - ensures white text on dark background */
.pricing-btn-outline:hover {
  background-color: #111827 !important; /* gray-900 */
  color: #FFFFFF !important;
  border-color: #111827 !important;
}

/* Heading Styles with Serif Font */
/* Exclude markdown content from these global styles */
h1:not(.markdown-content h1):not(.markdown-content *),
h2:not(.markdown-content h2):not(.markdown-content *),
h3:not(.markdown-content h3):not(.markdown-content *),
h4:not(.markdown-content h4):not(.markdown-content *),
h5:not(.markdown-content h5):not(.markdown-content *),
h6:not(.markdown-content h6):not(.markdown-content *) {
  font-family: 'GFS Didot', 'Libre Baskerville', Georgia, serif;
  font-weight: 700;
  color: #102E4A;
}

h1:not(.markdown-content h1):not(.markdown-content *) {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.1;
  font-weight: 900;
}

h2:not(.markdown-content h2):not(.markdown-content *) {
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1.2;
  font-weight: 700;
}

h3:not(.markdown-content h3):not(.markdown-content *) {
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.3;
  font-weight: 600;
}

/* Underline decoration for emphasis */
.underline-decoration {
  text-decoration: underline;
  text-decoration-color: #f59e0b;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

/* Link Styles - exclude navigation links to allow Tailwind classes to work */
a:not(header a):not(nav a):not(header nav a) {
  color: #1A1A1A;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:not(header a):not(nav a):not(header nav a):hover {
  text-decoration: underline;
  text-decoration-color: #f59e0b;
  text-underline-offset: 4px;
}

/* CTA Button Styles */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background-color: #5c946e;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-cta:hover {
  background-color: #4a7858;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(92, 148, 110, 0.3);
  text-decoration: none;
}

.btn-cta:active {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background-color: transparent;
  color: #102E4A;
  border: 2px solid #102E4A;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #102E4A;
  color: #ffffff;
  text-decoration: none;
}

/* Card Styles */
.card {
  background-color: var(--bg-primary);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html.dark .card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Content Container */
.container-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container-content {
    padding: 0 20px;
  }
}

/* Section Spacing */
.section-spacing {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section-spacing {
    padding: 40px 0;
  }
}

/* Dropdown Menu Animation */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Arrow Icon for Links */
.arrow-link::after {
  content: "→";
  margin-left: 8px;
  transition: margin-left 0.3s ease;
}

.arrow-link:hover::after {
  margin-left: 12px;
}

/* Grid Layout */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid #f59e0b;
  outline-offset: 4px;
}

button:focus,
a:focus {
  outline: 2px solid #f59e0b;
  outline-offset: 4px;
}

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

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Navigation Transition */
.nav-transition {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-scrolled {
  background-color: rgba(245, 242, 237, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Illustration Accent Color */
.illustration-accent {
  color: #f59e0b;
}

/* Text Balance for Headings */
h1, h2, h3 {
  text-wrap: balance;
}

/* Smooth Image Loading */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* Home Page Components - Using Tailwind @apply and theme() */
@layer components {
  /* Hero Section Enhancements */
  .hero-section {
    @apply relative overflow-hidden;
  }

  .hero-underline-thick {
    text-decoration: underline;
    text-decoration-color: #f59e0b;
    text-decoration-thickness: 4px;
    text-underline-offset: 8px;
  }

  /* Stats Section */
  .stats-section {
    @apply py-16 border-y transition-all duration-300;
    background: linear-gradient(to bottom, #E8E4DD, #F5F2ED);
    border-color: #D4CFC5;
  }

  .stat-card {
    @apply transition-all duration-300 cursor-pointer;
  }

  .stat-card:hover {
    @apply scale-110;
    filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.2));
  }

  .stat-number {
    @apply font-serif text-4xl font-bold mb-2 transition-all duration-300;
    color: #f59e0b;
  }

  .stat-card:hover .stat-number {
    @apply scale-110;
  }

  /* CTA Section Enhancements */
  .cta-section {
    @apply relative overflow-hidden;
  }

  .cta-gradient-bg {
    @apply absolute inset-0 -z-10;
    background: linear-gradient(to bottom right,
      rgb(245 158 11 / 0.05),
      rgb(245 242 237 / 1),
      rgb(245 158 11 / 0.1));
  }

  .cta-decorative-blob {
    @apply absolute rounded-full blur-3xl -z-10;
    background-color: rgb(245 158 11 / 0.05);
  }

  .cta-decorative-blob-top {
    @apply cta-decorative-blob top-0 right-0;
    width: 24rem;
    height: 24rem;
  }

  .cta-decorative-blob-bottom {
    @apply cta-decorative-blob bottom-0 left-0;
    width: 24rem;
    height: 24rem;
  }

  /* Feature Highlight Cards */
  .feature-highlight-card {
    @apply p-6 rounded-xl border transition-all duration-300;
    background-color: rgb(255 255 255 / 0.5);
    backdrop-filter: blur(4px);
    border-color: rgb(212 207 197 / 0.3);
  }

  .feature-highlight-card:hover {
    @apply bg-white shadow-lg scale-105;
    border-color: rgb(245 158 11 / 0.5);
  }

  .feature-highlight-icon {
    @apply flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center font-bold text-lg transition-all duration-300;
    background-color: rgb(245 158 11 / 0.1);
    color: #f59e0b;
  }

  .feature-highlight-card:hover .feature-highlight-icon {
    @apply bg-amber-500 text-white;
  }

  /* Trust Indicator Cards */
  .trust-indicator-card {
    @apply h-20 rounded-2xl flex items-center justify-center transition-all duration-300 border;
    background-color: rgb(255 255 255 / 0.6);
    backdrop-filter: blur(4px);
    border-color: rgb(212 207 197 / 0.3);
  }

  .trust-indicator-card:hover {
    @apply bg-white shadow-lg scale-105;
  }

  .trust-indicator-text {
    @apply text-sm font-semibold text-ink-light transition-colors duration-300;
  }

  .trust-indicator-card:hover .trust-indicator-text {
    @apply text-amber-500;
  }

  /* How It Works Section */
  .how-it-works-gradient-bg {
    @apply bg-gradient-to-b from-cream to-white;
  }

  .how-it-works-badge {
    @apply inline-block px-4 py-2 rounded-full mb-6;
    background-color: rgb(245 158 11 / 0.1);
  }

  .how-it-works-badge-text {
    @apply text-sm font-semibold uppercase tracking-wider;
    color: #f59e0b;
  }

  /* Step Card Components */
  .step-card-wrapper {
    @apply relative;
  }

  .step-card-glow {
    @apply absolute inset-0 rounded-2xl blur-sm opacity-0 transition-opacity duration-300;
    background: linear-gradient(to bottom right,
      rgb(245 158 11 / 0.05),
      rgb(245 158 11 / 0.1));
  }

  .step-card-wrapper:hover .step-card-glow {
    @apply opacity-100;
  }

  .step-card-main {
    @apply relative rounded-2xl shadow-lg p-8 border transition-all duration-300;
    background-color: #E8E4DD;
    border-color: rgb(212 207 197 / 0.3);
  }

  .step-card-wrapper:hover .step-card-main {
    @apply shadow-2xl scale-105;
    border-color: rgb(245 158 11 / 0.5);
  }

  .step-card-number {
    @apply absolute left-1/2 w-16 h-16 rounded-full flex items-center justify-center font-serif text-2xl font-bold text-white shadow-xl z-10 transition-transform duration-300;
    top: -1.5rem;
    transform: translateX(-50%);
    background: linear-gradient(to bottom right, #f59e0b, rgb(245 158 11 / 0.8));
  }

  .step-card-wrapper:hover .step-card-number {
    @apply scale-110;
  }

  .step-card-icon {
    @apply text-5xl mb-6 mt-6 text-center transition-transform duration-300;
  }

  .step-card-wrapper:hover .step-card-icon {
    @apply scale-110;
  }

  .step-card-title {
    @apply text-center mb-4 transition-colors duration-300;
  }

  .step-card-wrapper:hover .step-card-title {
    color: #f59e0b;
  }

  .step-card-description {
    @apply text-base text-ink-light leading-relaxed text-center;
  }

  .step-card-divider {
    @apply mt-6 pt-6 border-t;
    border-color: rgb(212 207 197 / 0.2);
  }

  .step-card-decoration {
    @apply flex justify-center;
  }

  .step-card-decoration-line {
    @apply h-1 rounded-full transition-all duration-300;
    width: 3rem;
    background: linear-gradient(to right,
      transparent,
      rgb(245 158 11 / 0.4),
      transparent);
  }

  .step-card-wrapper:hover .step-card-decoration-line {
    width: 6rem;
    background: linear-gradient(to right,
      transparent,
      rgb(245 158 11 / 1),
      transparent);
  }

  /* Mobile Connecting Arrows */
  .mobile-connector {
    @apply flex justify-center py-2;
  }

  .mobile-connector-arrow {
    @apply text-2xl;
    color: #f59e0b;
  }

  /* Desktop Connecting Line */
  .steps-connecting-line {
    @apply absolute left-0 right-0 -z-10;
    top: 5rem;
    height: 2px;
    background: linear-gradient(to right,
      rgb(245 158 11 / 0.3),
      rgb(245 158 11 / 0.7),
      rgb(245 158 11 / 0.3));
    box-shadow: 0 0 8px rgba(120, 140, 93, 0.3);
  }

  .steps-connecting-line::after {
    content: '';
    @apply absolute inset-0;
    background: linear-gradient(to right,
      transparent,
      rgb(245 158 11 / 0.8),
      transparent);
    animation: shimmer 3s ease-in-out infinite;
  }

  @keyframes shimmer {
    0%, 100% {
      opacity: 0.3;
      transform: translateX(-100%);
    }
    50% {
      opacity: 1;
      transform: translateX(100%);
    }
  }

  /* Enhanced Feature Cards */
  .feature-card {
    @apply transition-all duration-300;
  }

  .feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  }
}

/* Global Dark Mode Styles */
html.dark {
  /* Cards and containers */
  .bg-white {
    background-color: var(--bg-card) !important;
  }

  .bg-cream,
  .bg-gray-50 {
    background-color: var(--bg-primary) !important;
  }

  .bg-gray-100,
  .bg-taupe\/10,
  .bg-sky\/30 {
    background-color: var(--bg-secondary) !important;
  }

  /* Text colors */
  .text-navy,
  .text-ink,
  .text-gray-900 {
    color: var(--text-primary) !important;
  }

  .text-gray-700,
  .text-ink-light {
    color: var(--text-secondary) !important;
  }

  .text-gray-600,
  .text-gray-500 {
    color: var(--text-muted) !important;
  }

  /* Borders */
  .border-gray-200,
  .border-taupe\/30,
  .border-primary-dark\/10 {
    border-color: var(--border-color) !important;
  }

  /* Input fields */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  textarea,
  select {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
  }

  input::placeholder,
  textarea::placeholder {
    color: var(--text-muted) !important;
  }

  /* Buttons */
  .btn-secondary,
  button:not(.bg-sage):not(.bg-amber-500):not(.bg-green-600):not(.bg-red-600):not([class*="bg-"]) {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
  }

  /* Hover states */
  .hover\:bg-sky\/30:hover,
  .hover\:bg-taupe\/10:hover {
    background-color: var(--bg-tertiary) !important;
  }

  /* Links */
  a:not([class*="bg-"]):not(nav a):not(header a) {
    color: var(--text-secondary);
  }

  a:hover:not(nav a):not(header a) {
    color: var(--text-primary);
  }

  /* Navigation links - ensure Tailwind classes work properly */
  header nav a {
    /* Let Tailwind dark: classes work - don't override */
  }

  /* Headings in dark mode - ensure visibility */
  h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
  }

  /* Paragraphs */
  p {
    color: var(--text-secondary);
  }

  /* Specific component overrides */
  .card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
  }

  /* Dropdown menus */
  [role="menu"],
  .dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
  }

  /* Tables */
  table {
    color: var(--text-primary);
  }

  th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
  }

  td {
    border-color: var(--border-color);
  }

  /* Code blocks */
  code, pre {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
  }

  /* Badges and pills */
  .badge,
  .pill,
  [class*="rounded-full"][class*="px-"] {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
  }

  /* Ensure green/red badges stay visible */
  .bg-green-50,
  .bg-green-100 {
    background-color: rgba(34, 197, 94, 0.2) !important;
  }

  .bg-red-50,
  .bg-red-100 {
    background-color: rgba(239, 68, 68, 0.2) !important;
  }

  .text-green-600,
  .text-green-700,
  .text-green-800 {
    color: #4ade80 !important;
  }

  .text-red-600,
  .text-red-700,
  .text-red-800 {
    color: #f87171 !important;
  }
}
