@import "tailwindcss";

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  /* Elevation: modals/menus sit above --bg-secondary surfaces. */
  --bg-overlay: #1c2128;
  --shadow-overlay: 0 16px 48px rgba(1, 4, 9, 0.85);
  --border-color: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  /* Dedicated disabled ink — `opacity-50` on --text-secondary drops to ~2.4:1. */
  --text-disabled: #6e7681;
  /* --accent is the foreground/link accent (fails AA behind white text);
     --accent-emphasis is the fill for buttons carrying white text (~4.7:1). */
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-emphasis: #1f6feb;
  --accent-emphasis-hover: #388bfd;
  --success: #3fb950;
  --success-emphasis: #238636;
  --warning: #d29922;
  --warning-emphasis: #9e6a03;
  --error: #f85149;
  --error-emphasis: #b62324;
  /* Muted tints, replacing hand-rolled `bg-yellow-500/20` style leaks. */
  --accent-muted: rgba(56, 139, 253, 0.15);
  --success-muted: rgba(63, 185, 80, 0.15);
  --warning-muted: rgba(210, 153, 34, 0.15);
  --error-muted: rgba(248, 81, 73, 0.12);
  --focus-ring: #58a6ff;
  /* Two radii only: controls and panels. */
  --radius-control: 6px;
  --radius-panel: 8px;
  color-scheme: dark;
}

/* One visible focus indicator for every interactive element. Components must
   not strip this with `focus:outline-none`. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Still-unknown states pulse; failed states are painted, not animated. */
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.animate-status-pulse { animation: status-pulse 1.4s ease-in-out infinite; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-toast-in { animation: toast-in 0.18s ease-out; }


html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}

/* Toast slide-down animation */
@keyframes slide-down {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.animate-slide-down { animation: slide-down 0.2s ease-out; }

/* Help dialog content styles */
.help-content {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.help-content .help-h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.help-content .help-h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.help-content .help-h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
  color: var(--text-primary);
}

.help-content .help-h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1rem 0 0.375rem 0;
  color: var(--text-secondary);
}

.help-content .help-p {
  margin: 0.5rem 0;
}

.help-content .help-ul,
.help-content .help-ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.help-content .help-ul {
  list-style-type: disc;
}

.help-content .help-ol {
  list-style-type: decimal;
}

.help-content .help-ul li,
.help-content .help-ol li {
  margin: 0.25rem 0;
}

.help-content .help-code-block {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre;
}

.help-content .help-inline-code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-control);
  padding: 0.125rem 0.375rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.75rem;
}

.help-content .help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.75rem;
}

.help-content .help-table th,
.help-content .help-table td {
  border: 1px solid var(--border-color);
  padding: 0.375rem 0.625rem;
  text-align: left;
}

.help-content .help-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

.help-content .help-table td {
  background: var(--bg-primary);
}

.help-content .help-blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-primary);
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.help-content .help-hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

.help-content .help-link {
  color: var(--accent);
  text-decoration: none;
}

.help-content .help-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
