/* ── AskAncients — Wisdom Well CSS ──
   Saved perspectives library with collections, pinning, and views.
*/

/* ── Layout ── */
body { align-items: flex-start; }
.container { margin-top: 10px; }
.header { padding: 30px 30px; }
.header-top { margin-bottom: 8px; }
.header h1 { font-size: 28px; margin-bottom: 0; }
.header p { font-size: 15px; opacity: 0.9; }

/* ── Pinned section ── */
.well-pinned { margin-bottom: 16px; }
.well-pinned-label {
  font-size: 12px;
  font-weight: 600;
  color: #98a0ad;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.well-pinned-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.well-pinned-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffcf5;
  border: 1px solid #f0e6d0;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.well-pinned-card:hover { border-color: #ddd2b8; }

/* Parchment pinned card */
.page-well .well-pinned-card {
  background: transparent;
  border-color: rgba(160, 140, 110, 0.2);
}
.page-well .well-pinned-card:hover {
  background: rgba(255, 250, 240, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(160, 140, 110, 0.35);
}
.well-pinned-mono {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.well-pinned-info { flex: 1; min-width: 0; }
.well-pinned-name {
  font-size: 13px; font-weight: 600; color: #1a1d23;
  margin-bottom: 2px;
}
.well-pinned-excerpt {
  font-size: 12px; color: #5e6470;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.well-pinned-unpin {
  background: none; border: none; cursor: pointer;
  color: #98a0ad; font-size: 14px; padding: 4px;
  transition: color 0.2s;
}
.well-pinned-unpin:hover { color: #e74c3c; }

/* ── Controls bar ── */
.well-controls { margin-bottom: 16px; }
.well-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.well-views {
  display: flex;
  gap: 4px;
  background: #f0f1f5;
  border-radius: 8px;
  padding: 3px;
}

/* Parchment views bar */
.page-well .well-views {
  background: rgba(255, 250, 240, 0.4);
}
.well-view-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: #5e6470; padding: 6px 12px;
  border-radius: 6px; transition: all 0.2s;
  white-space: nowrap;
}
.well-view-btn.active {
  background: #fff; color: #1a1d23;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Parchment active view tab */
.page-well .well-view-btn.active {
  background: rgba(255, 250, 240, 0.7);
}
.well-search-wrap { flex: 0 0 auto; }
.well-search {
  width: 160px; padding: 7px 12px;
  border: 1px solid #e6e8ee; border-radius: 8px;
  font-size: 13px; color: #1a1d23;
  background: #fff; transition: border-color 0.2s;
}

/* Parchment search */
.page-well .well-search {
  background: rgba(255, 250, 240, 0.6);
  border-color: rgba(200, 190, 170, 0.4);
}
.well-search:focus { outline: none; border-color: #667eea; }
.well-search::placeholder { color: #98a0ad; }

/* ── Collections pill bar ── */
.well-collections-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.well-collections-bar::-webkit-scrollbar { height: 0; }
.well-col-pill {
  background: #f0f1f5; border: 1px solid transparent;
  border-radius: 16px; padding: 5px 14px;
  font-size: 12px; font-weight: 500;
  color: #5e6470; cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
  flex-shrink: 0;
}

/* Parchment collection pills */
.page-well .well-col-pill {
  background: rgba(255, 250, 240, 0.4);
  border-color: rgba(160, 140, 110, 0.15);
}
.page-well .well-col-pill:not(.active):hover {
  background: rgba(255, 250, 240, 0.6);
}
.well-col-pill.active {
  background: #667eea; color: #fff;
  border-color: #667eea;
}
.well-col-pill:not(.active):hover { background: #e6e8ee; }
.well-col-add {
  font-size: 16px; font-weight: 700;
  padding: 5px 12px; color: #667eea;
}
.well-col-count {
  font-size: 11px; color: inherit; opacity: 0.7;
  margin-left: 3px;
}

/* ── New collection inline form ── */
.well-new-col {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 16px;
}
.well-new-col-input {
  flex: 1; padding: 8px 12px;
  border: 1px solid #e6e8ee; border-radius: 8px;
  font-size: 13px; color: #1a1d23;
}
.well-new-col-input:focus { outline: none; border-color: #667eea; }
.well-new-col-save, .well-new-col-cancel {
  padding: 8px 14px; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.well-new-col-save {
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%); color: #fff;
}
.well-new-col-cancel {
  background: #f0f1f5; color: #5e6470;
}

/* Parchment new-collection form */
.page-well .well-new-col-input {
  background: rgba(255, 250, 240, 0.6);
  border-color: rgba(200, 190, 170, 0.4);
}
.page-well .well-new-col-cancel {
  background: rgba(255, 250, 240, 0.5);
}

/* ── Perspective cards ── */
.well-entries { display: flex; flex-direction: column; gap: 14px; }

.well-entry {
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  padding: 20px 22px;
  transition: border-color 0.2s;
}

/* Parchment entry card */
.page-well .well-entry {
  background: transparent;
  border-color: rgba(160, 140, 110, 0.2);
}
.page-well .well-entry:hover {
  background: rgba(255, 250, 240, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(160, 140, 110, 0.35);
}

.well-entry-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.well-mono {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.well-entry-header-text { flex: 1; min-width: 0; }
.well-entry-header-text h3 {
  font-size: 16px; font-weight: 700; color: #1a1d23;
  margin: 0 0 3px;
}
.well-entry-bio {
  font-size: 12px; color: #5e6470;
  margin-bottom: 4px;
}
.well-school-badge {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  color: #667eea; background: rgba(102,126,234,0.08);
  padding: 2px 8px; border-radius: 10px;
}

.well-entry-meta {
  font-size: 12px; color: #98a0ad;
  text-align: right; flex-shrink: 0;
}
.well-entry-pin {
  display: block; background: none; border: none;
  cursor: pointer; color: #ccc; font-size: 16px;
  margin-top: 4px; padding: 2px;
  transition: color 0.2s;
}
.well-entry-pin:hover { color: #e6a817; }
.well-entry-pin.pinned { color: #e6a817; }

/* Content sections */
.well-section { margin-bottom: 10px; }
.well-section-label {
  font-size: 11px; font-weight: 600;
  color: #98a0ad; text-transform: uppercase;
  letter-spacing: 0.3px; margin-bottom: 4px;
}
.well-section-text {
  font-size: 14px; color: #1a1d23;
  line-height: 1.6;
}
.well-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic; font-size: 14px;
  color: #5e6470; line-height: 1.55;
}

.well-context {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #f0f1f5;
}
.well-context-label {
  font-size: 11px; font-weight: 600;
  color: #98a0ad; text-transform: uppercase;
  letter-spacing: 0.3px; margin-bottom: 3px;
}
.well-context-text {
  font-size: 13px; color: #5e6470;
  line-height: 1.5;
}

/* Collection badges on cards */
.well-entry-collections {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 10px;
}
.well-entry-col-badge {
  font-size: 11px; color: #5e6470;
  background: #f0f1f5; border-radius: 10px;
  padding: 2px 10px; cursor: pointer;
  transition: background 0.2s;
}
.well-entry-col-badge:hover { background: #e6e8ee; }

/* Parchment badges */
.page-well .well-entry-col-badge {
  background: rgba(255, 250, 240, 0.4);
}
.page-well .well-entry-col-badge:hover {
  background: rgba(255, 250, 240, 0.6);
}

/* Actions bar at bottom of card */
.well-entry-actions {
  display: flex; align-items: center;
  gap: 8px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid #f0f1f5;
}
.well-action-btn {
  background: none; border: 1px solid #e6e8ee;
  border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 600;
  color: #5e6470; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: all 0.2s;
}

/* Parchment action buttons */
.page-well .well-action-btn {
  border-color: rgba(160, 140, 110, 0.2);
}
.well-action-btn:hover {
  border-color: #667eea; color: #667eea;
}
.well-action-btn.reflected {
  color: #48a87c; border-color: #48a87c30;
  cursor: default;
}
.well-action-btn.danger:hover {
  border-color: #e74c3c; color: #e74c3c;
}
.well-entry-actions-spacer { flex: 1; }

/* ── Reflect inline area ── */
.well-reflect-area {
  margin-top: 14px; padding: 14px;
  background: #f7f8fb; border-radius: 10px;
}

/* Parchment reflect area */
.page-well .well-reflect-area {
  background: rgba(255, 250, 240, 0.35);
}
.well-reflect-prompt {
  font-size: 13px; color: #5e6470;
  line-height: 1.5; margin-bottom: 10px;
  font-style: italic;
}
.well-reflect-textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e6e8ee; border-radius: 8px;
  font-family: inherit; font-size: 14px;
  color: #1a1d23; background: #fff;
  resize: vertical; min-height: 60px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

/* Parchment reflect textarea */
.page-well .well-reflect-textarea {
  background: rgba(255, 250, 240, 0.6);
  border-color: rgba(200, 190, 170, 0.4);
}
.well-reflect-textarea:focus {
  outline: none; border-color: #667eea;
}
.well-reflect-meta {
  margin-top: 8px; padding: 10px; background: #f7f8fb; border-radius: 8px; border: 1px solid #e6e8ee;
}

/* Parchment reflect meta */
.page-well .well-reflect-meta {
  background: rgba(255, 250, 240, 0.35);
  border-color: rgba(160, 140, 110, 0.2);
}
.well-reflect-meta-label {
  font-size: 11px; font-weight: 600; color: #98a0ad; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.well-reflect-meta-label + .well-reflect-meta-label { margin-top: 8px; }
.well-reflect-meta-tags, .well-reflect-meta-moods {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.well-reflect-tag-btn, .well-reflect-mood-btn {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
  background: #fff; color: #5e6470; border: 1px solid #e0e3ea; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}

/* Parchment tag/mood buttons */
.page-well .well-reflect-tag-btn,
.page-well .well-reflect-mood-btn {
  background: rgba(255, 250, 240, 0.5);
  border-color: rgba(160, 140, 110, 0.2);
}
.well-reflect-tag-btn.suggested { border-style: dashed; color: #98a0ad; }
.well-reflect-tag-btn:hover, .well-reflect-mood-btn:hover { border-color: #667eea; color: #667eea; }
.well-reflect-tag-btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.well-reflect-mood-btn.active { background: #764ba2; color: #fff; border-color: #764ba2; }
.well-journal-link {
  text-decoration: none; color: #667eea; font-size: 12px;
}
.well-journal-link:hover { text-decoration: underline; }
.well-reflect-actions {
  display: flex; align-items: center;
  gap: 8px; margin-top: 8px;
  justify-content: flex-end;
}
.well-reflect-save {
  padding: 8px 18px; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%); color: #fff; cursor: pointer;
  transition: opacity 0.2s;
}
.well-reflect-save:disabled { opacity: 0.45; cursor: default; }
.well-reflect-save:not(:disabled):hover { opacity: 0.9; }
.well-reflect-cancel {
  padding: 8px 14px; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  background: #f0f1f5; color: #5e6470; cursor: pointer;
}

/* Parchment cancel button */
.page-well .well-reflect-cancel {
  background: rgba(255, 250, 240, 0.5);
}

/* ── Philosopher group headers (By Philosopher view) ── */
.well-group-header {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid #e6e8ee;
}

/* Parchment group borders */
.page-well .well-group-header {
  border-bottom-color: rgba(160, 140, 110, 0.2);
}
.well-group-header:first-child { margin-top: 0; }
.well-group-mono {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.well-group-name {
  font-size: 15px; font-weight: 700; color: #1a1d23;
}
.well-group-count {
  font-size: 12px; color: #98a0ad; font-weight: 500;
}

/* ── Collection group headers (By Collection view) ── */
.well-col-group-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid #e6e8ee;
}

/* Parchment collection group borders */
.page-well .well-col-group-header {
  border-bottom-color: rgba(160, 140, 110, 0.2);
}
.well-col-group-header:first-child { margin-top: 0; }
.well-col-group-name {
  font-size: 15px; font-weight: 700; color: #1a1d23;
}
.well-col-group-count {
  font-size: 12px; color: #98a0ad; font-weight: 500;
}

/* ── Collection context menu ── */
.well-col-menu {
  position: absolute; z-index: 100;
  background: #fff; border: 1px solid #e6e8ee;
  border-radius: 10px; padding: 6px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 160px;
}

/* Parchment context menus */
.page-well .well-col-menu {
  background: rgba(255, 250, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(160, 140, 110, 0.25);
}
.well-col-menu-item {
  display: block; width: 100%;
  background: none; border: none; cursor: pointer;
  padding: 8px 16px; font-size: 13px;
  color: #1a1d23; text-align: left;
  transition: background 0.15s;
}
.well-col-menu-item:hover { background: #f7f8fb; }
.well-col-menu-item.danger { color: #e74c3c; }

/* ── Collection picker dropdown ── */
.well-col-picker {
  position: absolute; z-index: 100;
  background: #fff; border: 1px solid #e6e8ee;
  border-radius: 10px; padding: 8px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 200px;
}

/* Parchment collection picker */
.page-well .well-col-picker {
  background: rgba(255, 250, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(160, 140, 110, 0.25);
}
.well-col-picker-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  cursor: pointer; padding: 8px 16px; font-size: 13px;
  color: #1a1d23; text-align: left;
  transition: background 0.15s;
}
.well-col-picker-item:hover { background: #f7f8fb; }
.well-col-picker-check {
  width: 16px; font-size: 14px; color: #667eea;
}
.well-col-picker-new {
  color: #667eea; font-weight: 600;
  border-top: 1px solid #f0f1f5;
  margin-top: 4px; padding-top: 12px;
}

/* ── Empty state ── */
.well-empty {
  text-align: center;
  padding: 48px 20px;
}
.well-empty-icon { font-size: 40px; margin-bottom: 16px; }
.well-empty h2 {
  font-size: 18px; font-weight: 700;
  color: #1a1d23; margin-bottom: 10px;
}
.well-empty p {
  font-size: 14px; color: #5e6470;
  line-height: 1.6; margin-bottom: 20px;
}
.well-empty a {
  display: inline-block;
  padding: 10px 20px; border-radius: 10px;
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%); color: #fff;
  text-decoration: none; font-weight: 600;
  font-size: 14px; transition: opacity 0.2s;
}
.well-empty a:hover { opacity: 0.9; }
.well-empty-distinction {
  font-size: 12.5px;
  color: #98a0ad;
  margin-bottom: 16px;
}
.well-empty-distinction a {
  display: inline;
  padding: 0;
  background: none;
  color: #8b6914;
  font-weight: 500;
  font-size: inherit;
  text-decoration: none;
}
.well-empty-distinction a:hover { text-decoration: underline; opacity: 1; }

/* ── Composition profile (same as journal) ── */
.composition-profile {
  margin-top: 20px; padding: 24px;
  background: #fff; border: 1px solid #e6e8ee;
  border-radius: 12px;
}

/* Parchment composition profile */
.page-well .composition-profile {
  background: transparent;
  border-color: rgba(160, 140, 110, 0.2);
}
.composition-title {
  font-size: 16px; font-weight: 700; color: #1a1d23;
  margin-bottom: 6px;
}
.composition-subtitle {
  font-size: 13px; color: #98a0ad;
  margin-bottom: 16px;
}
.composition-bar-row {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 8px;
}
.composition-bar-label {
  font-size: 13px; font-weight: 500;
  color: #5e6470; width: 120px; flex-shrink: 0;
}
.composition-bar-track {
  flex: 1; height: 14px; background: #f0f1f5;
  border-radius: 8px; overflow: hidden;
}

/* Parchment bar track */
.page-well .composition-bar-track {
  background: rgba(255, 250, 240, 0.4);
}
.composition-bar-fill {
  height: 100%; border-radius: 8px;
  transition: width 0.5s ease;
}
.composition-bar-pct {
  font-size: 12px; color: #98a0ad;
  width: 36px; text-align: right; flex-shrink: 0;
}

/* ── Footer ── */
.well-footer-feedback { margin-top: 10px; }
.footer .feedback-link { color: #666; }
.footer .feedback-link:hover { color: #667eea; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .header { padding: 24px 20px; }
  .well-controls-top { flex-direction: column; align-items: stretch; gap: 8px; }
  .well-search { width: 100%; }
  .well-views { justify-content: center; }
  .well-entry { padding: 16px 16px; }
  .composition-bar-label { width: 90px; font-size: 12px; }
}
