/* ================================================
   ORBIT VISUALIZER - INDEX PAGE WRAPPER STYLES
   Template integration styles for embedding the app
   ================================================ */

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden; /* entire page fits in viewport — no scrollbar */
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  color: #eee;
}

:root {
  --exo-header-h: 56px;
}

body {
  display: flex;
  flex-direction: column;
  height: 100svh; /* anchor body to viewport height */
}

/* Visually-hidden page H1 (SEO/a11y; this is a fullscreen tool with no visible heading) */
.orbit-viz-h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App wrapper container */
.orbit-viz-wrapper {
  width: 100%;
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Grow to fill all space between the header and footer — no fixed height calc needed. */
  flex: 1 1 auto;
  min-height: 0; /* allow flex child to shrink below its content height */
  position: relative;
}

/* Iframe styling */
#orbit-viz-frame {
  width: 100%;
  height: 100%;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #111;
}

/* Tablet: slightly tighter */
@media (max-width: 1024px) {
  .orbit-viz-wrapper {
    padding: 6px;
  }
  #orbit-viz-frame {
    border-radius: 6px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .orbit-viz-wrapper {
    padding: 4px;
  }
  #orbit-viz-frame {
    border-radius: 4px;
  }
}

/* Control button group — fullscreen toggle + help link, stacked in top-right corner */
.ov-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.ov-ctrl-btn {
  width: 44px;
  height: 44px;
  background: rgba(42, 42, 42, 0.9);
  border: 1px solid #555;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}

.ov-ctrl-btn:hover,
.ov-ctrl-btn:focus-visible {
  background: rgba(102, 126, 234, 0.9);
  border-color: #667eea;
  transform: scale(1.05);
  outline: none;
}

.ov-ctrl-btn:active { transform: scale(0.95); }

/* Tooltip */
.ov-ctrl-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ov-ctrl-btn:hover::after { opacity: 1; }

@media (max-width: 768px) {
  .ov-controls {
    top: 12px;
    right: 12px;
    gap: 6px;
  }
  .ov-ctrl-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ov-ctrl-btn { transition: none; }
}

/* Fullscreen mode styles */
body.fullscreen-mode .site-header,
body.fullscreen-mode .mobile-nav-menu,
body.fullscreen-mode .footer,
body.fullscreen-mode .help-cue,
body.fullscreen-mode .page-content {
  display: none;
}

body.fullscreen-mode .orbit-viz-wrapper {
  padding: 10px;
  max-width: 100%;
  height: 100svh;
}

/* ========================================
   DARK MODE STYLES
   ======================================== */
@media (prefers-color-scheme: dark) {
  html,
  body {
    background: #0a0a0a;
    color: #e0e0e0;
  }
  
  #orbit-viz-frame {
    border: 2px solid #2a2a2a;
    background: #0a0a0a;
  }
  
  .ov-ctrl-btn {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid #2a2a2a;
    color: #e0e0e0;
  }
  
  .ov-ctrl-btn:hover,
  .ov-ctrl-btn:focus-visible {
    background: rgba(77, 166, 255, 0.9);
    border-color: #4da6ff;
  }
  
  .ov-ctrl-btn::after {
    background: rgba(10, 10, 10, 0.95);
    color: #e0e0e0;
  }
}

/* =========================================================================
   Crawlable SEO content — hidden from view but present in the DOM so
   search engines can index it.
   ========================================================================= */
/* SEO content — visually hidden but fully crawlable (not display:none). */
.page-content.ov-content {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-content.ov-content {
  --ov-bg: #ffffff;
  --ov-surface: #f8fafc;
  --ov-inset: #ffffff;
  --ov-border: #e2e8f0;
  --ov-text: #0f172a;
  --ov-muted: #475569;
  --ov-accent: #e53935;
  --ov-info-soft: rgba(37, 99, 235, 0.10);
  --ov-radius: 14px;
  --ov-radius-sm: 10px;
  --ov-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --ov-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--ov-bg);
  color: var(--ov-text);
  padding: 2.5rem 1rem 3.5rem;
  box-sizing: border-box;
  flex: 0 0 auto;
}
@media (prefers-color-scheme: dark) {
  .page-content.ov-content {
    --ov-bg: #0b1120;
    --ov-surface: #111827;
    --ov-inset: #0e1626;
    --ov-border: #1f2937;
    --ov-text: #e2e8f0;
    --ov-muted: #94a3b8;
    --ov-accent: #ef4444;
    --ov-info-soft: rgba(96, 165, 250, 0.14);
    --ov-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}
.ov-content-inner {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
.ov-card {
  background: var(--ov-surface);
  border: 1px solid var(--ov-border);
  border-radius: var(--ov-radius);
  box-shadow: var(--ov-shadow);
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}
.ov-content h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ov-text);
}
.ov-content h3 {
  margin: 1.3rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ov-text);
}
.ov-content p {
  margin: 0 0 0.9rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ov-muted);
}
.ov-content p:last-child { margin-bottom: 0; }
.ov-content strong { color: var(--ov-text); }
.ov-content em { color: var(--ov-text); font-style: italic; }
.ov-content a {
  color: var(--ov-accent);
  text-decoration: none;
  font-weight: 500;
}
.ov-content a:hover,
.ov-content a:focus-visible { text-decoration: underline; }
.ov-content ol,
.ov-content ul {
  margin: 0 0 0.9rem;
  padding-left: 1.3rem;
  color: var(--ov-muted);
}
.ov-content li {
  margin-bottom: 0.4rem;
  font-size: 0.96rem;
  line-height: 1.6;
}
.ov-content code {
  font-family: var(--ov-mono);
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--ov-text);
  background: var(--ov-info-soft);
  word-break: break-word;
}
.ov-content code.ov-url {
  display: block;
  padding: 0.7rem 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Figure */
.ov-figure { margin: 0 0 1.2rem; }
.ov-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-border);
}
.ov-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--ov-muted);
  text-align: center;
}

/* URL parameter definition list */
.ov-params {
  margin: 0.4rem 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1rem 1rem;
}
.ov-params dt {
  font-family: var(--ov-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ov-text);
  margin-top: 0.7rem;
}
.ov-params dd {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ov-muted);
}
@media (min-width: 620px) {
  .ov-params { grid-template-columns: minmax(150px, 210px) 1fr; }
  .ov-params dt { margin-top: 0.55rem; }
  .ov-params dd { margin-top: 0.55rem; }
}

/* FAQ accordions (native <details>) */
.ov-faq .faq-item { border-bottom: 1px solid var(--ov-border); }
.ov-faq .faq-item:last-child { border-bottom: none; }
.ov-faq .faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 2rem 1rem 0;
  position: relative;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ov-text);
}
.ov-faq .faq-item summary::-webkit-details-marker { display: none; }
.ov-faq .faq-item summary::after {
  content: "\002B";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ov-muted);
}
.ov-faq .faq-item[open] summary::after { content: "\2212"; }
.ov-faq .faq-item summary:focus-visible {
  outline: 2px solid var(--ov-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.ov-faq .faq-item p {
  margin: 0 0 1rem;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--ov-muted);
}

/* =========================================================================
   Keep exploring CTA (shared component, dark/light aware, no JS)
   ========================================================================= */
.keep-exploring {
  --ke-surface: #f8fafc;
  --ke-border: #e2e8f0;
  --ke-text: #0f172a;
  --ke-muted: #475569;
  --ke-accent: #e53935;
  --ke-accent-soft: rgba(229, 57, 53, 0.10);
  --ke-card: #ffffff;
  --ke-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  max-width: 920px;
  margin: 0 auto 1.5rem;
  padding: 1.5rem;
  background: var(--ke-surface);
  border: 1px solid var(--ke-border);
  border-radius: 14px;
  box-shadow: var(--ke-shadow);
  box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  .keep-exploring {
    --ke-surface: #111827;
    --ke-border: #1f2937;
    --ke-text: #e2e8f0;
    --ke-muted: #94a3b8;
    --ke-accent: #ef4444;
    --ke-accent-soft: rgba(239, 68, 68, 0.14);
    --ke-card: #0e1626;
    --ke-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}
.keep-exploring-title {
  margin: 0 0 1.1rem;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ke-text);
}
.keep-exploring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.keep-exploring-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--ke-border);
  border-radius: 10px;
  background: var(--ke-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.keep-exploring-card:hover,
.keep-exploring-card:focus-visible {
  border-color: var(--ke-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
  outline: none;
}
.keep-exploring-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ke-accent-soft);
  color: var(--ke-accent);
  font-size: 1.05rem;
}
.keep-exploring-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}
.keep-exploring-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ke-text);
}
.keep-exploring-card-desc {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ke-muted);
  line-height: 1.4;
}
.keep-exploring-arrow {
  flex: 0 0 auto;
  color: var(--ke-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}
.keep-exploring-card:hover .keep-exploring-arrow,
.keep-exploring-card:focus-visible .keep-exploring-arrow {
  transform: translateX(3px);
  color: var(--ke-accent);
}
@media (prefers-reduced-motion: reduce) {
  .keep-exploring-card,
  .keep-exploring-arrow { transition: none; }
  .keep-exploring-card:hover,
  .keep-exploring-card:focus-visible { transform: none; }
}

@media (max-width: 767px) {
  .page-content.ov-content { padding: 1.5rem 1rem 3rem; }
  .ov-card { padding: 1.2rem; }
  .ov-content h2 { font-size: 1.2rem; }
}
