/* ===============================
   Base / Reset
=============================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

/* Wrapper */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===============================
   Header / Navigation
=============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 650;
  color: #0f172a;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  justify-content: center;
}

.main-nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: #475569;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.main-nav a:hover {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

.main-nav a.active {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.45);
}

/* Focus ring for keyboard nav */
.main-nav a:focus-visible,
.btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-select select {
  font-size: 0.8rem;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  background: #eef2ff;
  padding: 4px 8px;
  color: #0f172a;
  outline: none;
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.lang-select select:hover {
  border-color: #818cf8;
  background: #e0e7ff;
}

.lang-select select:focus-visible {
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.6);
}

/* ===============================
   Sections & Layout
=============================== */
.section {
  padding: 40px 20px;
}

.section-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: #64748b;
}

/* ===============================
   Hero Section (Home)
=============================== */
.hero {
  padding: 40px 20px 10px;
  background: radial-gradient(circle at top left, #eff6ff 0, #f9fafb 40%, #ffffff 100%);
}

/* two-column hero layout */
.hero > .section-inner {
  display: flex;
  align-items: stretch; /* make both columns share height */
  gap: 32px;
}

/* left side text */
.hero-content {
  flex: 1 1 60%;
  min-width: 0;
}

.hero-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.75rem;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: stretch;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-right {
  display: flex;
  align-items: stretch;
}

/* Badge + title */

.hero-badge {
  margin-bottom: 6px;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #e0ecff;
  color: #1d4ed8;
}

.hero-title {
  font-size: 2.4rem;
  line-height: 1.1;
  font-weight: 750;
  color: #0f172a;
  margin: 0;
}

.hero-subtitle {
  font-size: 1rem;
  color: #4b5563;
  max-width: 36rem;
  margin: 6px 0 0;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #6b7280;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  transform: translateY(-1.5px) scale(1.01);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45);
}

.btn-ghost {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-ghost:hover {
  background: #cbd5e1;
  transform: translateY(-1px);
}

/* Right side hero graphic: Live Model Overview */
.hero-graphic {
  flex: 0 0 40%; /* take ~40% of the row */
  min-width: 280px; /* don’t become too narrow */
  min-height: 260px; /* avoid looking “too thin” */
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.55);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.5);
  position: relative;
  isolation: isolate;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.hero-graphic:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.75);
  border-color: rgba(129, 140, 248, 0.8);
}

/* glowing animated border */
.hero-graphic::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 120deg,
    rgba(59, 130, 246, 0.15),
    rgba(45, 212, 191, 0.18),
    rgba(129, 140, 248, 0.15),
    rgba(59, 130, 246, 0.15)
  );
  opacity: 0.7;
  z-index: -1;
  filter: blur(6px);
  animation: hero-border-spin 14s linear infinite;
}

@keyframes hero-border-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hero-graphic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.hero-graphic-title {
  font-weight: 600;
}

.hero-graphic-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

/* pulsing “Healthy” dot */
.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.8);
  }
  60% {
    transform: scale(1.25);
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Model badges */
.hero-graphic-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hero-graphic-badges .badge {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

.hero-graphic-badges .badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #38bdf8;
}

/* shimmer effect over each badge */
.hero-graphic-badges .badge::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -30%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(248, 250, 252, 0.7),
    transparent
  );
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
  animation: badge-sheen 5s linear infinite;
}

/* staggered delays */
.hero-graphic-badges .badge:nth-child(2)::after {
  animation-delay: 1.2s;
}
.hero-graphic-badges .badge:nth-child(3)::after {
  animation-delay: 2.4s;
}
.hero-graphic-badges .badge:nth-child(4)::after {
  animation-delay: 3.6s;
}

@keyframes badge-sheen {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  25% {
    transform: translateX(160%);
    opacity: 0;
  }
  100% {
    transform: translateX(160%);
    opacity: 0;
  }
}

.hero-graphic-badges .badge:hover {
  background: rgba(37, 99, 235, 0.7);
  border-color: rgba(129, 140, 248, 0.9);
  box-shadow: 0 10px 20px rgba(30, 64, 175, 0.7);
  transform: translateY(-1px);
}

/* Example chat bubbles */
.hero-graphic-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.hero-bubble {
  max-width: 100%;
  font-size: 0.8rem;
  background: rgba(15, 118, 110, 0.35);
  border-radius: 14px;
  padding: 8px 10px;
  position: relative;
  border: 1px solid rgba(45, 212, 191, 0.4);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
  /* floating animation */
  animation: bubble-float 4.5s ease-in-out infinite;
}

.hero-bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(45, 212, 191, 0.18);
  pointer-events: none;
}

.hero-bubble.user {
  align-self: flex-end;
  background: rgba(37, 99, 235, 0.7);
  border-color: rgba(129, 140, 248, 0.6);
  animation-duration: 5.2s;
  animation-delay: 0.4s;
}

.hero-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.6);
  border-color: rgba(45, 212, 191, 0.8);
  background: rgba(21, 94, 117, 0.6);
}

@keyframes bubble-float {
  0% {
    transform: translateY(0);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.5);
  }
  50% {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.7);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.5);
  }
}

/* ===============================
   Cards & Grids
=============================== */
/*.grid-3 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}*/

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  padding: 18px 18px 18px;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  border-color: rgba(148, 163, 184, 0.7);
  background: #f9fafb;
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 6px;
  color: #0f172a;
}

.card-text {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
}

/* ==============
   Hero Card (Live Model Overview)
   ============== */

.hero-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ecfdf3;
  color: #15803d;
}

.hero-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  margin-right: 6px;
}

.hero-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-model-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 600;
}

.hero-card-footer {
  border-top: 1px dashed #e5e7eb;
  padding-top: 10px;
  margin-top: 4px;
}

.hero-example {
  font-size: 0.85rem;
  color: #4b5563;
  margin: 4px 0;
}

/* ===============================
   Demo Page (RAG)
=============================== */
.demo-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 20px;
}

.demo-info .demo-highlight {
  border-radius: 14px;
  background: #eff6ff;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #1e40af;
  margin-bottom: 10px;
}

.chat-demo-container {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  /* ⬆️ make the whole card taller */
  min-height: 10px; /* was 360px */
  border: 1px solid rgba(226, 232, 240, 0.9);
  /* ⬇️ added for wider box */
  max-width: 100%;      /* try 900 / 1100 / 1200 */
  width: 100%;
  max-width: 1100px;   /* increase to 1200 if you want even wider */
  margin: 0 auto 32px; /* center on page, add some bottom space */
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.chat-demo-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16);
}

.chat-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #16a34a;
}

.chat-widget-area {
  flex: 1;
  width: 100%;
  min-height: 600px;  /* force a chunky box */
  height: 600px;
  padding: 0;
  overflow: hidden;
  position: relative;
}

/* unchanged */
.chat-widget-area iframe,
.chat-widget-area > div {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0 0 18px 18px;
}

/* ===============================
   Contact Page
=============================== */
.contact-card {
  margin-top: 16px;
  padding: 24px 24px;
}

.form-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.contact-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  outline: none;
  background: #ffffff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
  background: #f9fafb;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-meta {
  display: grid;
  gap: 12px;
  font-size: 0.9rem;
  color: #64748b;
}

.contact-meta strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

/* ===============================
   Footer
=============================== */
.site-footer {
  margin-top: auto;
  padding: 16px 20px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: #f8fafc;
}

/* ===============================
   Responsive
=============================== */
@media (max-width: 960px) {
  .hero > .section-inner {
    flex-direction: column;
  }

  .hero-graphic {
    width: 100%;
    flex: 0 0 auto;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-name {
    font-size: 0.98rem;
  }

  .brand-tagline {
    display: none;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .section {
    padding: 30px 16px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.55rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .btn {
    width: auto;
  }
}

/* ===============================
   Chat frame (iframe) layout
   Used by /chat-frame.html
================================= */

.frame-root {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
}

/* Message list */
.messages {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

/* Base message bubble */
.chat-message {
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* User bubble (right, blue) */
.chat-message.user {
  margin-left: auto;
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Assistant bubble (left, grey) */
.chat-message.assistant {
  margin-right: auto;
  background: #e5e7eb;
  border-bottom-left-radius: 4px;
}

/* System / hint text */
.chat-message.system {
  margin: 4px auto 0;
  background: transparent;
  color: #6b7280;
  font-size: 0.8rem;
  text-align: left;
}

/* ===============================
   Markdown content inside assistant messages
================================= */

.chat-message.assistant h1,
.chat-message.assistant h2,
.chat-message.assistant h3 {
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.chat-message.assistant p {
  margin-bottom: 6px;
}

.chat-message.assistant ul,
.chat-message.assistant ol {
  margin-left: 18px;
  margin-bottom: 6px;
}

.chat-message.assistant li {
  margin-bottom: 3px;
}

.chat-message.assistant strong {
  font-weight: 600;
}

/* Tables from markdown (e.g. Annual Leave table) */
.chat-message.assistant table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  margin-bottom: 8px;
  font-size: 0.83rem;
  background: #f9fafb;
}

.chat-message.assistant table th,
.chat-message.assistant table td {
  border: 1px solid #d1d5db;
  padding: 6px 8px;
  vertical-align: top;
}

.chat-message.assistant table th {
  background: #f3f4f6;
  font-weight: 600;
}

.chat-message.assistant code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.06);
  padding: 1px 3px;
  border-radius: 4px;
}

/* ===============================
   Input row
================================= */

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.input-row input[type="text"] {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 7px 11px;
  font-size: 0.9rem;
  outline: none;
}

.input-row input[type="text"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.input-row button {
  border-radius: 999px;
  border: none;
  padding: 7px 14px;
  font-size: 0.9rem;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.input-row button:disabled {
  opacity: 0.6;
  cursor: default;
}

.input-row button:hover:not(:disabled) {
  background: #1d4ed8;
}

.input-row button .icon {
  font-size: 0.9rem;
}

