/* FastroAI Documentation Custom Styles */

:root {
  /* FastroAI Brand Colors - Pink accent */
  --fastro-pink: #ec407a;                /* Lighter pink for titles/accents */
  --fastro-pink-light: #f48fb1;          /* Even lighter pink variant */
  --fastro-pink-dark: #c2185b;           /* Darker pink for header */

  /* Consistent colors across modes */
  --fastro-primary: #ec407a;
  --fastro-secondary: #f48fb1;
  --fastro-accent: #ec407a;
  --fastro-success: #ec407a;
  --fastro-warning: #f59e0b;
  --fastro-danger: #ef4444;

  /* Code and background colors for light mode */
  --code-bg: #f1f5f9;
  --border-color: #e2e8f0;
}

/* Pink class for icons and text */
.pink {
  color: #ec407a !important;
}

/* Keep violet as alias for backwards compatibility */
.violet {
  color: #ec407a !important;
}

/* Dark mode color overrides */
[data-md-color-scheme="slate"] {
  /* Pink accent colors in dark mode */
  --fastro-primary: #f48fb1;
  --fastro-secondary: #f8bbd9;
  --fastro-accent: #f48fb1;

  /* Dark backgrounds - lighter neutral */
  --code-bg: #2a2a2a;
  --border-color: #404040;

  /* Custom dark mode background - lighter neutral dark */
  --md-default-bg-color: #1e1e1e;
  --md-default-fg-color: #f0f0f0;
  --md-code-bg-color: #2a2a2a;
  --md-code-fg-color: #e0e0e0;

  /* Navigation colors */
  --md-nav-bg-color: #252525;
  --md-footer-bg-color: #c2185b;

  /* Text colors for better readability */
  --md-typeset-color: #f0f6fc;
  --md-typeset-a-color: #f48fb1;
}

/* Hero intro section - centered */
.hero-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-intro h1 {
  margin-bottom: 0.5rem;
}

.hero-intro p:first-of-type {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fastro-pink);
  margin-bottom: 0.5rem;
}

.hero-intro p:last-of-type {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

/* CTA section - centered */
.cta-section {
  text-align: center;
  margin: 2rem 0;
}

.cta-section p {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.cta-section small {
  display: block;
  margin-top: 1rem;
  opacity: 0.7;
}

/* Button spacing */
.md-button {
  margin: 0.25rem;
}

/* Custom copy button styling */
.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.copy-button svg {
  width: 14px;
  height: 14px;
}

/* Ensure code blocks have relative positioning for copy button */
pre {
  position: relative;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Feature cards grid */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.grid.cards .card {
  background: var(--md-default-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.grid.cards .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--fastro-pink);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.grid.cards .card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
  border-color: var(--fastro-primary);
}

.grid.cards .card:hover::before {
  opacity: 1;
}

/* Dark mode adjustments for cards */
[data-md-color-scheme="slate"] .grid.cards .card {
  background: rgba(30, 30, 30, 0.7);
  border-color: var(--border-color);
  backdrop-filter: blur(8px);
}

[data-md-color-scheme="slate"] .grid.cards .card:hover {
  background: rgba(30, 30, 30, 0.9);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Code block enhancements */
.highlight pre {
  background: var(--code-bg) !important;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  position: relative;
  overflow-x: auto;
}

.highlight .filename {
  background: var(--fastro-pink);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Roboto Mono', monospace;
}

/* Improve code block appearance in dark mode */
[data-md-color-scheme="slate"] .highlight pre {
  background: #2a2a2a !important;
  border: 1px solid #404040;
  border-radius: 0.5rem;
}

/* Custom admonitions */
.admonition.commercial {
  border-color: var(--fastro-accent);
}

.admonition.commercial .admonition-title {
  background: var(--fastro-accent);
  color: white;
}

.admonition.commercial .admonition-title::before {
  content: "💼";
  margin-right: 0.5rem;
}

/* API endpoint styling */
.api-endpoint {
  background: #f1f5f9;
  border-left: 4px solid var(--fastro-primary);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 0.375rem 0.375rem 0;
}

.api-endpoint .method {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.method.post { background: #dcfce7; color: #166534; }
.method.get { background: #dbeafe; color: #1d4ed8; }
.method.put { background: #fef3c7; color: #92400e; }
.method.delete { background: #fecaca; color: #dc2626; }

/* Feature highlight boxes */
.feature-highlight {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #0ea5e9;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.feature-highlight h3 {
  color: var(--fastro-primary);
  margin-top: 0;
}

/* Architecture diagrams */
.architecture-diagram {
  text-align: center;
  margin: 2rem 0;
}

.architecture-diagram svg {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: white;
}

/* Table enhancements */
table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  width: 100%;
}

table th {
  background: var(--fastro-primary);
  color: white;
  padding: 0.75rem;
  text-align: left;
}

table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

table tr:hover {
  background: #f8fafc;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-ready { background: #dcfce7; color: #166534; }
.status-beta { background: #fef3c7; color: #92400e; }
.status-planned { background: #f3f4f6; color: #374151; }

/* Quick start section */
.quick-start {
  background: #f8fafc;
  border: 2px solid var(--fastro-primary);
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 2rem 0;
}

.quick-start h3 {
  color: var(--fastro-primary);
  margin-top: 0;
}

/* Pricing tier cards */
.tier-card {
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.tier-card:hover {
  border-color: var(--fastro-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.tier-popular {
  border-color: var(--fastro-primary);
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  position: relative;
}

.tier-popular::before {
  content: "MOST POPULAR";
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fastro-primary);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Command line styling */
.command-line {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.375rem;
  font-family: 'Courier New', monospace;
  margin: 1rem 0;
}

.command-line .prompt {
  color: #68d391;
}

.command-line .command {
  color: #90cdf4;
}

/* Navigation enhancements */
.md-nav__item--active > .md-nav__link {
  color: var(--fastro-primary);
  font-weight: 600;
}

.md-nav__link:hover {
  color: var(--fastro-accent);
}

/* Button enhancements */
.md-button {
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  letter-spacing: 0.025em;
  position: relative;
  overflow: hidden;
}

.md-button--primary {
  background: var(--fastro-pink);
  border: none;
  color: white;
  box-shadow: 0 2px 8px rgba(236, 64, 122, 0.3);
}

.md-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(236, 64, 122, 0.4);
  background: var(--fastro-pink-dark);
}

/* Secondary button style */
.md-button:not(.md-button--primary) {
  border: 2px solid var(--fastro-primary);
  color: var(--fastro-primary);
  background: transparent;
}

.md-button:not(.md-button--primary):hover {
  background: var(--fastro-primary);
  color: white;
  transform: translateY(-1px);
}

/* Smooth scrolling and animations */
html {
  scroll-behavior: smooth;
}

/* Fade-in animation for content */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-target {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Logo styling - Invert colors for white appearance on purple header */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 2rem;
  width: auto;
  filter: brightness(0) saturate(100%) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Keep favicon normal colors */
link[rel="icon"] {
  filter: none;
}

/* Footer improvements - match header pink */
.md-footer {
  background: #c2185b;
}

/* Status indicators */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-ready {
  background: rgba(236, 64, 122, 0.1);
  color: #ec407a;
  border: 1px solid rgba(236, 64, 122, 0.2);
}

.status-beta { 
  background: rgba(245, 158, 11, 0.1); 
  color: #d97706; 
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-planned { 
  background: rgba(107, 114, 128, 0.1); 
  color: #6b7280; 
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Improved table styling */
.md-typeset table:not([class]) {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--md-default-bg-color);
}

.md-typeset table:not([class]) th {
  background: var(--fastro-pink);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-size: 0.875rem;
}

/* Responsive design improvements */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .grid.cards {
    grid-template-columns: 1fr;
  }
  
  .md-button {
    width: 100%;
    text-align: center;
  }
}

/* Focus states for accessibility */
.md-button:focus {
  outline: 2px solid var(--fastro-accent);
  outline-offset: 2px;
}

.grid.cards .card:focus-within {
  outline: 2px solid var(--fastro-accent);
  outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--fastro-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fastro-secondary);
}

/* Darker pink header for better readability */
.md-header {
  background: #c2185b !important;
}

.md-tabs {
  background: #ad1457 !important;
}

/* Dark mode header and nav styling */
[data-md-color-scheme="slate"] .md-header {
  background: #c2185b !important;
}

[data-md-color-scheme="slate"] .md-tabs {
  background: #ad1457 !important;
}

[data-md-color-scheme="slate"] .md-nav--primary .md-nav__title {
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(8px);
}

/* Glassmorphism effects for cards in dark mode */
[data-md-color-scheme="slate"] .grid.cards .card {
  background: rgba(30, 30, 30, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(236, 64, 122, 0.2);
}

[data-md-color-scheme="slate"] .grid.cards .card:hover {
  background: rgba(30, 30, 30, 0.9);
  border-color: var(--fastro-pink);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(236, 64, 122, 0.15);
}

/* Enhance code blocks with landing page styling */
[data-md-color-scheme="slate"] .highlight pre {
  background: #2a2a2a !important;
  border: 1px solid #404040;
  border-radius: 0.5rem;
}

/* Pattern background like landing page */
[data-md-color-scheme="slate"] .md-content__inner::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ec407a' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

/* Enhanced hover effects for navigation */
[data-md-color-scheme="slate"] .md-nav__link:hover {
  color: var(--fastro-pink);
  transition: color 0.3s ease;
}

[data-md-color-scheme="slate"] .md-tabs__link:hover {
  color: var(--fastro-pink);
  transition: color 0.3s ease;
}

/* Dark mode footer - match header pink */
[data-md-color-scheme="slate"] .md-footer {
  background: #c2185b;
}

/* Enhanced search styling */
[data-md-color-scheme="slate"] .md-search__form {
  background: rgba(35, 35, 35, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(236, 64, 122, 0.2);
  border-radius: 0.5rem;
}

[data-md-color-scheme="slate"] .md-search__input {
  background: transparent;
  color: #e5e7eb;
}

[data-md-color-scheme="slate"] .md-search__input::placeholder {
  color: rgba(229, 231, 235, 0.6);
}

/* Green titles and icons - apply to all themes */
.md-typeset h2:has(.twemoji), 
.md-typeset h3:has(.twemoji), 
.md-typeset h4:has(.twemoji) {
  color: var(--fastro-pink) !important;
}

/* Force icons to be pink - apply to all themes */
.md-typeset h2 .twemoji, 
.md-typeset h3 .twemoji, 
.md-typeset h4 .twemoji {
  color: var(--fastro-pink) !important;
  filter: none !important;
}

/* Icons in grid cards */
.grid.cards .twemoji {
  color: var(--fastro-pink) !important;
  filter: none !important;
}

/* Alternative approach for browsers that don't support :has() */
h2[id*="material-"], h3[id*="material-"], h4[id*="material-"] {
  color: var(--fastro-pink) !important;
}

/* Ensure green for specific title classes */
.md-typeset h2 svg,
.md-typeset h3 svg,
.md-typeset h4 svg {
  fill: var(--fastro-pink) !important;
}

/* Target Material Design icons specifically */
.md-typeset h2 img[alt*="material-"],
.md-typeset h3 img[alt*="material-"],
.md-typeset h4 img[alt*="material-"] {
  filter: hue-rotate(290deg) saturate(2) brightness(1.1) !important;
}

/* More specific targeting for emoji/icon elements */
.md-typeset h2 .twemoji[alt*="material-"],
.md-typeset h3 .twemoji[alt*="material-"],
.md-typeset h4 .twemoji[alt*="material-"] {
  filter: hue-rotate(290deg) saturate(2) brightness(1.1) !important;
}

/* Green text for headings containing icons */
.md-typeset h2[id*="material"],
.md-typeset h3[id*="material"],
.md-typeset h4[id*="material"] {
  color: var(--fastro-pink) !important;
}

/* Make ALL headings in Learn section green */
article[data-md-component="main"] h2,
article[data-md-component="main"] h3,
article[data-md-component="main"] h4 {
  color: var(--fastro-pink) !important;
}

/* Alternative selector for all headings */
.md-content h2,
.md-content h3,
.md-content h4 {
  color: var(--fastro-pink) !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .grid.cards {
    grid-template-columns: 1fr;
  }
}