/* Cora Help Center — shared styles
   Light/dark theme via prefers-color-scheme plus a manual [data-theme] override
   stored in localStorage (see assets/js/main.js). */

:root {
  --color-bg: #ffffff;
  --color-bg-elevated: #f6f8fb;
  --color-text: #1a1f2b;
  --color-text-muted: #566072;
  --color-border: #e1e5ec;
  --color-accent: #f78c21;
  --color-accent-hover: #d9720b;
  --color-accent-contrast: #1a1f2b;
  --color-code-bg: #eef1f6;
  --color-focus: #f78c21;
  --color-success: #1a7f37;
  --color-danger: #b3261e;
  --color-header-bg: #222222;
  --color-header-text: #ffffff;
  --color-header-border: #0d0d0d;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.10);
  --radius-sm: 6px;
  --radius-md: 10px;
  --sidebar-width: 280px;
  --header-height: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #12151c;
    --color-bg-elevated: #1a1e28;
    --color-text: #e7eaf1;
    --color-text-muted: #a3adc2;
    --color-border: #2a3040;
    --color-accent: #f78c21;
    --color-accent-hover: #ffa64d;
    --color-accent-contrast: #1a1f2b;
    --color-code-bg: #1f2430;
    --color-focus: #f78c21;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-bg: #12151c;
  --color-bg-elevated: #1a1e28;
  --color-text: #e7eaf1;
  --color-text-muted: #a3adc2;
  --color-border: #2a3040;
  --color-accent: #f78c21;
  --color-accent-hover: #ffa64d;
  --color-accent-contrast: #1a1f2b;
  --color-code-bg: #1f2430;
  --color-focus: #f78c21;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-accent);
}
a:hover { color: var(--color-accent-hover); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-header-border);
  background: var(--color-header-bg);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: var(--color-header-text);
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}
.brand .brand-logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand-text {
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  color: var(--color-header-text);
  white-space: nowrap;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding-left: 12px;
  margin-left: 2px;
}
.brand-text:hover {
  color: var(--color-accent);
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 520px;
  margin-left: 8px;
}

.header-search input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: 14px;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 40;
  display: none;
}
.search-results.open { display: block; }

.search-results ul {
  list-style: none;
  margin: 0;
  padding: 4px;
}
.search-results li a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
}
.search-results li a:hover,
.search-results li a:focus {
  background: var(--color-bg-elevated);
}
.search-results .result-title { font-weight: 600; font-size: 14px; }
.search-results .result-excerpt { font-size: 12.5px; color: var(--color-text-muted); }
.search-results .no-results { padding: 12px; color: var(--color-text-muted); font-size: 14px; }

.header-spacer { flex: 1; }

.theme-toggle-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 17px;
  cursor: pointer;
  color: var(--color-header-text);
}

/* ---------- Layout: sidebar + content ---------- */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-logo {
  text-align: center;
  padding: 4px 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.sidebar-logo a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 6px;
}
.sidebar-logo img {
  width: 72px;
  height: auto;
  display: block;
}
.sidebar-logo span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.sidebar nav h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 18px 8px 6px;
}
.sidebar nav h2:first-child { margin-top: 4px; }

.sidebar nav ul {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

.sidebar nav a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: 14.5px;
}
.sidebar nav a:hover { background: var(--color-bg); }
.sidebar nav a[aria-current="page"] {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-weight: 600;
}

.sidebar-backdrop {
  display: none;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 64px;
  max-width: 860px;
}

.content h1 { margin-top: 0; font-size: 30px; }
.content h2 { font-size: 21px; margin-top: 2em; }
.content h3 { font-size: 17px; }

.breadcrumbs {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 18px;
}
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

code, pre {
  background: var(--color-code-bg);
  border-radius: var(--radius-sm);
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}
code { padding: 1px 5px; font-size: 0.92em; }
pre { padding: 12px 14px; overflow-x: auto; }

.callout {
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 20px 0;
}
.callout.security { border-left-color: var(--color-success); }
.callout.warning { border-left-color: var(--color-danger); }

/* ---------- Platform screenshot placeholders ---------- */
.platform-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.platform-shot {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  background: var(--color-bg-elevated);
}
.platform-shot .shot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(
    45deg, var(--color-border), var(--color-border) 10px, transparent 10px, transparent 20px
  );
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.platform-shot .platform-label { font-weight: 600; font-size: 13px; }

@media (max-width: 640px) {
  .platform-shots { grid-template-columns: 1fr; }
}

/* ---------- Decision helper table ---------- */
.decision-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.decision-table th, .decision-table td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}
.decision-table th { background: var(--color-bg-elevated); }

/* ---------- FAQ ---------- */
.faq-item { margin-bottom: 22px; }
.faq-item h3 { margin-bottom: 4px; }

/* ---------- Feedback widget ---------- */
.feedback-widget {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.feedback-widget h2 { font-size: 15px; margin: 0 0 10px; }
.feedback-buttons { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.feedback-buttons button {
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  font-size: 14px;
}
.feedback-buttons button:hover { background: var(--color-bg); }
.feedback-buttons button.selected {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border-color: var(--color-accent);
}
.feedback-thanks { font-size: 14px; color: var(--color-success); margin-left: 4px; }
.report-issue-link { margin-top: 12px; font-size: 13.5px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 40px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- Responsive: mobile drawer sidebar ---------- */
@media (max-width: 767px) {
  .hamburger-btn { display: inline-flex; align-items: center; justify-content: center; }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: 82%;
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 50;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: rgba(0,0,0,0.35);
    z-index: 45;
  }

  .content { padding: 24px 18px 48px; }
  .header-search { max-width: none; }
}
