/* Intercom Knowledge Base Landing Page - Comprehensive CSS */

/* CSS Custom Properties for Knowledge Base Design */
:root {
  /* Colors - Professional Knowledge Base Palette */
  --primary-color: #1f73b7;
  --primary-dark: #1a5f99;
  --primary-light: #4a90d9;
  --secondary-color: #39b54a;
  --accent-color: #ff6b35;
  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-light: #8492a6;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-tertiary: #e2e8f0;
  --border-color: #cbd5e0;
  --success-color: #48bb78;
  --warning-color: #ed8936;
  --error-color: #f56565;
  --info-color: #4299e1;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-primary);
  overflow-x: hidden;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
}

h4 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
}

h5 {
  font-size: 1.125rem;
  font-weight: 600;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Container System */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Header & Navigation */
.header {
  background: var(--background-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  align-items: center;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width var(--transition-fast);
}

.nav-link:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  color: white;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero .lead {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Bar */
.search-container {
  background: white;
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border-color);
}

.search-bar {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  font-size: 1.125rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  background: var(--background-secondary);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: var(--shadow-md);
}

.search-button {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-button:hover {
  background: var(--primary-dark);
}

/* Knowledge Base Categories */
.categories {
  padding: var(--space-3xl) 0;
  background: var(--background-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-subtitle {
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
}

.category-card {
  background: white;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

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

.category-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  font-size: 1.5rem;
  color: white;
}

.category-card h3 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.category-card p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.category-count {
  background: var(--background-tertiary);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
}

/* FAQ Section */
.faq {
  padding: var(--space-3xl) 0;
  background: white;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--primary-color);
}

.faq-question {
  background: var(--background-secondary);
  padding: var(--space-lg) var(--space-xl);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background: var(--background-tertiary);
}

.faq-toggle {
  font-size: 1.25rem;
  color: var(--primary-color);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-toggle {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 var(--space-xl);
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.faq-item.active .faq-answer {
  padding: var(--space-lg) var(--space-xl);
  max-height: 500px;
}

.faq-answer p {
  margin-bottom: var(--space-md);
}

.faq-answer:last-child {
  margin-bottom: 0;
}

/* Documentation Section */
.documentation {
  padding: var(--space-3xl) 0;
  background: var(--background-secondary);
}

.doc-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.doc-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: var(--space-lg) var(--space-xl);
}

.doc-header h4 {
  color: white;
  margin-bottom: var(--space-sm);
}

.doc-header p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  font-size: 0.875rem;
}

.doc-content {
  padding: var(--space-xl);
}

.doc-list {
  list-style: none;
}

.doc-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--background-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.doc-list li:last-child {
  border-bottom: none;
}

.doc-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  flex: 1;
}

.doc-list a:hover {
  color: var(--primary-color);
}

.doc-icon {
  color: var(--primary-color);
  font-size: 1.125rem;
}

/* Code Blocks */
.code-block {
  background: var(--text-primary);
  color: #e2e8f0;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.code-block .comment {
  color: #a0aec0;
}

.code-block .keyword {
  color: #63b3ed;
}

.code-block .string {
  color: #68d391;
}

/* Alert Boxes */
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin: var(--space-md) 0;
  border-left: 4px solid;
}

.alert-info {
  background: #ebf8ff;
  border-color: var(--info-color);
  color: #2a69ac;
}

.alert-success {
  background: #f0fff4;
  border-color: var(--success-color);
  color: #276749;
}

.alert-warning {
  background: #fffbeb;
  border-color: var(--warning-color);
  color: #975a16;
}

.alert-error {
  background: #fed7d7;
  border-color: var(--error-color);
  color: #c53030;
}

/* Intercom Integration */
.intercom-section {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, var(--secondary-color), #2d8f3f);
  color: white;
  text-align: center;
}

.intercom-section h2 {
  color: white;
  margin-bottom: var(--space-md);
}

.intercom-section p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.intercom-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.intercom-feature {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.intercom-feature h4 {
  color: white;
  margin-bottom: var(--space-sm);
}

.intercom-feature p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  font-size: 0.875rem;
}

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: var(--space-3xl) 0 var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h4 {
  color: white;
  margin-bottom: var(--space-md);
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--primary-light);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

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

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .search-input {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
  }
  
  .search-button {
    padding: var(--space-sm) var(--space-md);
  }
  
  .category-card,
  .doc-card {
    padding: var(--space-lg);
  }
}

@media (max-width: 480px) {
  :root {
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .hero {
    padding: var(--space-2xl) 0;
  }
}

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

/* Focus styles for accessibility */
.search-input:focus,
.nav-link:focus,
.category-card:focus,
.faq-question:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #000000;
  }
}

/* Print styles */
@media print {
  .header,
  .footer,
  .search-container,
  .intercom-section {
    display: none;
  }
  
  .faq-answer {
    max-height: none !important;
    padding: var(--space-md) 0 !important;
  }
  
  .category-card,
  .doc-card {
    break-inside: avoid;
  }
}
