/* Custom CSS for Aitana Labs Documentation */
/* Inspired by the React app's design system */

:root {
  /* Base colors */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(222.2, 84%, 4.9%);
  --primary: hsl(20, 100%, 70%); /* Orange highlight color */
  --primary-foreground: hsl(210, 40%, 98%);
  --secondary: hsl(210, 40%, 96.1%);
  --muted: hsl(210, 40%, 96.1%);
  --muted-foreground: hsl(215.4, 16.3%, 46.9%);
  --border: hsl(214.3, 31.8%, 91.4%);
  --radius: 0.5rem;
  
  /* Complementary colors */
  --teal: hsl(200, 65%, 45%);
  --navy: hsl(215, 70%, 25%);
  --sand: hsl(35, 40%, 92%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Wrapper */
.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.95);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--foreground);
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
}

.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* Navigation */
.site-nav .nav-list {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.site-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
}

/* App Links */
.app-links-separator {
  color: var(--border);
  font-weight: 300;
  margin: 0 0.5rem;
}

.app-link {
  color: var(--primary) !important;
  font-weight: 600 !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none !important;
}

.app-link.production {
  background-color: var(--primary);
  color: var(--primary-foreground) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-link.production:hover {
  background-color: var(--primary);
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.app-link.test:hover,
.app-link.dev:hover {
  background-color: var(--muted);
  color: var(--primary) !important;
}

.app-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-links-label {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 400;
}

.app-links a {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem !important;
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  width: 100%;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-nav h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.sidebar-nav h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--foreground);
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  display: block;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.sidebar-nav a.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
}

/* Content */
.content {
  min-width: 0;
  max-width: 100%;
}

.content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: var(--foreground);
}

.content h2 {
  font-size: 1.875rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--foreground);
}

.content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.content p {
  margin-bottom: 1.25rem;
  color: var(--foreground);
}

.content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.content a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.content ul,
.content ol {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.content li {
  margin-bottom: 0.5rem;
}

/* Code blocks */
.content pre {
  background-color: #f8f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.content code {
  background-color: var(--muted);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.content pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.content th,
.content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.content th {
  background-color: var(--muted);
  font-weight: 600;
}

.content tr:last-child td {
  border-bottom: none;
}

/* Blockquotes */
.content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.25rem;
  margin: 1.25rem 0;
  font-style: italic;
  color: var(--muted-foreground);
}

/* Footer */
.site-footer {
  background-color: var(--muted);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
  color: var(--muted-foreground);
}

.footer-content p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

.footer-content a {
  color: var(--primary);
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--foreground);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
  }
  
  /* Simplify app links on tablet */
  .app-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .app-links-label {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Header remains horizontal on mobile */
  .header-content {
    padding: 0 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 60px; /* Reduced from default */
  }
  
  /* Show hamburger menu */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Hide navigation by default on mobile */
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  /* Show navigation when open */
  .site-nav.nav-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  /* Mobile navigation list */
  .site-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0;
  }
  
  .site-nav .nav-list li {
    width: 100%;
    text-align: center;
  }
  
  .site-nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  
  .site-nav a:last-child {
    border-bottom: none;
  }
  
  /* App links styling for mobile */
  .app-links-separator {
    display: none;
  }
  
  .app-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .app-links-label {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
  }
  
  .app-link {
    display: block !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0 !important;
  }
  
  .app-link.production {
    order: 0;
    background-color: var(--primary);
    color: var(--primary-foreground) !important;
    margin-bottom: 0 !important;
  }
  
  /* Reduce logo size on very small screens */
  .logo {
    width: 32px;
    height: 32px;
  }
  
  .site-title {
    font-size: 1.25rem;
  }
  
  .content h1 {
    font-size: 2rem;
  }
  
  .content h2 {
    font-size: 1.5rem;
  }
  
  .content h3 {
    font-size: 1.25rem;
  }
  
  .main-content {
    padding: 1rem;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}