/* PsyAI app-specific styles on top of shared-ui (loaded after /shared/style.css) */

/* ── Page header ─────────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-base);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.page-head .page-title { margin-bottom: 0; }
.page-head .page-subtitle {
  margin: var(--space-xs) 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ── Links that behave as blocks ────────────────────────────── */
a.stat-card {
  color: inherit;
  text-decoration: none;
  display: block;
}
a.stat-card:hover { text-decoration: none; }

/* ── Sidebar icons ──────────────────────────────────────────── */
.sidebar-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-right: var(--space-md);
  stroke-width: 1.5;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-footer { padding: var(--space-sm); }

/* ── Panels ─────────────────────────────────────────────────── */
.panel--flush { padding: 0; }
.panel--flush .panel-head { margin: 0 18px; }
.panel + .panel { margin-top: var(--space-base); }
.panel-body { padding: 0; }

.file-cell {
  display: grid;
}
.file-card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  transition: border-color var(--transition-fast);
}
.file-card:hover { border-color: var(--border-strong); }
.file-card p { margin: 0; font-size: 12.5px; color: var(--text); }
.icon-lg {
  width: 24px;
  height: 24px;
  stroke: var(--text-faint);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-base);
}
.flex-inline { display: flex; align-items: center; }

/* ── Inline helpers (bootstrap replacements) ────────────────── */
.row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.row-inline--start { justify-content: flex-start; }
.btn-group-wrap { gap: var(--space-sm); }
.text-faint-12 { font-size: 11.5px; }
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 var(--space-md);
}
@media (max-width: 560px) {
  .form-grid-3 { grid-template-columns: 1fr; }
}
.form-text {
  display: block;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: var(--space-xs);
}
.icon-sm {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -3px;
}
.layout-content svg:not([width]) {
  width: 18px;
  height: 18px;
  flex: none;
}
.layout-content svg.icon-lg:not([width]) { width: 24px; height: 24px; }
.empty-icon svg:not([width]) { width: 44px; height: 44px; color: var(--text-faint); }
.icon-file {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -3px;
  flex: none;
}
.icon-inline {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  margin-right: var(--space-xs);
  vertical-align: -2px;
}

/* ── Grids (bootstrap row/col replacement) ──────────────────── */
.grid-sidebar {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-base);
  align-items: start;
}
.grid-sidebar > .full { grid-column: 1 / -1; }
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-base);
}
.grid-12 > .col-4 { grid-column: span 4; }
.grid-12 > .col-8 { grid-column: span 8; }
.grid-12 > .col-12 { grid-column: span 12; }
.file-cell { grid-column: span 3; }
@media (max-width: 900px) {
  .file-cell { grid-column: span 6; }
}
@media (max-width: 900px) {
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid-12 > .col-4,
  .grid-12 > .col-8 { grid-column: span 12; }
}

/* ── Modal sizing variants ──────────────────────────────────── */
.modal-box--form {
  width: min(560px, 94vw);
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box--wide {
  width: min(880px, 94vw);
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}
.modal-box .modal-actions .btn-danger:first-child { margin-right: auto; }


/* ── Error pages ─────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}
.error-code {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

/* ── Reveal animations ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.19s; }

/* ── Transcript / markdown ───────────────────────────────────── */
.transcript-text {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 420px;
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--bg);
  border: 1px solid var(--border);
}

/* ── FullCalendar overrides ─────────────────────────────────── */
.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--panel);
  --fc-today-bg-color: var(--accent-soft);
  --fc-event-border-color: var(--accent);
  --fc-neutral-bg-color: var(--bg-elevated);
  font-size: 12.5px;
}
.fc a { color: var(--text); text-decoration: none; }
.fc a:hover { text-decoration: none; }
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 6px 8px;
}
.fc .fc-toolbar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}
.fc .fc-button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 0;
  box-shadow: none;
  font-size: 12px;
  padding: 5px 12px;
}
.fc .fc-button:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fc .fc-button:focus,
.fc .fc-button:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
  box-shadow: none;
}
.fc .fc-event {
  border-radius: 0;
  font-size: 11px;
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
}
.fc .fc-event:hover { background: var(--accent); color: #fff; }
.fc .fc-daygrid-day.fc-day-today { background: var(--accent-soft); }
.fc .fc-popover,
.fc .fc-more-popover .fc-popover-body {
  background: var(--panel);
  border: 1px solid var(--border);
}
.calendar-body { padding: var(--space-base); }

/* ── LiveKit video ──────────────────────────────────────────── */
.livekit-video-container {
  background: #141414;
  border: 1px solid var(--border);
  min-height: var(--video-height, 480px);
  display: flex;
  flex-direction: column;
}
.livekit-video-stage {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2px;
  padding: var(--space-md);
  min-height: 360px;
}
.livekit-video-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.livekit-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  color: #9a9a9a;
  font-size: 13px;
  background: #1c1c1c;
  min-height: 240px;
  border: 1px dashed #333;
}
.lk-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-top: 1px solid #2a2a2a;
}
.lk-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 38px;
  padding: 0 var(--space-lg);
  border: 1px solid #3a3a3a;
  background: #222;
  color: #e5e5e5;
  font-family: var(--font-body);
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.lk-control-btn:hover { background: #2e2e2e; border-color: #4a4a4a; }
.lk-control-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.lk-control-btn--danger { border-color: rgba(169, 50, 38, 0.6); color: #e8b4ad; }
.lk-control-btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.lk-control-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lk-control-btn:disabled { opacity: 0.5; cursor: not-allowed; }
