/* RobotDomainSearch - Terminal/ASCII Aesthetic */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:root {
  --bg: #0a0a0b;
  --bg-lighter: #111113;
  --text: #fafafa;
  --text-muted: #888;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --taken: #ff4444;
  --border: #333;
}

html {
  font-size: 14px;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 84ch;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text);
}

nav a {
  color: var(--text-muted);
  margin-left: 2ch;
}

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

/* ASCII Boxes */
pre {
  font-size: 1rem;
  line-height: 1.4;
  overflow-x: auto;
}


.ascii-hero {
  padding: 2rem 0;
  text-align: center;
}

.ascii-hero pre {
  display: inline-block;
  text-align: left;
  margin: 0 auto;
}

.ascii-hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* Buttons as terminal commands */
.btn-row {
  display: flex;
  gap: 2ch;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-lighter);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover {
  background: var(--border);
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 1rem;
  font-weight: normal;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* Live Demo */
.demo-section {
  background: var(--bg-lighter);
}

.demo-form {
  display: flex;
  gap: 1ch;
  margin-bottom: 1.5rem;
}

.demo-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 1rem;
}

.demo-input:focus {
  outline: none;
  border-color: var(--accent);
}

.demo-input::placeholder {
  color: var(--text-muted);
}

/* Results - terminal style */
.demo-results {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem;
  min-height: 8rem;
}

.demo-results pre {
  margin: 0;
}

.result-available {
  color: var(--accent);
}

.result-taken {
  color: var(--taken);
}

.result-loading {
  color: var(--text-muted);
}

/* Features as ASCII */
.features-ascii pre {
  margin-bottom: 2rem;
}

/* Footer */
footer {
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

footer a {
  color: var(--text-muted);
}

footer a:hover {
  color: var(--text);
}

/* ===========================================
   MOBILE RESPONSIVE - ASCII Art Fixes
   =========================================== */

/* Prevent horizontal scrolling */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Desktop/Mobile ASCII toggles */
/* Use pre.ascii-* to match specificity of .ascii-hero pre (0,1,1) */
pre.ascii-desktop,
.ascii-desktop {
  display: block;
}

pre.ascii-mobile,
.ascii-mobile {
  display: none;
}

/* Tablet (768px) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  pre {
    font-size: 13px;
    line-height: 1.4;
  }
  
  .container {
    padding: 0 1rem;
  }
}

/* Mobile - iPhone 12/13/14 optimized (390px logical width) */
/* Using 14-16px as optimal mobile reading size */
@media (max-width: 480px) {
  html {
    font-size: 16px;  /* 40% bigger than 12px */
  }
  
  /* Switch to mobile ASCII */
  .ascii-desktop {
    display: none !important;
  }
  
  .ascii-mobile {
    display: block !important;
  }
  
  /* ASCII art sized to fit ~50 chars on iPhone (390px / 7.8px per char) */
  pre {
    font-size: 14px;  /* 40% bigger than 10px */
    line-height: 1.3;
  }
  
  /* Mobile ASCII hero - compact, one line */
  .ascii-hero pre {
    font-size: 11px;  /* Larger since we're using compact ASCII */
    line-height: 1.2;
    text-align: center;
  }
  
  .ascii-hero .tagline {
    font-size: 1rem;
    margin-top: 1rem;
  }
  
  .container {
    padding: 0 0.75rem;
  }
  
  .ascii-hero {
    padding: 1.5rem 0;
  }
  
  section {
    padding: 2rem 0;
  }
  
  /* Code tabs mobile */
  .code-tab-bar {
    flex-wrap: wrap;
  }

  .code-tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .code-panel-inner {
    padding: 0.75rem;
  }

  .code-panel-inner pre {
    font-size: 12px;
  }

  .demo-form {
    flex-direction: column;
  }
  
  .btn-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .btn-row .btn {
    width: 100%;
    text-align: center;
  }
  
  header .container {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  nav a {
    margin-left: 0;
  }
  
  nav a:first-child {
    margin-left: 0;
  }
}

/* Very small devices (360px) */
/* Small phones - iPhone SE (375px) and smaller */
@media (max-width: 375px) {
  pre {
    font-size: 12px;
    line-height: 1.25;
  }
  
  /* ASCII hero - slightly smaller for SE */
  .ascii-hero pre {
    font-size: 10px;
    line-height: 1.15;
  }
  
  .container {
    padding: 0 0.5rem;
  }
}

/* ===========================================
   Code Tabs (multi-language snippets)
   =========================================== */

.code-tabs {
  border: 1px solid var(--border);
  background: var(--bg-lighter);
}

.code-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.code-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.5rem 1.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.code-panel {
  display: none;
}

.code-panel.active {
  display: block;
}

.code-panel-inner {
  position: relative;
  padding: 1rem;
}

.code-panel-inner pre {
  margin: 0;
  background: none;
  border: none;
  overflow-x: auto;
}

.code-panel-inner code {
  background: none;
  padding: 0;
}

.code-panel-inner .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

/* Syntax highlighting */
.syn-kw { color: var(--accent); }
.syn-str { color: #ffd700; }
.syn-cmt { color: var(--text-muted); }
.syn-accent { color: var(--accent); }

/* CTA Section */
.cta-section {
  text-align: center;
}

/* Code blocks */
code {
  background: var(--bg-lighter);
  padding: 0.2em 0.4em;
  border-radius: 2px;
}

/* Docs layout */
.docs-layout {
  display: grid;
  grid-template-columns: 20ch 1fr;
  gap: 2rem;
  padding: 2rem 0;
}

.docs-nav {
  border-right: 1px solid var(--border);
  padding-right: 1rem;
}

.docs-nav a {
  display: block;
  color: var(--text-muted);
  padding: 0.25rem 0;
}

.docs-nav a:hover,
.docs-nav a.active {
  color: var(--text);
}

.docs-content {
  max-width: 60ch;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.docs-content h1 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.docs-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.docs-content p {
  margin-bottom: 1rem;
}

.docs-content pre {
  background: var(--bg-lighter);
  padding: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 1;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===========================================
   Phase 2: Table Responsiveness
   =========================================== */

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

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

.docs-content th {
  background: var(--bg-lighter);
  color: var(--text);
  font-weight: 600;
}

.docs-content td {
  color: var(--text-muted);
}

/* Table scroll wrapper - applied via JS to wrap tables */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  position: relative;
}

.table-scroll-wrapper table {
  margin-bottom: 0;
  min-width: 500px;
}

/* ===========================================
   Phase 4: CSS Dividers (replace ASCII <pre> separators)
   =========================================== */

.docs-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.docs-divider-bottom {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0 0 0;
}

/* Endpoint display */
.docs-endpoint {
  display: inline-block;
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 1rem;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

/* Raw markdown link at bottom of doc pages */
.docs-raw-link {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===========================================
   Phase 1: Mobile Navigation (Collapsible Sidebar)
   =========================================== */

/* Hamburger toggle button — hidden on desktop */
.docs-menu-toggle {
  display: none;
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}

.docs-menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ASCII box-drawing nav header */
.docs-nav-header {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav links container (collapsible on mobile) */
.docs-nav-links {
  display: block;
}

/* ===========================================
   Docs Mobile Responsive Overrides
   =========================================== */

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }

  /* Phase 1: Show hamburger, collapse nav */
  .docs-menu-toggle {
    display: block;
  }

  .docs-nav-links {
    display: none;
    padding-top: 0.5rem;
  }

  .docs-nav-links.open {
    display: block;
  }

  /* Hide ASCII box-drawing nav header on mobile */
  .docs-nav-header {
    display: none;
  }

  /* Phase 3: Code block font fix — was 10px, now 13px */
  .docs-content pre {
    font-size: 13px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Phase 2: Table responsiveness on mobile — scrolling handled by .table-scroll-wrapper in JS */
  .docs-content table {
    display: table;
  }

  .docs-content th,
  .docs-content td {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* Phase 4: Ensure docs content doesn't overflow */
  .docs-content {
    max-width: 100%;
    min-width: 0;
  }

  /* Phase 5: Header nav touch-friendly sizing */
  header nav a {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    line-height: 44px;
    margin-left: 0;
  }

  /* Blockquote overflow */
  .docs-content blockquote {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }

}

@media (max-width: 480px) {
  /* Tighter table cells on small phones */
  .docs-content th,
  .docs-content td {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }

  /* Code blocks slightly smaller on small phones */
  .docs-content pre {
    font-size: 12px;
    padding: 0.75rem;
  }

  /* Endpoint display */
  .docs-endpoint {
    font-size: 0.85rem;
  }

  /* Nav links need adequate tap targets */
  .docs-nav a {
    padding: 0.4rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* ===========================================
   Landing Pages
   =========================================== */

/* Landing Hero */
.landing-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.landing-hero h1 {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.landing-hero .landing-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.landing-hero .landing-endpoint {
  display: inline-block;
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Landing Demo */
.landing-demo .demo-form {
  display: flex;
  gap: 1ch;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.landing-demo .demo-results {
  max-width: 600px;
  margin: 0 auto;
}

.landing-demo .demo-results pre {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* How It Works - 3 columns */
.landing-steps {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.landing-step {
  flex: 1;
  max-width: 250px;
  text-align: center;
}

.landing-step .step-num {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.landing-step h3 {
  font-size: 0.95rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.landing-step p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Feature list */
.landing-features {
  list-style: none;
  padding: 0;
  max-width: 600px;
  margin: 0 auto;
}

.landing-features li {
  padding: 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-features li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: bold;
}

/* FAQ Accordion */
.landing-faq {
  max-width: 600px;
  margin: 0 auto;
}

.landing-faq .container {
  max-width: 600px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.faq-item summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: bold;
  color: var(--text);
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: bold;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Related APIs section */
.landing-related pre {
  border: none;
  background: transparent;
  padding: 0;
}

/* Landing demo button (for non-form demos like TLD/Auctions) */
.landing-demo-btn {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--accent);
  background: var(--bg-lighter);
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.15s;
  margin-bottom: 1.5rem;
}

.landing-demo-btn:hover {
  background: var(--border);
}

/* Landing page link in API docs */
.landing-page-link {
  display: block;
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.landing-page-link a {
  color: var(--accent);
}

/* Landing mobile adjustments */
@media (max-width: 480px) {
  .landing-steps {
    flex-direction: column;
    align-items: center;
  }

  .landing-step {
    max-width: 100%;
  }

  .landing-demo .demo-form {
    flex-direction: column;
  }

  .landing-hero h1 {
    font-size: 1.1rem;
  }

  .landing-hero .landing-subtitle {
    font-size: 0.95rem;
  }
}
