/* search.css — tombol cari sidebar, popup pencarian, modal pratinjau, topbar. */

/* ---------- Tombol pencarian sidebar (sebelah kiri toggle) ---------- */
.side-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.side-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.side-search:hover { color: var(--ink); background: var(--surface3); }
.side-search svg, .side-toggle svg { width: 19px; height: 19px; flex: 0 0 auto; }

/* ---------- Search popup modal (melayang di tengah window) ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 13, 0.55);
  backdrop-filter: blur(2px);
  z-index: 90;
  padding: 20px;
}
.search-dialog {
  width: min(620px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  background: transparent;
  border: 0;
}
.search-field > svg { width: 22px; height: 22px; color: var(--text-secondary); flex: none; }
#searchInput {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
#searchInput::placeholder { color: var(--muted); }
.search-dialog #searchInput:focus-visible,
.search-dialog .search-close:focus-visible,
.search-dialog .suggestion:focus-visible {
  outline: 2px solid var(--line-strong);
  outline-offset: -2px;
  box-shadow: none;
}
.search-close {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.search-close:hover { background: var(--surface-hover); color: var(--ink); }
.search-divider { height: 1px; background: var(--border-subtle); }
.search-suggestions { max-height: 340px; overflow-y: auto; padding: 6px; }
.suggestion {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.suggestion svg { width: 20px; height: 20px; flex: none; }
.suggestion span { font-size: 14.5px; }
.suggestion:hover { background: var(--surface2); color: var(--ink); }
.suggestion-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.suggestion-empty svg { width: 30px; height: 30px; color: var(--faint); }

/* ---------- Preview modal & feedback & cetak ---------- */
.btn-ghost { background: var(--surface2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-ghost.danger { color: var(--danger-text); border-color: rgba(226, 106, 106, 0.42); }
.btn-ghost.danger:hover { color: #FFC2C2; border-color: var(--danger); background: rgba(226, 106, 106, 0.1); }
.btn[disabled], .btn-ghost[disabled] { opacity: 0.55; cursor: not-allowed; }
.req-hint { margin: 6px 0 0; font-size: 12.5px; min-height: 1.2em; }
.req-hint.warn { color: var(--warn); }
.req-hint.ok { color: var(--ok); }
.cite { cursor: pointer; }
.cite:hover b { text-decoration: underline; text-underline-offset: 0.2em; }
.fb { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--faint); }
.fb button { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.fb button:hover { border-color: var(--accent); }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  max-width: 720px; width: 100%; max-height: 84vh; display: flex; flex-direction: column;
  padding: 20px 24px; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; }
.modal-meta { color: var(--faint); font-size: 12.5px; margin-bottom: 12px; }
.modal-body { overflow-y: auto; color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* ---------- Topbar ---------- */
.app { flex-direction: column; }
.app-body { display: flex; flex: 1; min-height: 0; }
.notif-wrap { padding: 0; }
.notif-panel { left: auto; right: 0; top: 46px; }

/* ---------- Pertanyaan lanjutan ---------- */
.suggest { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0; }
.suggest-title { font-size: 12px; color: var(--faint); letter-spacing: 0; margin-bottom: 4px; }
.sug {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  padding: 12px 16px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sug::after {
  content: "\2192";
  flex: none;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
}
.sug:hover { background: var(--surface3); color: var(--ink); }
.sug:hover::after { color: var(--muted); }
.sug:focus-visible { outline: none; box-shadow: var(--ring); }
.sug:last-child { border-bottom: 0; }
