/* ═══════════════════════════════════════════
   Prompts Hub — Status groups, prompt cards,
   detail modal, create modal.
   Uses shared layout: .page-header, .tabs, .tab, .panel
   ═══════════════════════════════════════════ */

/* ─── Status Groups ─── */
.prompt-group {
  margin-bottom: 8px;
}

.prompt-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0 12px;
}

.prompt-group__title {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-bark-faint);
}

.prompt-group__count {
  font-family: var(--sc-font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--sc-cream-dark);
  color: var(--sc-text-tertiary);
  padding: 1px 7px;
  border-radius: 10px;
}

.prompt-group__line {
  flex: 1;
  height: 1px;
  background: var(--sc-border-subtle);
}

.prompt-group--active .prompt-group__count {
  background: rgba(184, 96, 63, 0.1);
  color: var(--sc-rust);
}

/* ─── Prompt Cards ─── */
.prompt-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-card {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  text-decoration: none;
  color: inherit;
}

.prompt-card:hover {
  border-color: var(--sc-sand);
  box-shadow: 0 2px 12px rgba(90, 64, 50, 0.06);
}

/* Left — visual column */
.prompt-card__visual {
  width: 110px;
  flex-shrink: 0;
  background: var(--sc-cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.prompt-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-card__visual--icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--sc-border);
  fill: none;
  stroke-width: 1.5;
}

/* Right — content column */
.prompt-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.prompt-card__body {
  flex: 1;
  padding: 14px 16px;
}

/* Top line: type + source + status */
.prompt-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.prompt-card__type {
  font-family: var(--sc-font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.prompt-card__type--standard  { color: var(--sc-rust); background: rgba(184, 96, 63, 0.08); }
.prompt-card__type--character { color: var(--sc-bark); background: rgba(92, 64, 51, 0.06); }
.prompt-card__type--memory    { color: var(--sc-sage); background: rgba(107, 127, 94, 0.08); }

.prompt-card__source {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-card__source svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
}

.prompt-card__source a { color: var(--sc-rust); text-decoration: none; }
.prompt-card__source a:hover { text-decoration: underline; }

.prompt-card__status {
  font-family: var(--sc-font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.prompt-card__status--pending     { color: var(--sc-rust); background: rgba(184, 96, 63, 0.08); }
.prompt-card__status--in-progress { color: var(--sc-status-in-progress); background: var(--sc-status-in-progress-bg); }
.prompt-card__status--completed   { color: var(--sc-sage); background: rgba(107, 127, 94, 0.08); }
.prompt-card__status--archived    { color: var(--sc-text-tertiary); background: var(--sc-cream-dark); }

.prompt-card__question {
  font-family: var(--sc-font-body);
  font-size: 0.92rem;
  color: var(--sc-bark);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--sc-border-subtle);
  margin: 0 16px;
  padding: 10px 0 12px;
  margin-top: auto;
}

.prompt-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

.prompt-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-card__meta-item svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
}

.prompt-card__person {
  display: flex;
  align-items: center;
  gap: 5px;
}

.prompt-card__person-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-size: 0.5rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.prompt-card__respond-btn {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: white;
  background: var(--sc-rust);
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.prompt-card__respond-btn:hover { background: var(--sc-bark); }

.prompt-card__view-btn {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sc-bark-faint);
  background: none;
  border: 1px solid var(--sc-border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.prompt-card__view-btn:hover {
  border-color: var(--sc-sand);
  color: var(--sc-bark);
}

/* Photo count badge on visual column */
.prompt-card__visual[data-count]::after {
  content: attr(data-count);
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(58, 53, 48, 0.72);
  color: white;
  font-family: var(--sc-font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* ─── Prompt Detail Modal ─── */

.prompt-detail__source-ref {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--sc-border-subtle);
  margin-bottom: 20px;
  cursor: default;
}

.prompt-detail__source-ref--character {
  background: rgba(92, 64, 51, 0.04);
  border-color: rgba(92, 64, 51, 0.15);
}

.prompt-detail__source-ref--memory {
  background: rgba(107, 127, 94, 0.04);
  border-color: rgba(107, 127, 94, 0.15);
}

.prompt-detail__source-ref-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prompt-detail__source-ref-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prompt-detail__source-ref--character .prompt-detail__source-ref-icon {
  background: rgba(92, 64, 51, 0.1);
}

.prompt-detail__source-ref--character .prompt-detail__source-ref-icon svg {
  stroke: var(--sc-bark);
}

.prompt-detail__source-ref--memory .prompt-detail__source-ref-icon {
  background: rgba(107, 127, 94, 0.1);
}

.prompt-detail__source-ref--memory .prompt-detail__source-ref-icon svg {
  stroke: var(--sc-sage);
}

.prompt-detail__source-ref-label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

.prompt-detail__source-ref-title {
  font-family: var(--sc-font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sc-bark);
}

.prompt-detail__question {
  font-family: var(--sc-font-display);
  font-size: 1.2rem;
  color: var(--sc-charcoal);
  line-height: 1.5;
  margin-bottom: 20px;
}

.prompt-detail__question-edit {
  width: 100%;
  font-family: var(--sc-font-body);
  font-size: 0.92rem;
  color: var(--sc-text-primary);
  background: var(--sc-cream);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 80px;
  resize: vertical;
  margin-bottom: 12px;
}

.prompt-detail__question-edit:focus {
  outline: none;
  border-color: var(--sc-rust-soft);
}

.prompt-detail__edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.prompt-detail__photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.prompt-detail__photo {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: none;
  padding: 0;
  background: var(--sc-cream-dark);
  cursor: pointer;
  transition: transform var(--sc-transition-fast);
}

.prompt-detail__photo:hover {
  transform: scale(1.03);
}

.prompt-detail__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prompt-detail__photo-hover {
  position: absolute;
  inset: 0;
  background: rgba(58, 53, 48, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--sc-transition-fast);
}

.prompt-detail__photo-hover svg {
  width: 24px;
  height: 24px;
  stroke: white;
  fill: none;
  opacity: 0;
  transition: opacity var(--sc-transition-fast);
}

.prompt-detail__photo:hover .prompt-detail__photo-hover {
  background: rgba(58, 53, 48, 0.35);
}

.prompt-detail__photo:hover .prompt-detail__photo-hover svg {
  opacity: 1;
}

.prompt-detail__photo--loading {
  cursor: default;
}

.prompt-detail__photo--loading:hover {
  transform: none;
}

.prompt-detail__photo-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--sc-cream-dark) 25%, var(--sc-cream) 50%, var(--sc-cream-dark) 75%);
  background-size: 200% 100%;
  animation: prompt-photo-shimmer 1.5s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes prompt-photo-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.prompt-detail__photo-more {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  background: var(--sc-cream-dark);
  border: 1px solid var(--sc-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sc-text-tertiary);
}

/* Photo wrapper for edit mode remove button */
.prompt-detail__photo-wrap {
  position: relative;
}

.prompt-detail__photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(58, 53, 48, 0.8);
  color: white;
  border: 2px solid var(--sc-warm-white);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background var(--sc-transition-fast);
}

.prompt-detail__photo-remove:hover {
  background: var(--sc-error);
}

/* Inline confirm for photo removal */
.prompt-detail__photo-confirm {
  position: absolute;
  inset: 0;
  background: rgba(58, 53, 48, 0.6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.prompt-detail__photo-confirm-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--sc-transition-fast);
}

.prompt-detail__photo-confirm-btn:hover {
  transform: scale(1.1);
}

.prompt-detail__photo-confirm-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: white;
}

.prompt-detail__photo-confirm-btn--yes {
  background: var(--sc-error);
}

.prompt-detail__photo-confirm-btn--no {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}

.prompt-detail__photo--new {
  border: 2px dashed var(--sc-border);
  cursor: default;
}

.prompt-detail__photo--new:hover {
  transform: none;
}

/* Photo actions row */
.prompt-detail__photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.prompt-detail__add-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sc-bark-faint);
  border: 1px dashed var(--sc-border);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color var(--sc-transition-fast), color var(--sc-transition-fast);
}

.prompt-detail__add-photo-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.prompt-detail__add-photo-btn:hover {
  border-color: var(--sc-rust-soft);
  color: var(--sc-bark);
}

.prompt-detail__upload-btn {
  font-size: 0.78rem;
  padding: 7px 14px;
}

.prompt-detail__photos-section {
  margin-bottom: 20px;
}

/* Confirmation bar */
.prompt-detail__confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(184, 96, 63, 0.06);
  border: 1px solid rgba(184, 96, 63, 0.15);
  border-radius: 10px;
  margin-bottom: 16px;
}

.prompt-detail__confirm-msg {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-bark);
  line-height: 1.4;
}

.prompt-detail__confirm-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.prompt-detail__meta {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--sc-border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.prompt-detail__meta-col {
  flex: 1;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prompt-detail__meta-col + .prompt-detail__meta-col {
  border-left: 1px solid var(--sc-border-subtle);
}

.prompt-detail__meta-sublabel {
  font-family: var(--sc-font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sc-text-tertiary);
  line-height: 1;
}

.prompt-detail__meta-person {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sc-font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--sc-bark);
}

.prompt-detail__meta-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-size: 0.55rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.prompt-detail__meta-date {
  font-family: var(--sc-font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sc-bark);
}

.prompt-detail__linked-memory {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(107, 127, 94, 0.06);
  border: 1px solid rgba(107, 127, 94, 0.15);
  border-radius: 10px;
  margin-bottom: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--sc-transition-fast);
}

.prompt-detail__linked-memory:hover {
  border-color: var(--sc-sage);
}

.prompt-detail__linked-memory-icon {
  width: 36px;
  height: 36px;
  background: rgba(107, 127, 94, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prompt-detail__linked-memory-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-sage);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prompt-detail__linked-memory-label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

.prompt-detail__linked-memory-title {
  font-family: var(--sc-font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sc-sage);
}

.prompt-detail__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--sc-border-subtle);
  padding-top: 16px;
}

.prompt-detail__badges {
  display: flex;
  gap: 16px;
}

.prompt-detail__badge-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prompt-detail__badge-label {
  font-family: var(--sc-font-ui);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sc-text-tertiary);
}

/* ─── Create Prompt Form ─── */

.prompt-form__field {
  margin-bottom: 18px;
}

.prompt-form__label {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sc-bark);
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prompt-form__label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--sc-text-tertiary);
}

/* Styled native select */
.prompt-form__select-wrap {
  position: relative;
  display: block;
}

.prompt-form__select {
  width: 100%;
  font-family: var(--sc-font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sc-bark);
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 14px 40px 14px 18px;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color var(--sc-transition-fast);
}

.prompt-form__select:focus {
  border-color: var(--sc-rust-soft);
}

.prompt-form__select option {
  font-family: var(--sc-font-ui);
  padding: 8px;
}

.prompt-form__select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--sc-bark-faint);
  pointer-events: none;
}

.prompt-form__textarea {
  width: 100%;
  font-family: var(--sc-font-body);
  font-size: 0.92rem;
  color: var(--sc-text-primary);
  background: var(--sc-cream);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 80px;
  resize: vertical;
}

.prompt-form__textarea:focus {
  outline: none;
  border-color: var(--sc-rust-soft);
}

.prompt-form__textarea::placeholder {
  color: var(--sc-text-tertiary);
}

.prompt-detail__preview-link {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-rust);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.prompt-detail__preview-link:hover {
  text-decoration: underline;
}

.prompt-form__photo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--sc-border);
  border-radius: 10px;
  padding: 28px 20px;
  cursor: pointer;
  color: var(--sc-text-tertiary);
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  transition: border-color var(--sc-transition-fast), background var(--sc-transition-fast);
}

.prompt-form__photo-area svg {
  width: 28px;
  height: 28px;
  stroke: var(--sc-border);
  fill: none;
  flex-shrink: 0;
}

.prompt-form__photo-area:hover {
  border-color: var(--sc-rust-soft);
  background: rgba(184, 96, 63, 0.02);
}

.prompt-form__photo-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.prompt-form__photo-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.prompt-form__photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-form__photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(58, 53, 48, 0.72);
  color: white;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .prompt-card { flex-direction: column; }
  .prompt-card__visual { width: 100%; height: 120px; }
  .prompt-card__footer { flex-wrap: wrap; }
  .prompt-card__respond-btn { width: 100%; text-align: center; }

  .prompt-detail__meta { flex-direction: column; }
  .prompt-detail__meta-col + .prompt-detail__meta-col { border-left: none; border-top: 1px solid var(--sc-border-subtle); }
  .prompt-detail__footer { flex-direction: column; align-items: stretch; }
}
