/* Global CSS for Developer Toolbox */

:root {
  --primary: #635bff;
  --primary-hover: #534bae;
  --primary-light: #f4f3ff;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0a2540;
  --text-muted: #425466;
  --border-color: #e5e7eb;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(10,37,64,0.08);
  --shadow-lg: 0 12px 32px rgba(99,91,255,0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Menlo, Monaco, Consolas, monospace;
}

html {
  font-size: 110%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Header Navbar */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text-dark);
  text-decoration: none;
}

.logo-badge {
  background: linear-gradient(135deg, var(--primary), #00d4ff);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-nav {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-secondary {
  color: var(--text-muted);
  background: transparent;
}
.btn-secondary:hover {
  color: var(--text-dark);
  background: #f1f5f9;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(99,91,255,0.25);
}

/* Main Container */
.tool-runner-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px 24px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--primary);
}

/* Tool Header Card */
.tool-header-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tool-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #00d4ff);
}

.tool-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.tool-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  letter-spacing: -0.5px;
}

.tool-summary {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.plane-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99,91,255,0.15);
}

.pro-badge {
  background: #fff3ed;
  color: #ff6b35;
  border: 1px solid rgba(255,107,55,0.2);
}

/* Interactive Workspace Split */
.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 868px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

.pane {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pane-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.btn-icon:hover {
  background: white;
  color: var(--text-dark);
  border-color: #cbd5e1;
}

.pane-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-textarea {
  width: 100%;
  min-height: 280px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dark);
  background: #fbfcfd;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.tool-textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,91,255,0.1);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-run {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.btn-run:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99,91,255,0.3);
  transform: translateY(-1px);
}
.btn-run:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Output Display */
.output-pre {
  width: 100%;
  min-height: 280px;
  margin: 0;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background: #0f172a;
  color: #38bdf8;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.locked-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: #fff7ed;
  border: 1px dashed #fdba74;
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
}

.locked-title {
  font-weight: 800;
  font-size: 18px;
  color: #c2410c;
  margin-bottom: 8px;
}

.locked-desc {
  font-size: 14px;
  color: #9a3412;
  margin-bottom: 20px;
  max-width: 320px;
}

/* Authentication Card UI (Login / Register / Forgot Password) */
.auth-card {
  max-width: 440px;
  margin: 60px auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #00d4ff);
}

.auth-card h1 {
  margin: 0 0 24px 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  text-align: center;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.auth-card label.row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  color: var(--text-dark);
  background-color: #fbfcfd;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.12);
}

.auth-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-card button[type="submit"] {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.auth-card button[type="submit"]:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.3);
  transform: translateY(-1px);
}

.auth-card button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

.field-error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}

.auth-card small {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.oauth::before {
  content: 'OR';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.oauth a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.oauth a:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  text-decoration: none;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 600;
}

.auth-links a {
  color: var(--text-muted);
  transition: color 0.15s;
}

.auth-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #635bff;
}

/* Glass & Stripe White Card Panel Helpers */
.glass-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

html.dark .glass-panel {
  background: rgba(15, 48, 87, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 13px 27px -5px rgba(0, 0, 0, 0.3);
}

.glass-panel-hero {
  background: #ffffff;
  color: #0a2540;
  border: 1px solid #e5e7eb;
  border-top: 3px solid #635bff;
  box-shadow: 0 10px 25px -5px rgba(99, 91, 255, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

/* Stripe Signature Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #635bff 0%, #00d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Markdown-rendered content (blog posts, docs). Constrained to never overflow
   its container -- long code lines and URLs scroll/wrap inside their own box
   instead of blowing out the card. */
.markdown-body {
  max-width: 100%;
  overflow-wrap: break-word;
}

.markdown-body > *:first-child {
  margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--text-dark);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 1.75em 0 0.75em;
  line-height: 1.3;
}
html.dark .markdown-body h1,
html.dark .markdown-body h2,
html.dark .markdown-body h3,
html.dark .markdown-body h4 {
  color: #ffffff;
}

.markdown-body h1 { font-size: 1.5em; }
.markdown-body h2 { font-size: 1.3em; }
.markdown-body h3 { font-size: 1.125em; }
.markdown-body h4 { font-size: 1em; }

.markdown-body p {
  margin: 0 0 1.1em;
  line-height: 1.75;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}
.markdown-body ul { list-style: disc; }
.markdown-body ol { list-style: decimal; }
.markdown-body li { margin: 0.35em 0; line-height: 1.7; }
.markdown-body li > ul,
.markdown-body li > ol { margin: 0.35em 0 0.35em 0; }

.markdown-body a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body strong { font-weight: 700; color: var(--text-dark); }
html.dark .markdown-body strong { color: #ffffff; }

.markdown-body blockquote {
  margin: 0 0 1.1em;
  padding: 0.25em 1em;
  border-left: 3px solid var(--primary);
  color: var(--text-muted);
  font-style: italic;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2em 0;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(99, 91, 255, 0.08);
  color: var(--primary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  word-break: break-word;
}
html.dark .markdown-body code {
  background: rgba(99, 91, 255, 0.18);
  color: #b4aeff;
}

.markdown-body pre {
  margin: 0 0 1.1em;
  padding: 1em 1.2em;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-width: 100%;
}
.markdown-body pre code {
  background: none;
  color: #e2e8f0;
  padding: 0;
  font-size: 0.8em;
  line-height: 1.6;
  white-space: pre;
}

.markdown-body table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.1em;
}
.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border-color);
  padding: 0.5em 0.8em;
  text-align: left;
  font-size: 0.9em;
}
.markdown-body th {
  background: #f8fafc;
  font-weight: 700;
}
html.dark .markdown-body th {
  background: rgba(255, 255, 255, 0.05);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
