/* Agent Crate Caption Generator — Styles
   ======================================== */

:root {
  --accg-beige:    #FAF7F2;
  --accg-beige-dk: #F3EEE5;
  --accg-beige-bd: #DDD5C4;
  --accg-black:    #1A1A18;
  --accg-black-s:  #2E2E2A;
  --accg-white:    #FFFFFF;
  --accg-red:      #8B1A1A;
  --accg-muted:    #888178;
  --accg-border:   #E2D9CC;
}

/* ── Caption button on card — Option A (outlined pill) ───────────────────── */

.accg-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 20px;
  border: 1.5px solid var(--accg-border); background: var(--accg-white);
  font-size: 11.5px; font-weight: 600; color: var(--accg-muted);
  cursor: pointer; transition: all .15s; font-family: inherit;
  white-space: nowrap; margin-left: 4px;
}
.accg-btn:hover { border-color: var(--accg-black); color: var(--accg-black); }
.accg-btn svg { flex-shrink: 0; width: 11px; height: 11px; }

/* ── Popup ────────────────────────────────────────────────────────────────── */

#accg-popup {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
#accg-overlay {
  position: absolute; inset: 0;
  background: rgba(12,10,8,.65); backdrop-filter: blur(6px);
}
body.accg-popup-open { overflow: hidden; }

/* ── Modal ────────────────────────────────────────────────────────────────── */

#accg-modal {
  position: relative; z-index: 1;
  background: var(--accg-white); border-radius: 18px;
  box-shadow: 0 32px 80px rgba(26,26,24,.18), 0 4px 20px rgba(26,26,24,.07);
  width: 100%; max-width: 520px;
  animation: accg-up .2s ease;
  overflow: hidden;
}
@keyframes accg-up {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Header ──────────────────────────────────────────────────────────────── */

#accg-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--accg-border);
  background: var(--accg-beige);
}
.accg-header-left { display: flex; align-items: center; gap: 10px; }
.accg-header-logo {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accg-black);
  display: flex; align-items: center; justify-content: center;
}
.accg-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px; font-weight: 600; color: var(--accg-black);
}
.accg-modal-sub {
  font-size: 11px; color: var(--accg-muted);
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#accg-close {
  width: 27px; height: 27px; border-radius: 50%;
  border: 1px solid var(--accg-border); background: var(--accg-white);
  color: var(--accg-muted); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .14s; font-family: inherit; line-height: 1;
}
#accg-close:hover { background: #f5e8e8; color: var(--accg-red); border-color: #ddb8b8; }

/* ── Body ────────────────────────────────────────────────────────────────── */

#accg-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.accg-controls { display: flex; flex-direction: column; gap: 14px; }

.accg-control-group { display: flex; flex-direction: column; gap: 7px; }

.accg-ctrl-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accg-muted);
}

/* ── Chips ───────────────────────────────────────────────────────────────── */

.accg-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.accg-chip {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid var(--accg-beige-bd);
  background: var(--accg-beige);
  font-size: 12px; font-weight: 600; color: var(--accg-black-s);
  cursor: pointer; transition: all .13s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.accg-chip:hover { background: #f5e8e8; border-color: #ddb8b8; color: var(--accg-red); }
.accg-chip.accg-chip-on { background: var(--accg-black); border-color: var(--accg-black); color: var(--accg-white); }
.accg-chip-sub { font-size: 10px; font-weight: 400; opacity: .75; }

/* ── Generate button ─────────────────────────────────────────────────────── */

.accg-generate-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 11px; border: none; border-radius: 9px;
  background: var(--accg-black); color: var(--accg-white);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .18s; letter-spacing: .03em; font-family: inherit;
  margin-top: 2px;
}
.accg-generate-btn:hover { background: var(--accg-red); }
.accg-generate-btn:disabled { background: #999; cursor: not-allowed; }

/* ── Output ──────────────────────────────────────────────────────────────── */

.accg-divider { height: 1px; background: var(--accg-border); }

.accg-output-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}

.accg-output-text {
  background: var(--accg-beige); border: 1px solid var(--accg-border);
  border-radius: 10px; padding: 14px 15px;
  font-size: 13px; line-height: 1.75; color: var(--accg-black);
  white-space: pre-wrap; min-height: 80px;
}

.accg-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--accg-black-s);
  background: none; border: 1.5px solid var(--accg-border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-family: inherit; transition: all .13s;
}
.accg-copy-btn:hover { border-color: var(--accg-black); }
.accg-copy-btn.accg-copied { background: #f0fdf4; border-color: #16a34a; color: #16a34a; }

.accg-regen-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  font-size: 11.5px; font-weight: 600; color: var(--accg-muted);
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 3px 6px; border-radius: 5px; transition: all .13s;
}
.accg-regen-btn:hover { color: var(--accg-black); background: var(--accg-beige); }

#accg-output-wrap { display: flex; flex-direction: column; gap: 10px; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.accg-spin {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: white;
  border-radius: 50%; animation: accg-rot .7s linear infinite; vertical-align: middle;
}
@keyframes accg-rot { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────────────────────── */

#accg-toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--accg-black); color: #fff; padding: 8px 18px;
  border-radius: 7px; font-size: 12px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .24s; z-index: 999999;
  white-space: nowrap;
}
#accg-toast.accg-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  #accg-modal { border-radius: 14px; }
  #accg-modal-body { padding: 16px; }
}

/* ── City field ───────────────────────────────────────────────────────────── */

.accg-ctrl-optional {
  font-size: 9px; font-weight: 400; color: var(--accg-muted);
  text-transform: none; letter-spacing: 0; margin-left: 3px;
}
.accg-city-input {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  border: 1.5px solid var(--accg-border); background: var(--accg-white);
  font-family: inherit; font-size: 13px; color: var(--accg-black);
  outline: none; transition: border-color .18s;
}
.accg-city-input:focus { border-color: var(--accg-black); }
.accg-city-input::placeholder { color: var(--accg-muted); }
.accg-city-hint {
  font-size: 11px; color: var(--accg-muted); margin-top: 4px; display: block;
}
