/*
 * OWGE — Facilitator Dilemma Library & Import CSS
 * Tokens from v2-shell.css assumed: --bg, --bg-2, --bg-3, --line,
 * --text, --muted, --accent, --gold, --radius-sm, --radius-md
 */

/* ── Library toolbar ─────────────────────────────────────────── */
.fdl-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.fdl-search {
  flex: 1 1 200px;
  min-width: 160px;
}

.fdl-filter {
  flex: 0 0 auto;
  min-width: 150px;
}

.fdl-count {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Library card grid ───────────────────────────────────────── */
.fdl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.fdl-card {
  background: var(--bg-3, #111c2d);
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: var(--radius-sm, 12px);
  padding: 1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: border-color .15s, box-shadow .15s;
}

.fdl-card:hover {
  border-color: var(--line-strong, rgba(111,182,255,.30));
  box-shadow: 0 2px 16px rgba(0,0,0,.22);
}

.fdl-card-head {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.fdl-chip {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.fdl-chip--cat {
  background: rgba(111,182,255,.15);
  color: var(--accent, #6fb6ff);
}

.fdl-chip--scene {
  background: rgba(215,174,94,.15);
  color: var(--gold, #d7ae5e);
}

.fdl-card-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text, #e8eef9);
  line-height: 1.35;
}

.fdl-card-summary {
  font-size: .8rem;
  color: var(--muted, #97a6bf);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.fdl-card-opts {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-top: .1rem;
}

.fdl-card-opt {
  font-size: .75rem;
  color: var(--muted, #97a6bf);
  display: flex;
  align-items: baseline;
  gap: .4rem;
  line-height: 1.35;
}

.fdl-card-opt-lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(111,182,255,.15);
  color: var(--accent, #6fb6ff);
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fdl-card-opt-desc {
  color: rgba(151,166,191,.6);
}

.fdl-card-foot {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-top: auto;
  padding-top: .6rem;
}

/* ── Edit-before-push overlay ────────────────────────────────── */
.fdl-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,16,28,.72);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.fdl-editor-panel {
  background: var(--bg-2, #0f1726);
  border: 1px solid var(--line-strong, rgba(111,182,255,.30));
  border-radius: var(--radius-md, 16px);
  padding: 1.75rem 2rem 2rem;
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.fdl-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fdl-editor-head h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #e8eef9);
  margin: 0;
}

.fdl-editor-foot {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: .5rem;
  border-top: 1px solid var(--line, rgba(255,255,255,.10));
}

.fdl-push-status {
  font-size: .82rem;
  flex: 1 1 auto;
}

.fdl-push-status[data-state="ok"]    { color: #6ee09a; }
.fdl-push-status[data-state="error"] { color: #e07f7f; }

/* option rows inside editor */
.fdl-ed-opt-row {
  background: var(--bg-3, #111c2d);
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: var(--radius-sm, 12px);
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: .6rem;
}

.fdl-ed-opt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--muted, #97a6bf);
}

.f-dil-divider-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #97a6bf);
  margin-bottom: .4rem;
}

/* ── Import drop zone ────────────────────────────────────────── */
.fdl-drop-zone {
  border: 2px dashed var(--line-strong, rgba(111,182,255,.30));
  border-radius: var(--radius-md, 16px);
  background: var(--bg-3, #111c2d);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.fdl-drop-zone:hover,
.fdl-drop-zone:focus,
.fdl-drop-zone.is-over {
  border-color: var(--accent, #6fb6ff);
  background: rgba(111,182,255,.06);
  outline: none;
}

.fdl-drop-icon {
  font-size: 2.5rem;
  color: var(--accent, #6fb6ff);
  opacity: .7;
}

.fdl-drop-label {
  font-size: .9rem;
  color: var(--muted, #97a6bf);
}

.fdl-drop-link {
  color: var(--accent, #6fb6ff);
  text-decoration: underline;
  cursor: pointer;
}

.fdl-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  /* pointer events handled via click on parent */
  pointer-events: none;
}

/* ── Import status banner ────────────────────────────────────── */
.fdl-import-status {
  font-size: .84rem;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm, 12px);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.fdl-import-status[data-state="ok"] {
  background: rgba(110,224,154,.10);
  border-color: rgba(110,224,154,.25);
  color: #6ee09a;
}

.fdl-import-status[data-state="error"] {
  background: rgba(224,127,127,.10);
  border-color: rgba(224,127,127,.25);
  color: #e07f7f;
}

/* ── Import preview cards ────────────────────────────────────── */
.fdl-import-preview {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.fdl-imp-card {
  background: var(--bg-3, #111c2d);
  border: 1px solid var(--line, rgba(255,255,255,.10));
  border-radius: var(--radius-sm, 12px);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.fdl-imp-card-num {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold, #d7ae5e);
}

.fdl-push-done {
  font-size: .8rem;
  color: #6ee09a;
  font-weight: 600;
}

/* ── Toast ───────────────────────────────────────────────────── */
.fdl-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-2, #0f1726);
  border: 1px solid var(--line-strong, rgba(111,182,255,.3));
  border-radius: 999px;
  padding: .55rem 1.4rem;
  font-size: .84rem;
  color: var(--text, #e8eef9);
  white-space: nowrap;
  z-index: 9000;
  transition: transform .22s cubic-bezier(.22,1,.36,1), opacity .22s;
  opacity: 0;
  pointer-events: none;
}

.fdl-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.fdl-toast[data-state="ok"] { border-color: rgba(110,224,154,.4); }
.fdl-toast[data-state="error"] { border-color: rgba(224,127,127,.4); color: #e07f7f; }
