/* Shared across hub, login, and every capability navbar (back-link). */

:root {
  --iq-navy: #0D2137;
  --iq-navy2: #16314f;
  --iq-primary: #0E7C7B;
  --iq-primary2: #5ED4D3;
}

.hub-back-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
}
.hub-back-link:hover {
  color: #fff;
}

/* ---------- Hub landing page ---------- */

body.hub-body {
  background: #f4f6f8;
  min-height: 100vh;
}

.hub-navbar {
  background: var(--iq-navy);
}

.hub-hero {
  padding: 56px 24px 24px;
  text-align: center;
}

.hub-hero h1 {
  font-weight: 800;
  color: var(--iq-navy);
  font-size: 42px;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hub-hero .hub-tagline {
  color: var(--iq-primary);
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 10px;
}

.hub-hero p {
  color: #64748b;
  max-width: 680px;
  margin: 0 auto;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 24px 64px;
}

.capability-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.capability-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(13, 33, 55, 0.12);
  text-decoration: none;
  color: inherit;
}

.capability-card .icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--iq-primary), var(--iq-primary2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.capability-card h5 {
  margin: 0;
  font-weight: 700;
  color: var(--iq-navy);
}

.capability-card p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.capability-card .tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--iq-primary);
  font-weight: 700;
}

/* Which Xamun OS product consumes this capability's events. */
.capability-card .os-tag {
  display: inline-block;
  margin-top: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 124, 123, 0.09);
  color: var(--iq-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  align-self: flex-start;
}

/* ---------- Login page (mirrors GraphIQ's split-screen LoginForm) ---------- */

.login-root {
  min-height: 100vh;
  display: flex;
}

.login-panel {
  flex: 1;
  background: linear-gradient(160deg, var(--iq-navy), var(--iq-navy2));
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-panel-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.login-panel > *:not(.login-panel-backdrop) {
  position: relative;
  z-index: 1;
}

.login-panel .brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 20px;
}

.login-panel h2 {
  font-weight: 800;
  max-width: 420px;
}

.login-wordmark {
  font-weight: 800;
  font-size: 46px;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1.05;
}

.login-tagline {
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  max-width: 440px;
  margin-top: 12px;
  margin-bottom: 0;
}

.login-subhead {
  color: rgba(255, 255, 255, 0.72);
  max-width: 440px;
  font-size: 14px;
  margin-top: 10px;
}

.login-features {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
}

.login-features .feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.login-features .feature i {
  color: var(--iq-primary2);
  margin-top: 3px;
}

.login-features .feature strong {
  display: block;
}

.login-features .feature span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.login-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 420px;
}

.login-stats .stat {
  display: flex;
  flex-direction: column;
}

.login-stats .stat strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--iq-primary2);
}

.login-stats .stat span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.login-form-side {
  width: 420px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
}

.login-form-card {
  width: 100%;
  max-width: 320px;
}

.login-form-card h4 {
  font-weight: 700;
  color: var(--iq-navy);
}

.login-form-card .powered-by-footnote {
  margin-top: 24px;
  font-size: 11px;
  color: #94a3b8;
  text-align: left;
}

.demo-login-link {
  margin-top: 12px;
  font-size: 13px;
  color: var(--iq-primary);
  text-decoration: none;
}

.demo-login-link:hover {
  color: var(--iq-navy);
  text-decoration: none;
}

@media (max-width: 768px) {
  .login-panel { display: none; }
  .login-form-side { width: 100%; }
}

/* ---------- Live status dashboard (per capability) ---------- */

.status-dash {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.status-dash h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 10px;
}

.status-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.status-tile {
  background: #f8fafc;
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 3px solid var(--iq-primary);
}
.status-tile.warn { border-left-color: #f0a50e; background: #fdf8ec; }
.status-tile.crit { border-left-color: #dc3545; background: #fdf2f2; }

.status-tile .val {
  font-size: 20px;
  font-weight: 800;
  color: var(--iq-navy);
  line-height: 1.1;
}
.status-tile .lbl {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.status-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.status-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid #e2e8f0;
}
.status-table td { padding: 5px 8px 5px 0; border-bottom: 1px solid #f1f5f9; }
.status-table tr.warn td { background: #fdf8ec; }
.status-table tr.crit td { background: #fdf2f2; }
.status-table .mono { font-variant-numeric: tabular-nums; color: #475569; }
.status-empty { color: #94a3b8; font-size: 12px; padding: 6px 0; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.pill.ok   { background: rgba(14,124,123,.1);  color: var(--iq-primary); }
.pill.warn { background: rgba(240,165,14,.15); color: #b8790a; }
.pill.crit { background: rgba(220,53,69,.12);  color: #dc3545; }

/* ---------- Capability page layout ----------
   Three columns on wide screens: event log | video | now-tracking.
   The dashboard previously sat above the video and pushed it off-screen;
   putting it in its own column keeps the video within the viewport. */

.status-panel {
  width: 320px;
  flex-shrink: 0;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 14px 14px 14px 0;
}
.status-panel .status-dash { margin-bottom: 0; }

/* Keep the video inside the viewport regardless of its aspect ratio. */
.video-frame img,
.video-frame video {
  max-height: calc(100vh - 190px);
  width: 100%;
  object-fit: contain;
  background: #000;
}

@media (max-width: 1400px) {
  .status-panel { width: 280px; }
}
@media (max-width: 1100px) {
  .visioniq-layout { flex-wrap: wrap; }
  .status-panel {
    width: 100%; height: auto; padding: 0 14px 14px;
  }
  .video-frame img, .video-frame video { max-height: 60vh; }
}

/* ---------- Ops Assistant (replaces the raw event log) ---------- */

.assistant-panel { display: flex; flex-direction: column; height: 100%; }

.assistant-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.chat-status { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }
.chat-status.ok { color: var(--iq-primary); }
.chat-status.err { color: #dc3545; }

#assistant-log { flex: 1 1 auto; overflow-y: auto; padding-right: 2px; }

.chat-msg { margin-bottom: 10px; font-size: 12.5px; line-height: 1.45; }
.chat-msg .chat-body { white-space: pre-wrap; }
.chat-assistant .chat-body {
  background: #f8fafc; border-left: 3px solid var(--iq-primary);
  border-radius: 4px; padding: 8px 10px; color: #1e293b;
}
.chat-user .chat-body {
  background: var(--iq-primary); color: #fff;
  border-radius: 10px 10px 2px 10px; padding: 7px 10px; margin-left: 22px;
}
.chat-meta { font-size: 10px; color: #94a3b8; margin-top: 3px; }
.chat-thinking .chat-body { color: #94a3b8; letter-spacing: 2px; }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 8px; }
.chat-suggestion {
  font-size: 10.5px; padding: 3px 8px; border-radius: 999px; cursor: pointer;
  background: rgba(14,124,123,.08); color: var(--iq-primary);
  border: 1px solid rgba(14,124,123,.2);
}
.chat-suggestion:hover { background: rgba(14,124,123,.16); }

#assistant-form { display: flex; gap: 6px; }
#assistant-input {
  flex: 1; font-size: 12.5px; padding: 7px 9px;
  border: 1px solid #cbd5e1; border-radius: 6px;
}
#assistant-input:focus { outline: none; border-color: var(--iq-primary); }
#assistant-send {
  border: none; border-radius: 6px; background: var(--iq-primary);
  color: #fff; padding: 0 12px; cursor: pointer;
}
#assistant-send:disabled { opacity: .5; cursor: default; }


/* ---------- Full-viewport 3-column console ----------
   chat (left) | video (centre) | now-tracking (right).
   The page itself never scrolls; each column scrolls internally, so the
   video always stays visible with the chat and dashboard beside it. */

body.console-body { overflow: hidden; }

.visioniq-layout {
  display: flex;
  align-items: stretch;
  height: calc(100vh - 70px);
  overflow: hidden;
}

.event-sidebar {           /* now hosts the Ops Assistant */
  width: 330px;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;        /* the chat log scrolls, not the column */
  border-right: 1px solid #e2e8f0;
  background: #fff;
}

.video-main {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.video-main > .container-fluid {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.video-frame {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Fill the space left over after the header, without overflowing it. */
.video-frame img,
.video-frame video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.status-panel {
  width: 330px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  border-left: 1px solid #e2e8f0;
  background: #fff;
}

/* Denser dashboard so it fits without scrolling on a laptop. */
.status-panel .status-dash { border: none; padding: 0; }
.status-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.status-tile { padding: 7px 9px; }
.status-tile .val { font-size: 17px; }
.status-table { font-size: 11.5px; }
.status-table td { padding: 4px 6px 4px 0; }

@media (max-width: 1500px) {
  .event-sidebar, .status-panel { width: 290px; }
}
@media (max-width: 1200px) {
  body.console-body { overflow: auto; }
  .visioniq-layout { flex-wrap: wrap; height: auto; }
  .event-sidebar { width: 100%; height: 340px; border-right: none; }
  .video-main { height: auto; }
  .video-frame img, .video-frame video { max-height: 55vh; }
  .status-panel { width: 100%; height: auto; border-left: none; }
  .status-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}
