/* ============================================================================
   AIGENS — supplemental DLE stylesheet
   Loaded AFTER Tailwind (Play CDN) in main.tpl. Small on purpose: it only adds
   what Tailwind utilities can't express plus base styling for DLE-injected
   markup that Tailwind Preflight strips (quotes, code, BB-editor, Highslide).
   Palette mirrors tailwind.config: primary #7CB342, surfaces/borders/text.
   Dark mode = Tailwind's `class` strategy (`.dark` on <html>).
   ========================================================================== */

/* ---- Base -------------------------------------------------------------- */
body {
	font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Refined card = bordered surface, no shadow (cf. Stitch .card-refined) */
.card-refined {
	box-shadow: none;
	border: 1px solid #E5E7EB;
}
.dark .card-refined {
	border-color: #374151;
}

/* Custom scrollbar (from Stitch reference) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }
.dark ::-webkit-scrollbar-thumb { background: #4B5563; }
.dark ::-webkit-scrollbar-thumb:hover { background: #6B7280; }

/* ============================================================================
   DLE-injected content — re-add base styling Tailwind Preflight removes.
   Class names are DLE's own (never rename); ported from engine.css and
   re-themed to the AIGENS palette. Keep these so quotes/code/editor render.
   ========================================================================== */

/* ---- Quote / spoiler / code boxes -------------------------------------- */
.quote,
.scriptcode,
.title_quote,
.title_spoiler,
.text_spoiler {
	padding: 12px 16px;
	background: #FFFFFF;
	border: 1px solid #E5E7EB;
	border-radius: 0.75rem;
	color: #1F2937;
}
.quote_block { margin-bottom: 0.75rem; }
.quote,
blockquote { border-left: 3px solid #7CB342; }
.title_quote {
	border-left: 3px solid #7CB342;
	border-bottom: 0;
	margin-top: 2px;
	font-weight: 600;
}
.title_spoiler { margin-top: 2px; font-weight: 400; }
.text_spoiler { margin-bottom: 2px; border-top: 0; text-align: justify; }
.title_spoiler img { vertical-align: middle; margin: -1px 0 0 !important; }

/* Code keeps its monospace + horizontal scroll (Preflight drops div font) */
.scriptcode,
pre.scriptcode {
	color: #4C6D0F;
	text-align: left;
	font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	white-space: pre;
	overflow-x: auto;
}
.hide { background-color: #F3F4F6; padding: 5px; color: #4C6D0F; margin: 0 0 1em 0; }
.hide a { text-decoration: underline; }
.hide a:hover { text-decoration: none; }
.quote_link { float: right; }
.quote_link svg { color: #6B7280; vertical-align: middle; }

/* Dark-mode variants for the boxes above */
.dark .quote,
.dark .scriptcode,
.dark .title_quote,
.dark .title_spoiler,
.dark .text_spoiler {
	background: #1F2937;
	border-color: #374151;
	color: #F9FAFB;
}
.dark .scriptcode,
.dark pre.scriptcode { color: #A3D160; }
.dark .hide { background-color: #111827; color: #A3D160; }

/* ---- BB-code editor: textarea + toolbar buttons ------------------------ */
.bb-editor textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 10px 12px;
	margin-top: -1px;
	border: 1px solid #E5E7EB;
	border-radius: 0.75rem;
	outline: none;
	background: #F9FAFB;
	color: #1F2937;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bb-editor textarea:focus {
	border-color: #7CB342 !important;
	box-shadow: 0 0 0 2px rgba(124, 179, 66, 0.35);
}
.dark .bb-editor textarea {
	background: #111827;
	border-color: #374151;
	color: #F9FAFB;
}

/* Icon-style editor buttons (.editor / .editor_button*) */
.editor,
.editor_button,
.editor_button_selected {
	display: inline-block;
	vertical-align: middle;
	cursor: pointer;
	line-height: 0;
}
.editor_button,
.editor_button_selected {
	padding: 3px;
	border: 1px solid transparent;
	border-radius: 6px;
}
.editor_button:hover { border-color: #E5E7EB; background: #F3F4F6; }
.editor_button_selected { border-color: #7CB342; background: #F1F8E9; }
.dark .editor_button:hover { border-color: #374151; background: #374151; }
.dark .editor_button_selected { border-color: #7CB342; background: rgba(124, 179, 66, 0.12); }

/* Pill-style action buttons (.bbcodes) — Preflight resets <button> styling */
.bbcodes {
	display: inline-block;
	vertical-align: middle;
	cursor: pointer;
	border: 0;
	border-radius: 8px;
	padding: 6px 14px;
	color: #FFFFFF;
	background-color: #7CB342;
	text-decoration: none !important;
	box-sizing: border-box;
	transition: background-color 0.1s ease;
}
.bbcodes:hover { background-color: #689F38; }
.bbcodes.cancelchanges { background-color: #9CA3AF; }
.bbcodes.cancelchanges:hover { background-color: #6B7280; }

/* ---- Highslide image gallery (.highslide-*) ---------------------------- */
.highslide { cursor: pointer; }
.highslide img { border: 2px solid transparent; outline: none; }
.highslide:hover img { border-color: #7CB342; }
.highslide-image { border: 2px solid #FFFFFF; }
.highslide-dimming { position: absolute; background: #000000; }
.highslide-loading {
	display: block;
	color: #1F2937;
	font-size: 0.85rem;
	padding: 3px 20px 3px 3px;
	border: 1px solid #E5E7EB;
	background-color: #FFFFFF;
	border-radius: 0.5rem;
}
.highslide-caption {
	display: none;
	font-size: 0.85rem;
	padding: 6px 12px;
	color: #1F2937;
	background: #FFFFFF;
	border: 1px solid #E5E7EB;
}
.dark .highslide-image { border-color: #1F2937; }
.dark .highslide-loading,
.dark .highslide-caption { color: #F9FAFB; background: #1F2937; border-color: #374151; }
