/* Error Page Styling */
.error-page {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  color: #cbd5e1;
  opacity: 0.8;
}

.error-message {
  font-size: 2rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: #f1f5f9;
}

.error-description {
  font-size: 1.125rem;
  color: #94a3b8;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.error-actions {
  margin-top: 2rem;
}

.error-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #3b82f6;
  color: #ffffff;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.error-link:hover {
  background-color: #2563eb;
}

/* Help Modal Content Styling */
#help-modal .prose {
  color: #e2e8f0;
}

#help-modal .prose h1 {
  font-size: 2em;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.75em;
  color: #f1f5f9;
}

#help-modal .prose h2 {
  font-size: 1.5em;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  color: #f1f5f9;
  border-bottom: 1px solid #475569;
  padding-bottom: 0.5em;
}

#help-modal .prose h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  color: #cbd5e1;
}

#help-modal .prose h4 {
  font-size: 1.1em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.5em;
  color: #cbd5e1;
}

#help-modal .prose p {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  line-height: 1.7;
  color: #e2e8f0;
}

#help-modal .prose ul,
#help-modal .prose ol {
  margin-top: 1em;
  margin-bottom: 1em;
  padding-left: 2em;
}

#help-modal .prose ul li {
  list-style-type: disc;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: #e2e8f0;
}

#help-modal .prose ol li {
  list-style-type: decimal;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: #e2e8f0;
}

#help-modal .prose :not(pre) > code,
.markdown-body :not(pre) > code,
.atom :not(pre) > code {
  background-color: #1e293b;
  color: #fbbf24;
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
  font-size: 14.5px !important;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

#help-modal .prose pre,
.markdown-body pre,
.atom pre {
  background-color: #0f172a !important;
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 1em;
  overflow-x: auto;
  margin-top: 1em;
  margin-bottom: 1em;
  font-size: 14.5px !important;
}

#help-modal .prose pre code,
.markdown-body pre code,
.atom pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* Ensure Highlight.js theme colors take precedence */
pre code.hljs,
code.hljs,
.hljs {
  color: #f8fafc !important; /* Default code color */
  background: #0f172a !important; /* Force site background */
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: #f472b6 !important;
}

.hljs-string,
.hljs-doctag {
  color: #fbbf24 !important;
}

.hljs-title,
.hljs-section,
.hljs-selector-id,
.hljs-title.class_,
.hljs-title.function_ {
  color: #60a5fa !important;
}

.hljs-comment,
.hljs-quote {
  color: #94a3b8 !important;
  font-style: italic;
}

.hljs-built_in,
.hljs-type,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
  color: #38bdf8 !important;
}

#help-modal .prose strong {
  font-weight: 600;
  color: #f1f5f9;
}

#help-modal .prose a {
  color: #60a5fa;
  text-decoration: underline;
}

#help-modal .prose a:hover {
  color: #93c5fd;
}

.page-shell,
.preview-surface,
.preview-pane {
  padding: var(--page-padding, 24px);
}

.site-root {
  background-color: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #f8fafc;
}

.markdown-body {
  line-height: 1.8;
  color: #e2e8f0;
  font-size: 17px;
}

/* Headings with distinct sizes and spacing */
.markdown-body h1,
.atom h1 {
  font-size: 2.5em;
  font-weight: 800;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.2;
  color: #f8fafc;
}

.markdown-body h2,
.atom h2 {
  font-size: 2em;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0.3em;
}

.markdown-body h3,
.atom h3 {
  font-size: 1.5em;
  font-weight: 600;
  margin-top: 1.3em;
  margin-bottom: 0.4em;
  line-height: 1.4;
  color: #f1f5f9;
}

.markdown-body h4,
.atom h4 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  line-height: 1.4;
  color: #f1f5f9;
}

.markdown-body h5,
.atom h5 {
  font-size: 1.1em;
  font-weight: 600;
  margin-top: 1.1em;
  margin-bottom: 0.3em;
  line-height: 1.5;
  color: #cbd5e1;
}

.markdown-body h6,
.atom h6 {
  font-size: 1em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.3em;
  line-height: 1.5;
  color: #94a3b8;
}

/* Paragraphs */
.markdown-body p,
.atom p {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

/* Lists */
.markdown-body ul,
.markdown-body ol,
.atom ul,
.atom ol {
  margin-top: 1em;
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.markdown-body li,
.atom li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.markdown-body ul,
.atom ul {
  list-style-type: disc;
}

.markdown-body ol,
.atom ol {
  list-style-type: decimal;
}

.markdown-body li > ul,
.markdown-body li > ol,
.atom li > ul,
.atom li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Blockquotes */
.markdown-body blockquote,
.atom blockquote {
  border-left: 4px solid #334155;
  padding: 0.5em 1.5em;
  margin: 1.5em 0;
  color: #94a3b8;
  font-style: italic;
  background-color: #1e293b50;
  border-radius: 0 0.5rem 0.5rem 0;
}

.markdown-body blockquote p,
.atom blockquote p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Links */
.markdown-body a,
.atom a {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body a:hover,
.atom a:hover {
  color: #93c5fd;
}

/* Emphasis */
.markdown-body strong,
.atom strong {
  font-weight: 700;
  color: #f8fafc;
}

.markdown-body em,
.atom em {
  font-style: italic;
}

/* Horizontal rule */
.markdown-body hr,
.atom hr {
  border: none;
  border-top: 1px solid #1e293b;
  margin: 2.5em 0;
}

/* Table styles */
.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  background-color: #1e293b30;
  border-radius: 0.5rem;
  overflow: hidden;
}

.markdown-body th {
  background-color: #1e293b;
  color: #f8fafc;
  text-align: left;
  font-weight: 600;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid #1e293b;
  padding: 12px 15px;
}

.markdown-body tr:nth-child(even) {
  background-color: #1e293b15;
}

.admonition {
  border-left: 4px solid #3b82f6;
  background: #1e293b;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  color: #e2e8f0;
}

.admonition-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cm-wrapper {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.cm-editor {
  min-height: 180px;
}

.admin-shell {
  background: #0b0f1a;
  color: #e5e7eb;
}

.admin-shell .admin-card {
  background: #111827;
  border: 1px solid #1f2937;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.admin-shell .admin-btn {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #f8fafc;
  border: 1px solid rgba(99, 102, 241, 0.6);
  font-weight: 600;
}

.admin-shell .admin-btn:hover {
  filter: brightness(1.05);
}

.admin-shell input,
.admin-shell textarea,
.admin-shell select {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1f2937;
}

.admin-shell input::placeholder,
.admin-shell textarea::placeholder {
  color: #64748b;
}

.admin-shell input:focus,
.admin-shell textarea:focus,
.admin-shell select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.admin-shell .preview-pane {
  background: transparent;
  border: none;
  padding: 0;
}

.admin-shell .cm-wrapper {
  border: 1px solid #1f2937;
  background: #0b1220;
}

.admin-shell .cm-editor {
  background: #0b1220;
  color: #e2e8f0;
}

.admin-shell .rounded,
.admin-shell .rounded-lg,
.admin-shell .rounded-xl {
  border-radius: 0;
}

.admin-shell .js-page-atom {
  cursor: grab;
}

.admin-shell .js-page-atom:active {
  cursor: grabbing;
}

/* Deleted page link styling */
a[href="#page-deleted"] {
  color: #ef4444;
  text-decoration: line-through;
  opacity: 0.7;
  cursor: not-allowed;
}
