@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* CSS Variables */
:root {
  --background: 220 20% 4%;
  --foreground: 210 40% 98%;
  --card: 220 20% 7%;
  --card-foreground: 210 40% 98%;
  --popover: 220 20% 7%;
  --popover-foreground: 210 40% 98%;
  --primary: 220 90% 56%;
  --primary-foreground: 220 20% 98%;
  --secondary: 230 20% 12%;
  --secondary-foreground: 210 40% 98%;
  --muted: 230 15% 15%;
  --muted-foreground: 220 15% 55%;
  --accent: 250 85% 65%;
  --accent-foreground: 220 20% 98%;
  --destructive: 0 84% 60%;
  --border: 230 15% 18%;
  --input: 230 15% 18%;
  --ring: 220 90% 56%;
  --radius: 0.75rem;
  --glow: 220 90% 56%;
  --glow-secondary: 250 85% 65%;
  --code-bg: 230 25% 8%;
  --code-border: 230 15% 15%;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Typography */
.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.font-display {
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* Container */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container { padding: 0 2rem; }
}

/* Grid Background */
.bg-grid {
  background-image: 
    linear-gradient(hsl(var(--border) / 0.3) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.3) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Glow Effects */
.glow {
  box-shadow: 0 0 20px hsl(var(--glow) / 0.3),
              0 0 40px hsl(var(--glow) / 0.2),
              0 0 60px hsl(var(--glow) / 0.1);
}

.glow-text {
  text-shadow: 0 0 20px hsl(var(--glow) / 0.5),
               0 0 40px hsl(var(--glow) / 0.3);
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(to right, hsl(var(--primary)), hsl(var(--glow-secondary)), hsl(var(--primary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background-color: hsl(var(--secondary));
  border-color: hsl(var(--primary) / 0.5);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background-color: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: hsl(var(--primary-foreground));
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-text span {
  color: hsl(var(--primary));
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

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

.nav-link svg {
  width: 1rem;
  height: 1rem;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: 8rem;
  padding-bottom: 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.5;
}

.hero-glow-1 {
  position: absolute;
  top: 25%;
  left: 25%;
  width: 24rem;
  height: 24rem;
  background-color: hsl(var(--primary) / 0.1);
  border-radius: 50%;
  filter: blur(100px);
  animation: pulse-glow 3s ease-in-out infinite;
}

.hero-glow-2 {
  position: absolute;
  bottom: 25%;
  right: 25%;
  width: 18rem;
  height: 18rem;
  background-color: hsl(var(--glow-secondary) / 0.1);
  border-radius: 50%;
  filter: blur(80px);
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.hero-badge svg {
  width: 1rem;
  height: 1rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero h1 { font-size: 3.75rem; }
}

@media (min-width: 1024px) {
  .hero h1 { font-size: 4.5rem; }
}

.hero-description {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 32rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}

.hero-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: hsl(var(--primary));
}

.hero-stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.hero-code {
  animation: float 6s ease-in-out infinite;
}

/* Code Block */
.code-block {
  background-color: hsl(var(--code-bg));
  border: 1px solid hsl(var(--code-border));
  border-radius: var(--radius);
  overflow: hidden;
}

.code-block-header {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid hsl(var(--code-border));
  background-color: hsl(var(--secondary) / 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-block-dots {
  display: flex;
  gap: 0.375rem;
}

.code-block-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.code-block-dot-red { background-color: hsl(var(--destructive) / 0.6); }
.code-block-dot-yellow { background-color: hsl(var(--accent) / 0.8); }
.code-block-dot-green { background-color: hsl(var(--primary) / 0.6); }

.code-block-filename {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-family: 'JetBrains Mono', monospace;
  margin-left: 0.5rem;
}

.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  color: hsl(var(--foreground) / 0.9);
  line-height: 1.75;
  white-space: pre;
}

/* Features Section */
.features {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .section-header h2 { font-size: 3rem; }
}

.section-header h2 span {
  color: hsl(var(--primary));
}

.section-header p {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  max-width: 42rem;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

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

.feature-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: all 0.3s ease;
  animation: fade-in 0.6s ease-out backwards;
}

.feature-card:nth-child(1) { animation-delay: 0ms; }
.feature-card:nth-child(2) { animation-delay: 100ms; }
.feature-card:nth-child(3) { animation-delay: 200ms; }
.feature-card:nth-child(4) { animation-delay: 300ms; }
.feature-card:nth-child(5) { animation-delay: 400ms; }
.feature-card:nth-child(6) { animation-delay: 500ms; }

.feature-card:hover {
  border-color: hsl(var(--primary) / 0.5);
  box-shadow: 0 10px 40px hsl(var(--primary) / 0.05);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  background: linear-gradient(to bottom right, hsl(var(--primary) / 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  position: relative;
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background-color: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
}

.feature-card:hover .feature-icon {
  background-color: hsl(var(--primary) / 0.2);
}

.feature-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: hsl(var(--primary));
}

.feature-card h3 {
  position: relative;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  position: relative;
  color: hsl(var(--muted-foreground));
  line-height: 1.75;
}

/* Examples Section */
.examples {
  padding: 6rem 0;
  background-color: hsl(var(--secondary) / 0.3);
}

.examples-content {
  max-width: 56rem;
  margin: 0 auto;
}

.example-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.example-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.2s ease;
}

.example-tab:hover {
  border-color: hsl(var(--primary) / 0.5);
  color: hsl(var(--foreground));
}

.example-tab.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.example-code {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Footer */
.footer {
  border-top: 1px solid hsl(var(--border));
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

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

.footer-copyright {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px hsl(var(--glow) / 0.3);
  }
  50% {
    box-shadow: 0 0 40px hsl(var(--glow) / 0.5),
                0 0 60px hsl(var(--glow) / 0.3);
  }
}

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

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ===================
   DOCS PAGE STYLES
   =================== */

.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 4rem;
}

/* Sidebar */
.docs-sidebar {
  position: fixed;
  left: 0;
  top: 4rem;
  bottom: 0;
  width: 16rem;
  background-color: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  overflow-y: auto;
  padding: 1.5rem;
  display: none;
}

@media (min-width: 1024px) {
  .docs-sidebar {
    display: block;
  }
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-link:hover {
  background-color: hsl(var(--secondary));
  color: hsl(var(--foreground));
}

.sidebar-link.active {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

/* Docs Content */
.docs-content {
  flex: 1;
  padding: 2rem;
  max-width: 48rem;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .docs-content {
    margin-left: 16rem;
  }
}

.docs-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.docs-content h1 span {
  color: hsl(var(--primary));
}

.docs-intro {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  line-height: 1.75;
}

.docs-section {
  margin-bottom: 3rem;
  display: none;
}

.docs-section.active {
  display: block;
}

.docs-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.docs-section p {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
  line-height: 1.75;
}

.docs-section .code-block {
  margin-bottom: 1rem;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 20px hsl(var(--primary) / 0.4);
}

@media (max-width: 1023px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.mobile-menu-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile Sidebar Overlay */
.docs-sidebar.mobile-open {
  display: block;
  z-index: 90;
}

@media (max-width: 1023px) {
  .docs-sidebar.mobile-open {
    position: fixed;
    left: 0;
    top: 4rem;
    bottom: 0;
    width: 100%;
    max-width: 20rem;
    background-color: hsl(var(--card));
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
