@import "tailwindcss";
@import "@fontsource-variable/vazirmatn";

@theme inline {
  /* Brand colors */
  --color-background: var(--background);
  --color-surface: var(--surface);
  --color-surface-hover: var(--surface-hover);
  --color-border: var(--border-color);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-accent: var(--accent);
  --color-accent-hover: var(--accent-hover);
  --color-accent-muted: var(--accent-muted);
  --color-accent-glow: var(--accent-glow);
  --color-danger: var(--danger);
  --color-success: var(--success);

  /* Fonts */
  --font-sans: var(--font-jakarta);
  --font-mono: var(--font-jetbrains);
  --font-persian: "Vazirmatn Variable", "Vazirmatn", system-ui, sans-serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

:root {
  --background: #0A0A0B;
  --surface: #141416;
  --surface-hover: #1C1C1F;
  --border-color: #27272A;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --accent: #CCFD65;
  --accent-hover: #B8E85A;
  --accent-muted: rgba(204, 253, 101, 0.1);
  --accent-glow: rgba(204, 253, 101, 0.25);
  --danger: #EF4444;
  --success: #22C55E;
}

* {
  box-sizing: border-box;
  border-color: var(--border-color);
}

html {
  color-scheme: dark;
}

body {
  background: var(--background);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[lang="fa"] body,
[dir="rtl"] {
  font-family: "Vazirmatn Variable", "Vazirmatn", system-ui, sans-serif;
  line-height: 1.7;
}

/* Dot-grid background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Selection */
::selection { background: var(--accent-muted); color: var(--accent); }

/* Focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Rich text / Tiptap rendered content ─────────────────────────── */
.prose-custom { color: var(--text-primary); line-height: 1.8; }
.prose-custom h1 { font-size: 1.875rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--text-primary); }
.prose-custom h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--text-primary); }
.prose-custom h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--text-primary); }
.prose-custom h4 { font-size: 1.125rem; font-weight: 600; margin: 1.25rem 0 0.5rem; color: var(--text-primary); }
.prose-custom p { margin-bottom: 1.25rem; color: rgba(250,250,250,0.9); }
.prose-custom p:last-child { margin-bottom: 0; }
.prose-custom ul { list-style: disc; padding-inline-start: 1.5rem; margin-bottom: 1.25rem; }
.prose-custom ol { list-style: decimal; padding-inline-start: 1.5rem; margin-bottom: 1.25rem; }
.prose-custom li { margin-bottom: 0.375rem; color: rgba(250,250,250,0.9); }
.prose-custom blockquote { border-inline-start: 2px solid var(--accent); padding-inline-start: 1.25rem; margin: 1.5rem 0; color: var(--text-secondary); font-style: italic; }
.prose-custom a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose-custom a:hover { color: var(--accent-hover); }
.prose-custom strong { font-weight: 600; color: var(--text-primary); }
.prose-custom em { font-style: italic; }
.prose-custom code { background: var(--surface); border: 1px solid var(--border-color); border-radius: 4px; padding: 0.125rem 0.375rem; font-family: var(--font-mono, monospace); font-size: 0.875em; color: var(--accent); }
.prose-custom pre { background: var(--surface); border: 1px solid var(--border-color); border-radius: 10px; padding: 1rem; margin: 1.5rem 0; overflow-x: auto; }
.prose-custom pre code { background: none; border: none; padding: 0; font-size: 0.875rem; line-height: 1.6; color: var(--text-primary); }
.prose-custom hr { border: none; border-top: 1px solid var(--border-color); margin: 2rem 0; }
.prose-custom img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border-color); margin: 1.5rem 0; }

/* Tiptap editor placeholder */
.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: inline-start;
  color: var(--text-secondary);
  pointer-events: none;
  height: 0;
}

/* ── Admin input utility class ────────────────────────────────────── */
.admin-input {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--surface-hover);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color 0.15s;
}
.admin-input::placeholder { color: var(--text-secondary); }
.admin-input:focus { outline: none; border-color: rgba(204,253,101,0.5); box-shadow: 0 0 0 3px rgba(204,253,101,0.08); }
.admin-input option { background: var(--surface); color: var(--text-primary); }
