/* Arete — Oracle Chat Styles */

/* ── Full-viewport layout ────────────────────────────────────────────────── */
.oc-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh; /* fallback for browsers without dvh */
  background: var(--bg-0);
  overflow: hidden;
}

.oc-topbar { flex-shrink: 0; position: relative; z-index: 10; }

.oc-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar (desktop only) ──────────────────────────────────────────────── */
.oc-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 20px;
  background: linear-gradient(180deg, #0c1428, #080e1e);
  border-right: 1px solid var(--gold-dim);
  overflow-y: auto;
}
@media (max-width: 767px) { .oc-sidebar { display: none; } }

.oc-sidebar-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.oc-sidebar-sub {
  font-family: var(--serif); font-size: 13px; font-style: italic;
  color: var(--muted); margin-bottom: 20px;
}
.oc-counselor-list { display: flex; flex-direction: column; gap: 6px; }

.oc-counselor-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  border: 1px solid transparent; background: none;
  cursor: pointer; text-align: left; width: 100%;
  color: var(--text); font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.oc-counselor-card:hover  { background: rgba(201,168,76,0.06); border-color: rgba(201,168,76,0.18); }
.oc-counselor-card.oc-active { border-color: var(--gold) !important; background: rgba(201,168,76,0.09) !important; }

.oc-counselor-info { min-width: 0; }
.oc-counselor-name { font-family: var(--serif); font-size: 13.5px; color: var(--ivory); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-counselor-lbl  { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--muted); margin-top: 2px; }

.oc-sep { height: 1px; background: var(--gold-dim); margin: 16px 0; }
.oc-remaining-text {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--muted); text-align: center; line-height: 1.5;
}

/* ── Main chat area ──────────────────────────────────────────────────────── */
.oc-main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

/* ── Mobile header ───────────────────────────────────────────────────────── */
.oc-mob-header {
  display: none; align-items: center;
  padding: 8px 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--gold-dim);
  background: rgba(8,14,30,0.95);
}
@media (max-width: 767px) { .oc-mob-header { display: flex; } }

.oc-mob-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 5px 8px; border-radius: 8px;
  color: var(--ivory); font-family: inherit;
  transition: background 0.15s;
}
.oc-mob-btn:hover { background: rgba(201,168,76,0.07); }
.oc-mob-name { font-family: var(--serif); font-size: 16px; color: var(--ivory); }

/* ── Mobile picker (bottom sheet) ───────────────────────────────────────── */
.oc-picker-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,10,20,0.72);
  display: flex; align-items: flex-end;
  backdrop-filter: blur(2px);
}
.oc-picker {
  width: 100%;
  background: linear-gradient(180deg, #121b36, #0a1224);
  border-top: 1px solid var(--gold-dim);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 40px;
  display: flex; flex-direction: column; gap: 4px;
}
.oc-picker-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--gold);
  text-align: center; margin-bottom: 12px;
}
.oc-picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid transparent; background: none;
  cursor: pointer; color: var(--text);
  font-family: inherit; text-align: left; width: 100%;
  transition: background 0.15s, border-color 0.15s;
}
.oc-picker-item:hover, .oc-picker-item.oc-active {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.3);
}

/* ── Messages area ───────────────────────────────────────────────────────── */
.oc-msgs-wrap { flex: 1; overflow-y: auto; min-height: 0; }
.oc-msgs {
  display: flex; flex-direction: column; gap: 18px;
  padding: 28px 28px 12px;
  max-width: 680px; margin: 0 auto; width: 100%;
  box-sizing: border-box;
}
@media (max-width: 767px) { .oc-msgs { padding: 16px 14px 10px; } }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.oc-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 52px 24px 24px; min-height: 60vh;
}
.oc-empty-title {
  font-family: var(--serif); font-size: clamp(32px,5vw,48px);
  font-weight: 400; color: var(--ivory); margin: 20px 0 10px;
  letter-spacing: -0.01em;
}
.oc-empty-sub {
  font-family: var(--serif); font-style: italic; font-size: 17px;
  color: var(--muted); margin: 0 0 28px; max-width: 400px; line-height: 1.55;
}
.oc-chips { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 460px; }
.oc-chip {
  background: rgba(201,168,76,0.05); border: 1px solid var(--gold-dim);
  border-radius: 12px; padding: 12px 16px;
  font-family: var(--serif); font-size: 15px; font-style: italic;
  color: var(--text); cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.oc-chip:hover { background: rgba(201,168,76,0.12); border-color: rgba(201,168,76,0.5); color: var(--ivory); }

/* ── Message rows ────────────────────────────────────────────────────────── */
.oc-row { display: flex; flex-direction: column; }
.oc-row-user  { align-items: flex-end; }
.oc-row-asst  { align-items: flex-start; }

.oc-bubble {
  line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.oc-bubble-user {
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.2);
  border-radius: 18px 18px 4px 18px;
  padding: 11px 15px;
  font-family: var(--sans); font-size: 15px; color: var(--ivory);
  max-width: 82%;
}
.oc-asst-meta {
  display: flex; align-items: center; gap: 7px; margin-bottom: 5px;
}
.oc-asst-name {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--gold);
}
.oc-bubble-asst {
  background: linear-gradient(160deg, rgba(16,24,48,0.75), rgba(10,16,32,0.75));
  border: 1px solid var(--gold-dim);
  border-radius: 4px 18px 18px 18px;
  padding: 14px 18px;
  font-family: var(--serif); font-size: 17px; color: var(--ivory);
  max-width: 100%;
}
.oc-sources {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--gold); font-style: italic;
  margin-top: 5px; padding-left: 4px; opacity: 0.8;
}

/* ── Typing indicator ────────────────────────────────────────────────────── */
.oc-typing {
  display: flex; align-items: center; gap: 5px;
  padding: 13px 18px;
  background: linear-gradient(160deg, rgba(16,24,48,0.75), rgba(10,16,32,0.75));
  border: 1px solid var(--gold-dim);
  border-radius: 4px 18px 18px 18px;
  width: fit-content;
}
.oc-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  animation: oc-dot 1.4s ease-in-out infinite;
}
.oc-typing span:nth-child(2) { animation-delay: 0.2s; }
.oc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes oc-dot {
  0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
  30%            { opacity: 1;   transform: scale(1);   }
}

/* ── Divider (counselor switch) ──────────────────────────────────────────── */
.oc-divider {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); text-align: center;
  margin: 4px 0;
}
.oc-divider::before, .oc-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gold-dim);
}

/* ── System messages (errors, rate limit) ────────────────────────────────── */
.oc-system {
  text-align: center; padding: 14px 18px; border-radius: 12px;
  font-family: var(--serif); font-style: italic;
}
.oc-system p   { margin: 0 0 6px; font-size: 15px; color: var(--text); opacity: 0.8; }
.oc-system a   { color: var(--gold); font-size: 13px; }
.oc-sys-limit  { border: 1px solid rgba(201,168,76,0.15); background: rgba(10,16,32,0.5); }
.oc-sys-error  { border: 1px solid rgba(220,80,80,0.18); background: rgba(10,16,32,0.5); }

/* ── CTA card ────────────────────────────────────────────────────────────── */
.oc-cta {
  background: linear-gradient(160deg, rgba(22,33,62,0.8), rgba(10,16,32,0.8));
  border: 1px solid var(--gold-dim); border-radius: 16px;
  padding: 22px; text-align: center; margin: 4px 0;
}
.oc-cta-title {
  font-family: var(--serif); font-size: 17px; color: var(--ivory);
  font-weight: 400; margin-bottom: 14px;
}
.oc-cta-btns  { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.oc-cta-sub   { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--muted); }

/* ── Input bar ───────────────────────────────────────────────────────────── */
.oc-input-bar {
  flex-shrink: 0;
  padding: 12px 24px 14px;
  border-top: 1px solid var(--gold-dim);
  background: rgba(8,14,30,0.98);
  backdrop-filter: blur(10px);
}
@media (max-width: 767px) { .oc-input-bar { padding: 10px 14px 14px; } }

.oc-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 680px; margin: 0 auto;
  background: rgba(16,24,48,0.8); border: 1px solid var(--gold-dim);
  border-radius: 16px; padding: 8px 8px 8px 16px;
  transition: border-color 0.2s;
}
.oc-input-row:focus-within { border-color: rgba(201,168,76,0.5); }

.oc-textarea {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--sans); font-size: 15px; color: var(--ivory);
  resize: none; min-height: 26px; max-height: 112px;
  line-height: 1.6; padding: 3px 0; overflow-y: auto;
}
.oc-textarea::placeholder { color: var(--muted); }
.oc-textarea:disabled { opacity: 0.4; cursor: not-allowed; }

.oc-send {
  width: 34px; height: 34px; border-radius: 10px;
  border: none; background: var(--gold); color: var(--bg-0);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.2s, transform 0.15s;
}
.oc-send:hover:not(:disabled) { background: var(--gold-light); transform: scale(1.05); }
.oc-send:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.oc-hint {
  max-width: 680px; margin: 6px auto 0;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.1em; color: var(--muted); text-align: center;
}
.oc-hint a { color: var(--gold); }
.oc-hint-desktop { display: inline; }
.oc-hint-mobile  { display: none;   }
@media (max-width: 767px) {
  .oc-hint-desktop { display: none;   }
  .oc-hint-mobile  { display: inline; }
}

/* ── Reused keyframes ────────────────────────────────────────────────────── */
@keyframes oracle-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}
.oracle-fade-in { animation: oracle-fade-in 0.45s cubic-bezier(.2,.8,.2,1) both; }

@keyframes oracle-spin {
  to { transform: rotate(360deg); }
}
@keyframes oracle-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(201,168,76,0.5); }
  50%       { opacity: 0.6; box-shadow: 0 0 0 6px rgba(201,168,76,0); }
}

/* ── Scrollbar styling ───────────────────────────────────────────────────── */
.oc-msgs-wrap::-webkit-scrollbar { width: 4px; }
.oc-msgs-wrap::-webkit-scrollbar-track { background: transparent; }
.oc-msgs-wrap::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
