/* ============================================================
   Korsyl Sanctuary — Safe Room Stylesheet
   Soft, low-stress, distraction-free environment
   ============================================================ */

:root {
  --s-bg:      #f0f4f8;
  --s-card:    #ffffff;
  --s-blue:    #4a90d9;
  --s-green:   #48bb78;
  --s-text:    #2d3748;
  --s-muted:   #718096;
  --s-border:  #e2e8f0;
  --s-radius:  16px;
  --s-staff:   #ebf8ff;
  --s-system:  #f0fff4;
}

body.sanctuary-body {
  background: var(--s-bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sanctuary-wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Header ---- */
.sanctuary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: white;
  border-bottom: 1px solid var(--s-border);
  flex-shrink: 0;
}
.sanctuary-logo {
  font-weight: 700;
  font-size: 17px;
  color: var(--s-blue);
  flex: 1;
}
.sanctuary-status { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sanctuary-live-dot {
  width: 8px; height: 8px;
  background: #48bb78;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
  display: inline-block; margin-right: 4px;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.3); }
}
.sanctuary-copy-link {
  background: none; border: 1px solid var(--s-border); border-radius: 8px;
  padding: 5px 12px; font-size: 12px; color: var(--s-muted); cursor: pointer;
  transition: all .2s;
}
.sanctuary-copy-link:hover { border-color: var(--s-blue); color: var(--s-blue); }

/* ---- Hotline bar ---- */
.sanctuary-hotline-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.btn-hotline {
  background: #ef4444; color: white; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  transition: background .2s;
}
.btn-hotline:hover { background: #dc2626; color: white; }
.btn-hotline-alt {
  background: #2563eb; color: white; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
}
.btn-hotline-alt:hover { background: #1d4ed8; color: white; }

/* ---- Messages ---- */
.sanctuary-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}
.sanctuary-msg { display: flex; flex-direction: column; margin-bottom: 8px; }
.sanctuary-msg-user   { align-items: flex-end; }
.sanctuary-msg-staff  { align-items: flex-start; }
.sanctuary-msg-system { align-items: center; }

.sanctuary-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: var(--s-radius);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.sanctuary-msg-user  .sanctuary-bubble {
  background: var(--s-blue); color: white;
  border-bottom-right-radius: 4px;
}
.sanctuary-msg-staff .sanctuary-bubble {
  background: var(--s-staff);
  color: var(--s-text);
  border: 1px solid #bee3f8;
  border-bottom-left-radius: 4px;
}
.sanctuary-msg-system .sanctuary-bubble {
  background: var(--s-system);
  color: #276749;
  border: 1px solid #c6f6d5;
  font-style: italic;
  font-size: 14px;
  text-align: center;
  max-width: 90%;
}

.sanctuary-msg-meta {
  font-size: 11px;
  color: var(--s-muted);
  margin-top: 3px;
  padding: 0 4px;
}

/* Typing indicator */
.sanctuary-typing {
  display: flex; gap: 4px; align-items: center; padding: 6px 12px;
  background: var(--s-staff); border-radius: 20px; width: fit-content;
}
.sanctuary-typing span {
  width: 7px; height: 7px; background: var(--s-muted);
  border-radius: 50%; animation: typing-bounce .9s ease-in-out infinite;
}
.sanctuary-typing span:nth-child(2) { animation-delay: .15s; }
.sanctuary-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

/* ---- Input ---- */
.sanctuary-input-wrap {
  border-top: 1px solid var(--s-border);
  background: white;
  padding: 14px 20px;
  flex-shrink: 0;
}
.sanctuary-input-row { display: flex; gap: 10px; align-items: flex-end; }
.sanctuary-textarea {
  flex: 1; border: 1.5px solid var(--s-border); border-radius: 12px;
  padding: 10px 14px; font-size: 15px; resize: none; outline: none;
  font-family: inherit; transition: border-color .2s;
  max-height: 120px;
}
.sanctuary-textarea:focus { border-color: var(--s-blue); }
.sanctuary-send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--s-blue); color: white; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.sanctuary-send-btn:hover    { background: #3a7abf; }
.sanctuary-send-btn:disabled { background: #a0aec0; cursor: not-allowed; }
.sanctuary-input-note {
  font-size: 11px; color: var(--s-muted); margin-top: 6px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.sanctuary-closed-notice {
  background: #fff5f5; border-top: 1px solid #fed7d7;
  padding: 18px 20px; text-align: center; font-size: 14px;
  color: var(--s-muted); flex-shrink: 0;
}

/* ============================================================
   Crisis banners & overlays (search page)
   ============================================================ */

/* Hit 1 — subtle banner */
.crisis-banner-hit1 {
  background: linear-gradient(135deg, #e0f2fe, #ede9fe);
  border-bottom: 1px solid #bae6fd;
  padding: 10px 16px;
  position: relative;
}
.crisis-banner-inner {
  max-width: 900px; margin: 0 auto;
  font-size: 14px; color: #0c4a6e;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.crisis-banner-link {
  font-weight: 600; color: #1d4ed8; text-decoration: underline;
}
.crisis-banner-close {
  background: none; border: none; font-size: 18px; color: #64748b;
  cursor: pointer; margin-left: auto; line-height: 1;
}

/* Hit 2 — inline support card (results remain visible below) */
.crisis-support-hit2 {
  background: linear-gradient(135deg, #fdf6ff, #eff6ff);
  border-bottom: 2px solid #c4b5fd;
  padding: 20px 16px;
  animation: fadeInSupport .4s ease;
}
@keyframes fadeInSupport {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.crisis-support-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: flex-start; gap: 16px;
}
.crisis-support-icon {
  font-size: 32px; flex-shrink: 0; margin-top: 2px;
}
.crisis-support-body {
  flex: 1;
}
.crisis-support-heading {
  font-size: 17px; font-weight: 700;
  color: #1e1b4b; margin: 0 0 6px;
}
.crisis-support-sub {
  font-size: 14px; color: #4c1d95; margin: 0 0 14px; line-height: 1.5;
}
.crisis-support-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.btn-safe-room {
  background: #7c3aed; color: white; border: none;
  border-radius: 8px; padding: 7px 16px; font-size: 13px;
  font-weight: 600; text-decoration: none; transition: background .2s;
  display: inline-flex; align-items: center;
}
.btn-safe-room:hover { background: #6d28d9; color: white; }
.btn-dismiss {
  background: none; border: 1px solid #c4b5fd; color: #7c3aed;
  border-radius: 8px; padding: 7px 16px; font-size: 13px;
  cursor: pointer; transition: all .2s;
}
.btn-dismiss:hover { background: #ede9fe; }

/* Age-blocked result notice in search */
.result-age-notice {
  font-size: 12px;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 6px;
  padding: 4px 10px;
  margin-top: 6px;
  display: inline-block;
}

/* Crisis staff card */
.crisis-session-card {
  transition: box-shadow .2s;
}
.crisis-session-card:hover {
  box-shadow: 0 4px 20px rgba(26,115,232,.15);
}
