/* ============================================================================
   LUMIQ APP POLISH — workflow panel, sidebar, output refinements
   No logic changes. Visual layer on top of existing CSS.
   ============================================================================ */

/* ── FASHION CATEGORY STRIP (Option A — inline, replaces modal) ────────── */
.fashion-cat-strip {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.fcs-gender {
  display: flex;
  gap: 6px;
}

.fcs-gender-btn {
  padding: 4px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sec);
  border-radius: var(--radius-full);
  cursor: pointer;
  font: 500 11px/1 var(--sans);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fcs-gender-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.fcs-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.fcs-chips::-webkit-scrollbar { display: none; }

.fcs-chip {
  flex-shrink: 0;
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sec);
  border-radius: var(--radius-full);
  cursor: pointer;
  font: 400 11px/1 var(--sans);
  white-space: nowrap;
  transition: all 0.15s;
}
.fcs-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-subtle);
}
.fcs-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ── SIDEBAR — active nav left-edge indicator ───────────── */
.sidebar .ni {
  position: relative;
  transition: background 0.15s, padding-left 0.2s;
}

.sidebar .ni.on {
  background: rgba(139, 26, 26, 0.08) !important;
}

.sidebar .ni.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 3px;
  background: var(--burgundy, #8b1a1a);
  border-radius: 0 2px 2px 0;
}

.sidebar .ni:hover {
  background: rgba(245, 239, 228, 0.04);
}

/* Mode toggle polish */
.mode-sw .mode-btn {
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-sw .mode-btn:hover {
  transform: translateY(-1px);
}

/* ── UPLOAD SLOT — inset glow, softer hover ──────────────── */
.isl {
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  border-style: solid !important;
  border-color: rgba(245, 239, 228, 0.08) !important;
  background: rgba(245, 239, 228, 0.015);
  box-shadow: inset 0 0 0 1px rgba(245, 239, 228, 0.04);
}

.isl:hover {
  background: rgba(245, 239, 228, 0.04);
  border-color: rgba(245, 239, 228, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 239, 228, 0.1);
}

.isl.dragover {
  background: rgba(139, 26, 26, 0.08);
  border-color: rgba(139, 26, 26, 0.5) !important;
  transform: scale(1.01);
}

/* ── PILLS — thin border refinement ──────────────────────── */
.pill, .toggle-pills .pill {
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.pill:hover {
  transform: scale(1.02);
  border-color: rgba(245, 239, 228, 0.35);
}

.pill.on, .toggle-pills .pill.on {
  transform: scale(1.04);
}

/* ── INPUT GROUPS — better rhythm ────────────────────────── */
.ig {
  padding-bottom: 4px;
}

.ig label {
  opacity: 0.75;
  letter-spacing: 0.06em;
}

/* ── GEN BAR — command palette treatment ─────────────────── */
.gen-bar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
}

.btn-generate {
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  letter-spacing: 0.04em;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 26, 26, 0.3);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Generate button loading — morph into progress shimmer */
.btn-generate-loading {
  position: relative;
  overflow: hidden;
  cursor: wait !important;
  opacity: 1 !important;
}

.btn-generate-loading::after {
  content: '';
  position: absolute;
  left: -40%;
  top: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 239, 228, 0.25) 50%,
    transparent 100%
  );
  animation: genProgressShimmer 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes genProgressShimmer {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Editorial spinner label refinement */
.spin-lbl {
  animation: spinLblPulse 1.8s ease-in-out infinite;
}

@keyframes spinLblPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.9; }
}

/* ── INPUT GROUPS — hairline dividers between groups ─────── */
.ig + .ig {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(139, 26, 26, 0.08);
}

/* ── SIDEBAR NAV — better vertical rhythm ────────────────── */
.sidebar .ni {
  padding-top: 9px;
  padding-bottom: 9px;
}

.sidebar .ni + .ni {
  margin-top: 2px;
}

/* ── PROMPT TEXTAREAS — comfortable middle-ground size ───── */
.ta.instructions-input {
  min-height: 80px;
  padding: 12px 14px;
  line-height: 1.5;
}
/* Plain .ta (notes/prompts without the instructions-input class) */
textarea.ta:not(.instructions-input):not(.small-note):not([rows="1"]):not([rows="2"]):not([rows="3"]) {
  min-height: 72px;
  line-height: 1.5;
}

.ta:focus {
  border-left: 2px solid var(--burgundy, #8b1a1a);
  padding-left: 14px;
}

/* ── OUTPUT PANEL — refined action overlay ───────────────── */
.o-slot {
  transition: transform 0.2s;
}

.o-slot:hover {
  transform: translateY(-2px);
}

.o-ov {
  transition: opacity 0.25s ease-out;
}

.ov-btn {
  transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-btn:hover {
  transform: translateY(-1px);
  background: rgba(245, 239, 228, 0.18) !important;
}

.ov-btn.pf {
  background: rgba(139, 26, 26, 0.25) !important;
  color: #f5efe4;
}

.ov-btn.pf:hover {
  background: var(--burgundy, #8b1a1a) !important;
}

/* Slot number — mono editorial style */
.o-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

/* Spinner refinement */
.spin {
  border-top-color: var(--burgundy, #8b1a1a) !important;
}

.spin-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ── HISTORY / PORTFOLIO — category filter chips ─────────── */
.hist-filters, .pf-filters {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border, rgba(245,239,228,0.08));
  flex-wrap: wrap;
}

.hist-filter, .pf-filter {
  padding: 6px 14px;
  border: 1px solid rgba(245, 239, 228, 0.15);
  background: transparent;
  color: var(--text-sec, rgba(245,239,228,0.55));
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.hist-filter:hover, .pf-filter:hover {
  border-color: rgba(245, 239, 228, 0.35);
  color: var(--text, #f5efe4);
}

.hist-filter.on, .pf-filter.on {
  background: var(--burgundy, #8b1a1a);
  color: #fff;
  border-color: var(--burgundy, #8b1a1a);
}

/* ── PROMPT TEMPLATES BAR ────────────────────────────────── */
.tpl-bar {
  display: flex;
  gap: 6px;
  padding: 8px 20px 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tpl-btn {
  padding: 5px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: rgba(245, 239, 228, 0.6);
  border: 1px solid rgba(245, 239, 228, 0.15);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.tpl-btn:hover {
  color: rgba(245, 239, 228, 0.95);
  border-color: rgba(245, 239, 228, 0.3);
  background: rgba(245, 239, 228, 0.04);
}

.tpl-btn-save {
  border-color: rgba(139, 26, 26, 0.3);
  color: rgba(245, 239, 228, 0.75);
}

.tpl-btn-save:hover {
  background: rgba(139, 26, 26, 0.12);
  border-color: var(--burgundy, #8b1a1a);
}

.tpl-select-wrap {
  position: relative;
}

.tpl-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  background: #111;
  border: 1px solid rgba(245, 239, 228, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 6px;
  display: none;
  z-index: 50;
}

.tpl-menu.open {
  display: block;
}

.tpl-empty {
  padding: 14px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(245, 239, 228, 0.4);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tpl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.tpl-item:hover {
  background: rgba(245, 239, 228, 0.05);
}

.tpl-item-name {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: rgba(245, 239, 228, 0.92);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl-item-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(245, 239, 228, 0.4);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.tpl-item-del {
  background: transparent;
  border: none;
  color: rgba(245, 239, 228, 0.3);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.12s;
  flex-shrink: 0;
}

.tpl-item-del:hover {
  background: rgba(139, 26, 26, 0.2);
  color: #fff;
}

/* ── BRAND KIT ─────────────────────────────────────────────── */

/* Indicator button in gen bar */
.bk-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(245, 239, 228, 0.15);
  border-radius: 999px;
  color: rgba(245, 239, 228, 0.65);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  height: 32px;
  margin-right: 6px;
}

.bk-indicator:hover {
  border-color: rgba(245, 239, 228, 0.35);
  color: rgba(245, 239, 228, 0.95);
}

.bk-indicator.on {
  background: rgba(139, 26, 26, 0.15);
  border-color: var(--burgundy, #8b1a1a);
  color: var(--cream, #f5efe4);
}

.bk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(245, 239, 228, 0.25);
}

.bk-indicator.on .bk-dot {
  background: var(--green, #4caf50);
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

/* Modal */
.bk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  /* C3: stack above toast (10000) and mobile hamburger (10010+) */
  z-index: 10020;
  animation: bkFade 0.2s ease-out;
}

@keyframes bkFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bk-modal {
  width: 520px;
  max-width: calc(100vw - 32px);
  /* C1: fallback for non-dvh browsers, then override with dvh for iOS Safari URL-bar chrome */
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  background: #111;
  border: 1px solid rgba(245, 239, 228, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  animation: bkSlideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* C2: hide indicator label on narrow screens so Generate button keeps its space */
@media (max-width: 420px) {
  .bk-indicator {
    padding: 6px 10px;
    gap: 0;
  }
  .bk-indicator .bk-indicator-lbl { display: none; }
}

@keyframes bkSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bk-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 12px;
  border-bottom: 1px solid rgba(245, 239, 228, 0.06);
}

.bk-head h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--cream, #f5efe4);
  margin: 0;
}

.bk-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.45);
  margin: 6px 0 0;
}

.bk-x {
  background: transparent;
  border: 1px solid rgba(245, 239, 228, 0.1);
  color: rgba(245, 239, 228, 0.6);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.bk-x:hover {
  border-color: rgba(245, 239, 228, 0.3);
  color: var(--cream, #f5efe4);
}

.bk-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bk-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.6);
}

.bk-input, .bk-textarea {
  width: 100%;
  background: rgba(245, 239, 228, 0.02);
  border: 1px solid rgba(245, 239, 228, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--cream, #f5efe4);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}

.bk-textarea { resize: vertical; min-height: 72px; font-family: 'Outfit', sans-serif; line-height: 1.5; }

.bk-input:focus, .bk-textarea:focus {
  outline: none;
  border-color: var(--burgundy, #8b1a1a);
  background: rgba(245, 239, 228, 0.04);
}

.bk-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.bk-col {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bk-color {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(245, 239, 228, 0.1);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.bk-color::-webkit-color-swatch-wrapper { padding: 4px; }
.bk-color::-webkit-color-swatch { border: none; border-radius: 4px; }

.bk-hex {
  flex: 1;
  min-width: 0;
  background: rgba(245, 239, 228, 0.02);
  border: 1px solid rgba(245, 239, 228, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--cream, #f5efe4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.bk-hex:focus {
  outline: none;
  border-color: var(--burgundy, #8b1a1a);
}

.bk-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(139, 26, 26, 0.06);
  border: 1px solid rgba(139, 26, 26, 0.15);
  border-radius: 10px;
  cursor: pointer;
}

.bk-toggle {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--burgundy, #8b1a1a);
  cursor: pointer;
  flex-shrink: 0;
}

.bk-toggle-lbl {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bk-toggle-lbl strong {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream, #f5efe4);
}

.bk-toggle-lbl em {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 10px;
  color: rgba(245, 239, 228, 0.5);
  letter-spacing: 0.05em;
}

.bk-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(245, 239, 228, 0.06);
}

.bk-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s;
}

.bk-btn-sec {
  background: transparent;
  color: rgba(245, 239, 228, 0.6);
  border: 1px solid rgba(245, 239, 228, 0.15);
}

.bk-btn-sec:hover {
  color: var(--cream, #f5efe4);
  border-color: rgba(245, 239, 228, 0.3);
}

.bk-btn-pri {
  background: var(--burgundy, #8b1a1a);
  color: #fff;
  border: 1px solid var(--burgundy, #8b1a1a);
}

.bk-btn-pri:hover {
  background: #a32020;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 26, 26, 0.4);
}

@media (max-width: 600px) {
  .bk-modal { width: 100%; max-width: 100%; border-radius: 14px 14px 0 0; margin-top: auto; }
  .bk-overlay { align-items: flex-end; }
  .bk-colors { grid-template-columns: 1fr; }
  /* C4: hide the fixed gen-bar while the bottom-sheet modal is up */
  body.bk-modal-open .gen-bar { visibility: hidden; }
}

/* ── PROFILE POPUP — polish already-shipped popup ─────────── */
.profile-popup-card {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.profile-nav-item svg {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.profile-nav-item:hover svg {
  opacity: 1;
}
