/* OVALBIS custom styles (Bootstrap 5 handles the heavy lifting). */

/* -------------------------------------------------------------------
   Brand colors
   ------------------------------------------------------------------- */
:root {
  --ovalbis-navy: #0f172a;
  --ovalbis-navy-light: #1e293b;
  --ovalbis-teal: #14b8a6;
  --ovalbis-purple: #7c3aed;
  --ovalbis-purple-light: #a78bfa;
}

/* -------------------------------------------------------------------
   Landing page — Hero section (split layout, dark)
   ------------------------------------------------------------------- */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--ovalbis-navy) 0%, var(--ovalbis-navy-light) 100%);
  color: #fff;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.hero-tagline {
  color: var(--ovalbis-teal);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-headline {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
}

.hero-section .btn-hero {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hero-section .btn-hero:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
}

.trust-text {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* -------------------------------------------------------------------
   Landing page — Dashboard mockup (right side of hero)
   ------------------------------------------------------------------- */
.dashboard-mockup {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  font-size: 0.8rem;
  color: #334155;
}

.mockup-sidebar {
  background: var(--ovalbis-navy);
  color: #94a3b8;
  min-width: 130px;
}

.mockup-sidebar .mock-nav-item {
  padding: 6px 12px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mockup-sidebar .mock-nav-item.active {
  background: var(--ovalbis-purple);
  color: #fff;
  border-radius: 6px;
  margin: 0 6px;
  padding: 6px 8px;
}

.mockup-metric-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
}

.mockup-metric-card .metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.mockup-metric-card .metric-change {
  font-size: 0.65rem;
  font-weight: 600;
}

.health-gauge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #e2e8f0;
  border-top-color: #22c55e;
  border-right-color: #22c55e;
  border-bottom-color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #22c55e;
}

.mockup-chart-line {
  height: 48px;
  position: relative;
}

.mockup-chart-line svg {
  width: 100%;
  height: 100%;
}

/* -------------------------------------------------------------------
   Landing page — Section headings
   ------------------------------------------------------------------- */
.section-eyebrow {
  color: var(--ovalbis-teal);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section-heading::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--ovalbis-purple);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.section-heading.text-center::after {
  margin-left: auto;
  margin-right: auto;
}

/* -------------------------------------------------------------------
   Landing page — Platform choice cards
   ------------------------------------------------------------------- */
.platform-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.platform-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.12) !important;
}

.platform-card .platform-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   Landing page — Feature tiles
   ------------------------------------------------------------------- */
.feature-tile {
  border: none;
  border-radius: 12px;
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.feature-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   Landing page — Engine module cards (kept for possible reuse)
   ------------------------------------------------------------------- */
.engine-card {
  border: none;
  border-radius: 0.75rem;
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.engine-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.1);
}

.engine-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------
   Product cards (legacy — kept for backward compat)
   ------------------------------------------------------------------- */
.product-card {
  border: none;
  border-radius: 0.75rem;
  border-top: 4px solid;
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

.landing-card {
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

/* -------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------- */
.site-footer {
  background: linear-gradient(135deg, var(--ovalbis-navy) 0%, var(--ovalbis-navy-light) 100%);
  color: #94a3b8;
  font-size: 0.875rem;
}

.site-footer h6 {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer ul li {
  margin-bottom: 0.5rem;
}

.site-footer ul li a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer ul li a:hover {
  color: var(--ovalbis-teal);
}

.site-footer .footer-brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.site-footer .footer-tagline {
  font-size: 0.8rem;
  color: #64748b;
  max-width: 260px;
}

.site-footer .footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-footer .footer-social a:hover {
  background: var(--ovalbis-purple);
  color: #fff;
}

.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #475569;
}

/* -------------------------------------------------------------------
   Global app styles
   ------------------------------------------------------------------- */
.badge.bg-info.text-dark {
  letter-spacing: 0.03em;
}

.dropdown-menu form {
  margin: 0;
}

.dropdown-menu form button.dropdown-item.active {
  background-color: var(--bs-primary);
  color: #fff;
}

/* -------------------------------------------------------------------
   Simulation shell (blueprint SS2/SS44/SS45)
   ------------------------------------------------------------------- */
.sim-shell {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.sim-sidebar {
  width: 240px;
  flex: 0 0 240px;
  position: sticky;
  top: 1rem;
  background: var(--ovalbis-navy);
  color: #cbd5e1;
  border-radius: 0.75rem;
  overflow: hidden;
}

.sim-sidebar .sim-brand {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-sidebar .sim-brand .sim-brand-title {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  margin: 0;
}

.sim-sidebar .sim-brand .sim-brand-sub {
  color: var(--ovalbis-teal);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sim-sidebar .sim-nav {
  padding: 0.6rem 0.6rem 1rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.sim-sidebar .sim-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0.9rem 0.55rem 0.35rem;
  margin: 0;
}

.sim-sidebar .sim-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.42rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.875rem;
}

.sim-sidebar .sim-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sim-sidebar .sim-link.active {
  background: var(--ovalbis-purple);
  color: #fff;
  font-weight: 600;
}

.sim-sidebar .sim-link.disabled {
  color: #52607a;
  pointer-events: none;
}

.sim-sidebar .sim-link .sim-soon {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  text-transform: uppercase;
}

.sim-main {
  flex: 1 1 auto;
  min-width: 0;
}

.sim-quick-panel {
  width: 270px;
  flex: 0 0 270px;
  position: sticky;
  top: 1rem;
}

.sim-quick-panel .sim-qp-section {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.sim-quick-panel .sim-qp-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.sim-quick-panel .sim-qp-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.12rem 0;
}

.sim-round-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sim-round-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #dee2e6;
  color: #495057;
  background: #fff;
  padding: 0 0.35rem;
}

.sim-round-dot.completed {
  background: #d1fae5;
  border-color: #a7f3d0;
  color: #065f46;
}

.sim-round-dot.completed:hover {
  background: #a7f3d0;
}

.sim-round-dot.current {
  background: var(--ovalbis-purple);
  border-color: var(--ovalbis-purple);
  color: #fff;
}

@media (max-width: 1199.98px) {
  .sim-quick-panel {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .sim-shell {
    flex-direction: column;
  }
  .sim-sidebar {
    width: 100%;
    flex: 1 1 auto;
    position: static;
  }
}

/* -------------------------------------------------------------------
   Phase 9 — Dark mode (Bootstrap 5.3 data-bs-theme)
   ------------------------------------------------------------------- */
/* The navbar toggle sets data-bs-theme="dark" on <html> and remembers
   the choice in localStorage. Bootstrap recolors its own components;
   the overrides below fix the hand-rolled bits: the bg-light body,
   bg-white card headers and the quick-panel separators. */

#theme-toggle {
  text-decoration: none;
  line-height: 1;
}

[data-bs-theme="dark"] body.bg-light {
  background-color: var(--bs-body-bg) !important;
}

[data-bs-theme="dark"] .card-header.bg-white {
  background-color: var(--bs-card-bg) !important;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] .sim-quick-panel .sim-qp-section {
  border-bottom-color: var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .sim-round-dot {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .sim-round-dot.completed {
  background: #14532d;
  border-color: #166534;
  color: #bbf7d0;
}

[data-bs-theme="dark"] .sim-round-dot.current {
  background: var(--ovalbis-purple);
  border-color: var(--ovalbis-purple);
  color: #fff;
}

/* -------------------------------------------------------------------
   Phase 9 — Print / Save-as-PDF styles
   ------------------------------------------------------------------- */
/* Used by the simulation final report ("Print report" button): strip
   the navigation chrome so the report prints clean, and force a light
   palette even when the reader uses dark mode. */

@media print {
  html[data-bs-theme="dark"] {
    --bs-body-bg: #fff;
    --bs-body-color: #212529;
    --bs-secondary-color: #4b5563;
    --bs-tertiary-bg: #f8f9fa;
    --bs-card-bg: #fff;
    --bs-card-cap-bg: rgba(0, 0, 0, 0.03);
    --bs-border-color: #dee2e6;
  }

  .navbar,
  .site-footer,
  .sim-sidebar,
  .sim-quick-panel,
  .report-actions,
  .alert,
  .btn {
    display: none !important;
  }

  body.bg-light,
  [data-bs-theme="dark"] body.bg-light {
    background: #fff !important;
  }

  main.container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .sim-shell {
    display: block;
  }

  .sim-main {
    width: 100% !important;
  }

  .card {
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .table-responsive {
    overflow: visible !important;
  }
}

/* -------------------------------------------------------------------
   Intelligence shell (blueprint SS67/SS68/SS69)
   ------------------------------------------------------------------- */
.intel-shell {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.intel-sidebar {
  width: 240px;
  flex: 0 0 240px;
  position: sticky;
  top: 1rem;
  background: var(--ovalbis-navy);
  color: #cbd5e1;
  border-radius: 0.75rem;
  overflow: hidden;
}

.intel-sidebar .intel-brand {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.intel-sidebar .intel-brand .intel-brand-title {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  margin: 0;
}

.intel-sidebar .intel-brand .intel-brand-sub {
  color: var(--ovalbis-purple-light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intel-sidebar .intel-nav {
  padding: 0.6rem 0.6rem 1rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.intel-sidebar .intel-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0.9rem 0.55rem 0.35rem;
  margin: 0;
}

.intel-sidebar .intel-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.42rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.875rem;
}

.intel-sidebar .intel-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.intel-sidebar .intel-link.active {
  background: var(--ovalbis-purple);
  color: #fff;
  font-weight: 600;
}

.intel-sidebar .intel-link.disabled {
  color: #52607a;
  pointer-events: none;
}

.intel-sidebar .intel-link .intel-soon {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  text-transform: uppercase;
}

.intel-main {
  flex: 1 1 auto;
  min-width: 0;
}

.intel-quick-panel {
  width: 270px;
  flex: 0 0 270px;
  position: sticky;
  top: 1rem;
}

.intel-quick-panel .intel-qp-section {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.intel-quick-panel .intel-qp-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.intel-quick-panel .intel-qp-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.12rem 0;
}

/* Command Center cards (feature 1/62/69) */
.intel-summary-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ovalbis-purple);
}

.intel-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.intel-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

/* Dark mode (Bootstrap 5.3 data-bs-theme) */
[data-bs-theme="dark"] .intel-quick-panel .intel-qp-section {
  border-bottom-color: var(--bs-border-color-translucent);
}

[data-bs-theme="dark"] .intel-kpi-label,
[data-bs-theme="dark"] .intel-quick-panel .intel-qp-title {
  color: var(--bs-secondary-color);
}

/* Print / Save-as-PDF: keep only the page content. */
@media print {
  .intel-sidebar,
  .intel-quick-panel {
    display: none !important;
  }

  .intel-shell {
    display: block;
  }

  .intel-main {
    width: 100% !important;
  }
}

@media (max-width: 1199.98px) {
  .intel-quick-panel {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .intel-shell {
    flex-direction: column;
  }
  .intel-sidebar {
    width: 100%;
    flex: 1 1 auto;
    position: static;
  }
}
