/* ── AskAncients Shared CSS ──
   Base reset, layout, philosopher cards, feedback widget,
   and responsive rules used across multiple pages.
*/

/* ── Base reset & layout ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 900px;
  width: 100%;
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   PARCHMENT THEME
   Any page that uses the warm parchment background just adds
   class="parchment-page" to <body>.  All colours, containers,
   nav, footer, links, etc. inherit automatically.
   ══════════════════════════════════════════════════════════ */

.parchment-page {
  background: url('../images/hub-bg.jpg') center top / cover no-repeat fixed;
}
.parchment-page .header {
  background: transparent;
  color: #3d3225;
}
.parchment-page .container {
  background: transparent;
  box-shadow: none;
  max-width: 1060px;
}
.parchment-page .philosopher-card {
  background: transparent;
  border: 1px solid rgba(160, 140, 110, 0.2);
  box-shadow: none;
}
.parchment-page .philosopher-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);
}
.parchment-page .footer {
  background: transparent;
  border-top: 1px solid rgba(160, 140, 110, 0.2);
}

/* Fine print line (privacy disclaimer) */
.footer-fineprint {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.7;
}

.parchment-page .content {
  text-shadow: 0 0 8px rgba(255, 248, 235, 0.6);
}
.parchment-page .back-link {
  color: rgba(61, 50, 37, 0.7);
  background: rgba(61, 50, 37, 0.06);
}
.parchment-page .back-link:hover {
  color: #3d3225;
  background: rgba(61, 50, 37, 0.1);
}
.parchment-page .header-nav-link {
  color: rgba(61, 50, 37, 0.7);
  background: rgba(61, 50, 37, 0.06);
}
.parchment-page .header-nav-link:hover {
  color: #3d3225;
  background: rgba(61, 50, 37, 0.1);
}
.parchment-page .header p {
  color: rgba(61, 50, 37, 0.75);
}
.parchment-page .vent-nudge {
  color: rgba(61, 50, 37, 0.4);
}
.parchment-page .journal-badge {
  background: #3d3225;
  color: #fff;
}

/* ── Vent — dark variant (not parchment) ── */
.page-vent {
  background: url('../images/vent-bg.jpg') center top / cover no-repeat fixed;
}
.page-vent .header {
  background: transparent;
}
.page-vent .container {
  background: rgba(30, 25, 20, 0.3);
  box-shadow: none;
  max-width: 1060px;
}

.header h1 {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: 700;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 10px;
}

.header-links {
  position: absolute;
  right: 0;
  display: flex;
  gap: 8px;
}

.header-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.header-nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* ── Back link (used by sub-pages: advise, journal, vent) ── */
.back-link {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.vent-nudge {
  display: none;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

.vent-nudge.visible {
  display: block;
}

.journal-badge {
  display: none;
  background: white;
  color: #764ba2;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  text-align: center;
  line-height: 18px;
  padding: 0 5px;
}

.journal-badge.visible {
  display: inline-block;
}

.header p {
  font-size: 16px;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.content {
  padding: 40px 30px;
}

.footer {
  background: #f9f9f9;
  padding: 20px 30px;
  text-align: center;
  font-size: 13px;
  color: #999;
  border-top: 1px solid #e0e0e0;
}

/* ── Philosopher card components ── */
.philosopher-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
}

.philosopher-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
}

.philosopher-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.philosopher-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.philosopher-monogram {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ── Portrait avatar (applied alongside size class) ── */
.philosopher-portrait {
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #f0e6d0;
  background: #f7f4ef;
}

.philosopher-card-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.philosopher-card-header .framework-name {
  font-size: 12px;
  color: #888;
  font-weight: 400;
  margin-top: 2px;
  font-style: italic;
}

.philosopher-bio {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.philosopher-school-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
  border: 1px solid rgba(102, 126, 234, 0.12);
}

.card-section {
  margin-bottom: 12px;
}

.card-section:last-child {
  margin-bottom: 0;
}

.card-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.card-section-text {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

.card-quote {
  font-size: 14px;
  line-height: 1.6;
  color: #667eea;
  font-style: italic;
  padding: 10px 16px;
  background: #f8f8ff;
  border-radius: 6px;
  margin-top: 4px;
}

.next-step-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
  border-left: 3px solid #764ba2;
}

.next-step-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.next-step-card .card-section-text {
  font-size: 15px;
  line-height: 1.8;
}

/* ── Card action buttons (like, dislike, save) ── */
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  padding: 0;
  flex: none;
  color: #999;
}

.card-action-btn:hover {
  background: #f0f0f0;
  border-color: #ccc;
  color: #666;
}

.card-action-btn.liked {
  background: #e8f5e9;
  border-color: #81c784;
  color: #43a047;
}

.card-action-btn.disliked {
  background: #fce4ec;
  border-color: #e57373;
  color: #e53935;
}

.card-action-btn.saved {
  background: #fff3e0;
  border-color: #ffb74d;
  color: #f57c00;
}

.card-share-btn:hover {
  background: #f0eae0;
  border-color: #c4a54a;
  color: #8B6914;
}

.card-share-btn.sharing {
  opacity: 0.5;
  pointer-events: none;
}

.card-actions-spacer {
  flex: 1;
}

/* ── Feedback widget ── */
/* ── First-use hints ── */
.first-use-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(184, 134, 11, 0.06);
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #7a6530;
  transition: opacity 0.3s;
}
.first-use-hint-text { flex: 1; }
.first-use-hint-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 16px;
  color: rgba(122, 101, 48, 0.5);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.first-use-hint-dismiss:hover { color: rgba(122, 101, 48, 0.8); }

/* Dark theme (vent) hint override */
.page-vent .first-use-hint {
  background: rgba(102, 126, 234, 0.06);
  border-color: rgba(102, 126, 234, 0.15);
  color: #8899cc;
}
.page-vent .first-use-hint-dismiss { color: rgba(136, 153, 204, 0.5); }
.page-vent .first-use-hint-dismiss:hover { color: rgba(136, 153, 204, 0.8); }

.feedback-link {
  cursor: pointer;
  color: #999;
  text-decoration: underline;
  font-size: 12px;
  transition: color 0.2s;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

.feedback-link:hover {
  color: #667eea;
}

.feedback-form {
  display: none;
  max-width: 480px;
  margin: 16px auto 0;
  text-align: left;
}

.feedback-form.active {
  display: block;
}

.feedback-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.feedback-cat-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fafafa;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.feedback-cat-btn:hover {
  border-color: #bbb;
  color: #666;
}

.feedback-cat-btn.active {
  background: rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
  color: #667eea;
}

.feedback-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  color: #333;
  transition: border-color 0.3s;
}

.feedback-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.feedback-submit-btn {
  padding: 7px 18px;
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.feedback-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.feedback-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feedback-cancel-btn {
  padding: 7px 14px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.feedback-cancel-btn:hover {
  background: #f5f5f5;
}

.feedback-success {
  display: none;
  font-size: 13px;
  color: #667eea;
  text-align: center;
  padding: 12px;
}

.feedback-success.active {
  display: block;
}

/* ── Session expired overlay ── */
.session-expired-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: sessionOverlayIn 0.4s ease;
}
@keyframes sessionOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.session-expired-card {
  text-align: center;
  max-width: 340px;
  width: 90%;
  padding: 36px 28px;
  background: rgba(255, 250, 240, 0.95);
  border: 1px solid rgba(160, 140, 110, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  animation: sessionCardIn 0.4s ease 0.1s both;
}
@keyframes sessionCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.session-expired-icon {
  font-size: 36px;
  margin-bottom: 14px;
}
.session-expired-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: #3d3225;
  margin-bottom: 8px;
}
.session-expired-card p {
  font-size: 14px;
  color: rgba(61, 50, 37, 0.65);
  line-height: 1.6;
  margin-bottom: 22px;
}
.session-expired-btn {
  display: inline-block;
  padding: 11px 28px;
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}
.session-expired-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Dark theme (vent) session expired override */
.page-vent .session-expired-card {
  background: rgba(30, 30, 48, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}
.page-vent .session-expired-card h2 { color: #e0e0e0; }
.page-vent .session-expired-card p { color: #999; }

/* ── Cross-page navigation strip ── */
.nav-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 0;
}

.nav-strip-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.nav-strip-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.nav-strip-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}

.nav-strip-link svg {
  width: 18px;
  height: 18px;
}

/* Tooltip on hover */
.nav-strip-link::after {
  content: attr(data-label);
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.nav-strip-link:hover::after {
  opacity: 1;
}

/* Divider before account icon */
.nav-strip-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

/* ── Nav strip on parchment pages (dark text) ── */
.parchment-page .nav-strip-link {
  color: rgba(61, 50, 37, 0.45);
}
.parchment-page .nav-strip-link:hover {
  color: rgba(61, 50, 37, 0.85);
  background: rgba(61, 50, 37, 0.08);
}
.parchment-page .nav-strip-link.active {
  color: #3d3225;
  background: rgba(61, 50, 37, 0.1);
}
.parchment-page .nav-strip-link::after {
  color: #fff;
  background: rgba(61, 50, 37, 0.7);
}
.parchment-page .nav-strip-divider {
  background: rgba(61, 50, 37, 0.15);
}

/* ── Nav strip on hub (parchment bg, dark text) ── */
.hub-body .nav-strip-link {
  color: rgba(61, 50, 37, 0.45);
}

.hub-body .nav-strip-link:hover {
  color: rgba(61, 50, 37, 0.85);
  background: rgba(61, 50, 37, 0.08);
}

.hub-body .nav-strip-link.active {
  color: #3d3225;
  background: rgba(61, 50, 37, 0.1);
}

.hub-body .nav-strip-link::after {
  color: #fff;
  background: rgba(61, 50, 37, 0.7);
}

.hub-body .nav-strip-divider {
  background: rgba(61, 50, 37, 0.15);
}

/* ── Nav strip on vent (light text on dark) ── */
.page-vent .nav-strip-link {
  color: rgba(255, 255, 255, 0.4);
}

.page-vent .nav-strip-link:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
}

.page-vent .nav-strip-link.active {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
}

.page-vent .nav-strip-divider {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Mobile responsive: nav strip ── */
@media (max-width: 600px) {
  .nav-strip {
    gap: 4px;
    margin-top: 10px;
  }
  .nav-strip-link {
    width: 32px;
    height: 32px;
  }
  .nav-strip-link svg {
    width: 16px;
    height: 16px;
  }
}

/* ── Mobile responsive: shared components ── */
@media (max-width: 600px) {
  .philosopher-card,
  .next-step-card {
    padding: 18px;
  }

  .philosopher-monogram {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .card-action-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

/* ── Mobile responsive: header ── */
@media (max-width: 600px) {
  .header h1 {
    font-size: 24px;
  }

  .header-top {
    flex-direction: column;
    gap: 10px;
  }

  .header-links {
    position: static;
    justify-content: center;
  }

  .header-nav-link {
    font-size: 11px;
  }

  .back-link {
    position: static;
    font-size: 12px;
  }

  .header p {
    font-size: 14px;
  }

  .content {
    padding: 25px 15px;
  }
}

/* ── Guest mode banner (injected by auth-guard.js on every app page) ──
   Fixed bottom bar. Deliberately theme-neutral so it reads well over both the
   parchment pages and the dark Vent page. */
.guest-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 11px 46px 11px 16px;
  background: rgba(38, 30, 20, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(184, 134, 11, 0.4);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.18);
  font-size: 13.5px;
  line-height: 1.4;
}

.guest-banner-text {
  color: rgba(255, 248, 235, 0.85);
}

.guest-banner-cta {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #b8860b 0%, #8b6914 100%);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}

.guest-banner-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.guest-banner-dismiss {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: rgba(255, 248, 235, 0.55);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}

.guest-banner-dismiss:hover {
  color: rgba(255, 248, 235, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 480px) {
  .guest-banner {
    font-size: 12.5px;
    padding: 10px 42px 10px 12px;
  }
}
