/* =============================================
   CAPTIONS PAGE STYLES
   ============================================= */

.captions-dashboard {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 100px;
}

/* ---- Prompt Section ---- */
.prompt-section {
  background: #fffdf9;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}

.prompt-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #7a6855;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.prompt-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  color: #4a3728;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.prompt-textarea:focus {
  outline: none;
  border-color: #7a6855;
  box-shadow: 0 0 0 2px rgba(122,104,85,0.12);
}
.prompt-textarea::placeholder {
  color: #b5a090;
}

/* Saved prompts row */
.saved-prompts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.saved-prompts-label {
  font-size: 12px;
  color: #a08060;
  white-space: nowrap;
  font-weight: 500;
}

.saved-prompts-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.saved-prompts-scroll::-webkit-scrollbar { height: 3px; }
.saved-prompts-scroll::-webkit-scrollbar-thumb { background: #d4c5b0; border-radius: 2px; }

.saved-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 5px 10px 5px 12px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.saved-prompt-chip:hover {
  background: #e2d8cb;
}
.saved-prompt-chip .chip-del {
  background: none;
  border: none;
  color: #a08060;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  display: flex;
  align-items: center;
}
.saved-prompt-chip .chip-del:hover { color: #c0392b; }

.no-saved-prompts {
  font-size: 12px;
  color: #b5a090;
  font-style: italic;
}

/* Save prompt row */
.save-prompt-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.save-prompt-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #4a3728;
  font-family: inherit;
  min-width: 0;
}
.save-prompt-input:focus {
  outline: none;
  border-color: #7a6855;
}
.save-prompt-input::placeholder { color: #b5a090; }

.save-prompt-btn {
  padding: 8px 14px;
  background: #7a6855;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.save-prompt-btn:hover { background: #5d4f3e; }
.save-prompt-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ---- Upload + Generate Row ---- */
.upload-generate-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.upload-photos-btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 10px;
  font-size: 14px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.upload-photos-btn:hover { background: #e2d8cb; }

.generate-all-btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s;
}
.generate-all-btn:hover:not(:disabled) { background: #99473A; }
.generate-all-btn:disabled { background: #ccc; cursor: not-allowed; }

.generate-all-btn .btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: capSpin 0.7s linear infinite;
  display: none;
}
.generate-all-btn.loading .btn-spinner { display: inline-block; }
.generate-all-btn.loading .btn-label { opacity: 0.8; }

@keyframes capSpin { to { transform: rotate(360deg); } }

/* ---- Photo + Caption Pairs ---- */
.photo-caption-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.photo-caption-pair {
  background: #fffdf9;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  overflow: hidden;
}

.pair-photo-wrap {
  width: 100%;
  background: #f5efe6;
  position: relative;
}
.pair-photo-wrap img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
}

.pair-photo-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.pair-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.4);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.pair-remove-btn:hover { background: rgba(192,57,43,0.8); }

.pair-caption-body {
  padding: 14px 16px;
}

.pair-caption-label {
  font-size: 12px;
  font-weight: 600;
  color: #a08060;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pair-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.pair-copy-btn:hover { background: #e2d8cb; }
.pair-copy-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pair-caption-text {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  color: #4a3728;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}
.pair-caption-text:focus {
  outline: none;
  border-color: #7a6855;
  box-shadow: 0 0 0 2px rgba(122,104,85,0.12);
}
.pair-caption-text::placeholder { color: #b5a090; font-style: italic; }

/* Generating state shimmer */
.pair-caption-text.generating {
  background: linear-gradient(90deg, #f5efe6 25%, #fffdf9 50%, #f5efe6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  color: transparent;
  pointer-events: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty / no photos state */
.captions-no-photos {
  text-align: center;
  padding: 40px 20px;
  color: #b0998a;
  font-size: 14px;
  border: 2px dashed #e2d8cb;
  border-radius: 12px;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .upload-generate-row { flex-direction: column; }
  .upload-photos-btn, .generate-all-btn { width: 100%; }
  .pair-photo-wrap img { max-height: 240px; }
}
