/* ===============================
   Illustrations DB — app.css
   =============================== */

:root{
  /* palette (JW-ish, soft blues / neutrals) */
  --bg: #f7f9fc;
  --card: #ffffff;
  --ink: #1f2937;
  --ink-muted: #6b7280;
  --border: #e5e7eb;

  --brand: #2f6cab;
  --brand-800: #1f4c7a;

  --danger: #b91c1c;

  --btn-bg: #ffffff;
  --btn-border: #d1d5db;
  --btn-hover: #eef2f7;
}

/* ----- base ----- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
code,kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace}

/* page container */
.page{max-width:1100px;margin:18px auto;padding:0 16px}

/* ----- buttons ----- */
.btn{
  appearance:none;
  border:1px solid var(--btn-border);
  background:var(--btn-bg);
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  color:var(--ink);
  line-height:1;
  transition:background .12s ease,border-color .12s ease,box-shadow .12s ease,filter .12s ease;
}
.btn:hover{background:var(--btn-hover)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn-lg{padding:10px 16px;font-size:16px}

.btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-800);border-color:var(--brand-800)}
.btn-secondary{background:#fff;border-color:var(--border)}
.btn-outline{background:#fff;border-color:#cbd5e1}
.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn-danger:hover{filter:brightness(.97)}

/* small utility */
.inline{display:inline}
.small{font-size:13px}
.muted{color:var(--ink-muted)}

/* chips */
.chip{
  display:inline-flex;align-items:center;gap:6px;
  padding:4px 10px;border-radius:999px;
  border:1px solid var(--border);background:#f8fafc;font-size:13px;
}
.chip-muted{background:#f6f7f9;color:#64748b}
.chip-link{background:#eef5fc;border-color:#d7e6f7}

/* cards */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}

/* ===============================
   Top Navigation
   =============================== */
.topbar-wrap{
  border-bottom:1px solid var(--border);
  background:#f8fafc;
}
.topbar{
  max-width:1100px;margin:0 auto;padding:14px 16px;
  display:flex;align-items:center;gap:14px;justify-content:space-between;
  font-size:17px;
}

/* Brand: separate clickable title + version link */
.brand{
  display:flex;
  align-items:baseline;
  gap:.35em;
  white-space:nowrap;
}
.brand-title{
  color:#111827;
  text-decoration:none;
  font-weight:600;
  letter-spacing:.2px;
  font-size:1.05em;
}
.brand-title:hover{ text-decoration:underline; }

.version-link{
  font-size:.85em;
  color:#9aa3ad;
  text-decoration:none;
}
.version-link:hover{ color:#7f8a94; }

.nav-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.user-chip{
  padding:6px 10px;border-radius:999px;border:1px solid var(--border);
  background:#fff;color:var(--ink-muted);font-size:14px;
}

/* Messages (Django messages) */
.messages{margin:12px 0;display:grid;gap:8px}
.msg{padding:10px 12px;border-radius:10px;border:1px solid #e5e7eb;background:#fff}
.msg.info{border-color:#dbeafe;background:#eff6ff}
.msg.success{border-color:#bbf7d0;background:#ecfdf5}
.msg.warning{border-color:#fde68a;background:#fffbeb}
.msg.error{border-color:#fecaca;background:#fef2f2}

/* ===============================
   Search page
   =============================== */
.container{max-width:1100px;margin:24px auto;padding:0 16px}
.page-title{font-size:22px;margin:4px 0 6px}
.page-subtitle{color:var(--ink-muted);margin:0 0 16px}

.search-form{
  background:var(--card);border:1px solid var(--border);border-radius:16px;
  padding:16px;margin-bottom:16px;
}
.search-row{display:flex;gap:8px}
.search-input{
  flex:1;border:1px solid var(--border);border-radius:12px;padding:10px 12px;font-size:16px;
}
.filter-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.check-pill{
  display:inline-flex;align-items:center;border:1px solid var(--border);
  border-radius:999px;background:#fff;padding:6px 10px;cursor:pointer;gap:8px;
}
.check-pill input{accent-color:var(--brand)}
.check-pill:hover{background:#f9fafb}

.empty-state{padding:28px;border:1px dashed var(--border);border-radius:16px;background:#fff}
.empty-title{font-weight:600;margin-bottom:6px}
.empty-subtitle{color:var(--ink-muted)}

/* ===============================
   Result view
   =============================== */
.result-wrap{max-width:1100px;margin:18px auto;padding:0 16px}

.result-toolbar{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-bottom:14px;
}
.rt-left{display:flex;align-items:center;gap:10px}
.rt-right{display:flex;align-items:center;gap:10px}
.rt-count{color:#64748b;font-size:14px}

/* main card */
.result-card{
  background:#fff;border:1px solid var(--border);border-radius:16px;
  box-shadow:0 2px 10px rgba(0,0,0,.04);padding:18px 20px;
}

/* subject at the top, bold */
.subject-title{
  margin:0 0 10px;font-size:28px;line-height:1.25;font-weight:700;color:#0f172a;
}

/* illustration + application */
.section{margin-top:10px}
.section-label{
  text-transform:uppercase;letter-spacing:.06em;font-size:12px;color:#64748b;margin-bottom:4px;
}
.section-body{font-size:17px}
.lead-text{font-size:18px;line-height:1.6;white-space:pre-wrap}

/* meta area (smaller info below) */
.meta-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;
  margin-top:16px;padding-top:12px;border-top:1px solid var(--border);
}
.meta-label{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#64748b;margin-bottom:4px}
.meta-value{font-size:15px}
.meta-value.small{font-size:14px;color:#475569}

/* ===============================
   Modern Edit/Add form (new)
   =============================== */

/* Page wrapper for edit */
.entry-edit-page{max-width:1100px;margin:18px auto;padding:0 16px}

/* Card that holds the form */
.form-card{
  max-width:1100px;
  margin:0 auto;
  padding:20px 22px;
  background:#fff;border:1px solid var(--border);border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
}

/* Blocks */
.form-group{margin-bottom:18px}
.form-label{
  display:block;
  font-weight:600;
  margin-bottom:6px;
  color:#0f172a;
}

/* Controls */
.form-control{
  width:100%;
  font-size:16px;
  line-height:1.5;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff; color:#111827;
  resize:vertical;
}
.form-control:focus{
  outline:none;
  border-color:#2f6cab;
  box-shadow:0 0 0 3px rgba(47,108,171,.15);
}
.form-textarea-tall{ min-height:260px }
.form-actions{
  display:flex;justify-content:flex-end;gap:10px;margin-top:6px;
}

/* Grids */
.form-grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
.form-grid-3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:16px;
}

/* ===============================
   Responsive
   =============================== */
@media (max-width:780px){
  .topbar{gap:10px;padding:12px 12px}
  .nav-right{gap:8px}
  .btn{padding:8px 10px}
  .btn-lg{padding:10px 14px}

  .container,.page,.result-wrap,.entry-edit-page{padding:0 12px}
  .result-toolbar{flex-direction:column;align-items:stretch}
  .rt-right{justify-content:space-between}

  .meta-grid{grid-template-columns:1fr}
  .form-grid-2{grid-template-columns:1fr}
  .form-grid-3{grid-template-columns:1fr}
  .subject-title{font-size:24px}
  .lead-text{font-size:17px}
}

/* ===============================
   Theming (gradient pages)
   =============================== */
.login-page,
.themed-bg{
  min-height:100vh;
  background:
    linear-gradient(110deg,
      #d7b592 0%,
      #e7e3db 30%,
      #8fbfe0 100%
    );
  background-attachment: fixed;
}

/* Keep cards floating nicely over gradients */
.themed-bg .card,
.themed-bg .result-card,
.themed-bg .search-form,
.themed-bg .form-card{
  background:#ffffff;
  border:1px solid var(--border);
  box-shadow:0 10px 30px rgba(0,0,0,.06);
}

/* Translucent topbar over gradient */
.themed-bg .topbar-wrap{
  background:rgba(248,250,252,.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom:1px solid rgba(229,231,235,.9);
}

/* ----- Login page bits (unchanged behavior) ----- */
.login-hero{
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:32px 16px;
}
.login-card{
  width:100%; max-width:420px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  padding:22px 22px 20px;
}
.login-title{
  margin:4px 0 16px;
  font-size:22px; font-weight:700; color:#0f172a;
}
.login-label{
  display:block; margin:10px 0 6px;
  font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:#64748b;
}
.login-input{
  width:100%;
  appearance:none;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff; color:#111827;
  font-size:16px;
}
.login-input:focus{
  outline:none; border-color:#2f6cab; box-shadow:0 0 0 3px rgba(47,108,171,.15);
}
.login-submit{ width:100%; margin-top:16px; }
.login-alert{
  margin:0 0 10px;
  padding:10px 12px;
  border:1px solid #fecaca; background:#fef2f2; color:#7f1d1d;
  border-radius:10px; font-size:14px;
}
.login-field-error{ color:#b91c1c; font-size:13px; margin:6px 0 0; }

/* keep row items inline */
.search-row { display:flex; gap:8px; align-items:center; }

/* the panel sits below the row, full-width, and is hidden by default */
.help-panel {
  display: none;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* shown when toggled */
.help-panel.open { display: block; }

/* optional: smaller heading spacing in the panel */
.help-panel h3 { margin: 4px 0 10px; }

/* Reuse the search box look for edit/add form fields */
.input-hero {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;        /* comfortable padding */
  border-radius: 22px;       /* same “pill” feel */
}

/* For larger textareas on Illustration / Application */
.textarea-hero {
  min-height: 220px;         /* roomy by default */
  resize: vertical;
}

/* Optional: full-width layout inside your form card */
.entry-form .form-row .search-input {
  width: 100%;
}

/* Keep the same focus ring as your search input */
.search-input:focus {
  outline: none;
  border-color: #6b82ff;                 /* (matches your current focus color) */
  box-shadow: 0 0 0 3px rgba(107,130,255,.25);
}

/* ===== Solid red family background ===== */
.danger-bg {
  background: #D98482 !important;
}

/* Keep cards readable over red bg */
.danger-bg .login-card {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* Optional: translucent top bar over red bg */
.danger-bg .topbar-wrap {
  background: rgba(248,250,252,.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(229,231,235,.9);
}
/* ===== Per-user font scaling ===== */
:root { --fs-scale: 1; }
.fs-small  { --fs-scale: .90; }
.fs-default{ --fs-scale: 1; }
.fs-large  { --fs-scale: 1.10; }
.fs-xlarge { --fs-scale: 1.25; }

/* Apply broadly to reading + forms */
body, .lead-text, .page, .card, .search-input, .input-hero, .textarea-hero,
.f-label, .f-control, .btn, .nav-btn, .chip, .chip-link, .chip-subject {
  font-size: calc(1rem * var(--fs-scale));
}
.search-input, .input-hero, .textarea-hero {
  line-height: calc(1.2 * var(--fs-scale));
  padding: calc(0.75rem * var(--fs-scale)) calc(0.9rem * var(--fs-scale));
}
.history-title {
  padding-left: 16px;   /* adds white space inside the h1 */
  margin: 0;            /* keep top/bottom margins consistent */
  display: flex;        /* keeps the chevron aligned */
  align-items: center;  /* vertical align chevron with text */
  justify-content: flex-start; /* force chevron to stay left */
  gap: 8px;             /* spacing between text and chevron */
}
/* Match left/right padding and alignment like other cards */
.iotd-title{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 16px;   /* same as history-title */
  margin:0;
}

/* Inner content padding so the paragraph/button align with the title text */
.iotd-panel{
  padding:12px 16px;   /* same gutter as other panels */
}