/* GLOBAL BASE */

:root {
  --bg: #0b1020;
  --card: rgba(255,255,255,.06);
  --text: #e7ecff;
  --muted: rgba(231,236,255,.7);
  --stroke: rgba(231,236,255,.18);
}

* {
  box-sizing: border-box;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 1px solid rgba(231,236,255,.35);
  outline-offset: 3px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% 10%, #182552, var(--bg));
  color: var(--text);
  overflow-x: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.app {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 24px 5vw 60px 5vw;
  position: relative;
  z-index: 1;
}

/* TOP NAV */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0 18px;
  margin: -24px -5vw 0 -5vw;
  background: rgba(11,16,32,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(231,236,255,.12);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  width: 100%;
}

.top-nav a {
  color: rgba(231,236,255,.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.top-nav a:hover {
  color: #ffffff;
}

.brand {
  color: #ffffff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 0 14px;
}

/* RIGHT PANEL */

.controls-row {
  position: fixed;
  top: 112px;
  right: 5vw;
  z-index: 40;

  width: 16vw;

  padding: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: 0 10px 35px rgba(0,0,0,.30);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.side-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.side-panel-active {
  display: flex;
}

/* FILTERS */

.controls {
  display: grid;
  gap: 6px;
}

.controls label {
  font-size: 12px;
  color: var(--muted);
}

.controls select {
  width: 100%;
  min-width: 0;
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  font-size: 14px;
}

.controls select option {
  background-color: #182552;
  color: #e7ecff;
}

.selector-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  border-radius: 14px;
}

.selector-list-large {
  max-height: 260px;
}

.selector-option {
  position: relative;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px 8px 30px;

  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(231,236,255,.68);

  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;

  transition: background .15s ease, color .15s ease;
}

.selector-option::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 10px;
  height: 10px;
  border-radius: 999px;

  background: rgba(231,236,255,.22);
  box-shadow: 0 0 0 1px rgba(231,236,255,.08);
  transition: background .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.selector-option:hover {
  background: rgba(255,255,255,.05);
  color: rgba(231,236,255,.9);
}

.selector-option:hover::before {
  background: rgba(231,236,255,.55);
}

.selector-option-selected {
  color: #ffffff;
  background: rgba(255,255,255,.07);
}

.selector-option-selected::before {
  background: rgba(231,236,255,.95);
  box-shadow: 0 0 12px rgba(231,236,255,.25);
}

/* EVENT DETAIL PANEL */

.detail-back-btn {
  width: 100%;
  border: 1px solid rgba(231,236,255,.20);
  background: rgba(255,255,255,.07);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.detail-back-btn:hover {
  background: rgba(255,255,255,.12);
}

.event-detail {
  display: grid;
  gap: 14px;
}

.event-detail-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(231,236,255,.55);
  font-weight: 800;
}

.event-detail-title {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
}

.event-detail-row {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(231,236,255,.12);
}

.event-detail-row span {
  color: rgba(231,236,255,.55);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}

.event-detail-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  word-break: break-word;
}

.event-detail-link-wrap {
  padding-top: 8px;
}

.event-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  color: #ffffff;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(231,236,255,.22);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.event-detail-link:hover {
  background: rgba(255,255,255,.16);
}

/* EXPORT BUTTONS */

.export-btn {
  position: fixed;
  left: 0.95vw;
  z-index: 60;

  width: 54px;
  height: 54px;
  border-radius: 999px;

  border: 1px solid rgba(231,236,255,.28);
  background: rgba(255,255,255,.09);
  color: #e7ecff;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;

  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.export-btn-xls {
  top: 100px;
}

.export-btn-ppt {
  top: 165px;
}

.export-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.15);
  border-color: rgba(231,236,255,.45);
}

.export-btn:active {
  transform: translateY(0);
}

/* TIMELINE CARD */

.card {
  width: 71vw;
  margin-top: 22px;
  margin-left: 0;
  margin-right: 0;

  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 10px 35px rgba(0,0,0,.28);
  overflow: hidden;
}

#timeline {
  width: 100%;
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  overflow: hidden;
}

/* VIS TIMELINE */

.vis-timeline {
  border: none !important;
  background: transparent !important;
  overflow: hidden !important;
}

.vis-panel {
  border-color: rgba(255,255,255,.18) !important;
  overflow: hidden !important;
}

.vis-panel.vis-left {
  background: rgba(255,255,255,.03);
}

.vis-panel.vis-center,
.vis-panel.vis-left,
.vis-panel.vis-right {
  overflow: hidden !important;
}

.vis-time-axis .vis-text {
  color: rgba(255,255,255,.78) !important;
  font-size: 13px;
  font-weight: 500;
}

.vis-grid.vis-major {
  border-color: rgba(255,255,255,.22) !important;
}

.vis-grid.vis-minor {
  border-color: rgba(255,255,255,.10) !important;
}

.vis-labelset .vis-label {
  color: rgba(255,255,255,.88) !important;
  border-color: rgba(255,255,255,.12) !important;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,.03);
}

.vis-dot,
.vis-line {
  display: none !important;
}

/* EVENTS */

.vis-item {
  border-radius: 12px !important;
  border: none !important;
  color: #111827 !important;
  padding: 8px 12px !important;
  padding-left: 22px !important;
  font-size: 12px !important;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  max-width: 340px;
  overflow: visible !important;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.vis-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.30);
}

.vis-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  width: 24px;
  height: calc(100% + 16px);
  background: rgba(255,255,255,.45);
  border-radius: 999px;
  z-index: -1;
}

.vis-item::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #9ca3af;
  box-shadow: 0 0 0 2px rgba(255,255,255,.55);
}

.vis-item-content {
  display: block !important;
  max-width: 320px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

/* SOURCE */

.vis-item.source-chmp {
  background: #dccfff !important;
  color: #241447 !important;
}

.vis-item.source-fda {
  background: #f4e3c3 !important;
  color: #422c0b !important;
}

.vis-item.source-other {
  background: #ececec !important;
  color: #333333 !important;
}

/* SENTIMENT */

.vis-item.sentiment-pos::after {
  background: #22c55e;
}

.vis-item.sentiment-neg::after {
  background: #ef4444;
}

.vis-item.sentiment-warning::after {
  background: #f59e0b;
}

.vis-item.sentiment-other::after,
.vis-item.sentiment-neutral::after {
  background: #9ca3af;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .app {
    width: 96vw;
    margin: 0 auto;
    padding: 14px 14px 60px 14px;
  }

  .header {
    margin: -14px -14px 0 -14px;
  }

  .top-nav {
    gap: 16px;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 24px;
    order: -1;
    width: 100%;
    text-align: center;
  }

  .controls-row {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-top: 18px;
  }

  .export-btn {
    position: fixed;
    left: 18px;
  }

  .export-btn-xls {
    top: 120px;
  }

  .export-btn-ppt {
    top: 185px;
  }

  .card {
    width: 100%;
    margin-top: 22px;
  }

  .vis-item {
    max-width: 220px;
    font-size: 11px !important;
  }
}