/*
 * High-tech dashboard theme
 * Combines the original compact layout helpers with a more immersive,
 * futuristic visual language.
 */

:root {
  --bg: #05070f;
  --bg-accent: #0c1424;
  --panel: rgba(16, 27, 46, 0.72);
  --panel-strong: rgba(16, 27, 46, 0.92);
  --panel-outline: rgba(120, 172, 255, 0.18);
  --text: #e6edf7;
  --muted: #7b89a6;
  --accent: #38bdf8;
  --accent-2: #a855f7;
  --success: #22c55e;
  --warning: #f97316;
  --danger: #ef4444;
  --card-radius: 18px;
  --shadow-1: 0 20px 45px rgba(2, 8, 23, 0.55);
  --shadow-2: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  --ring: rgba(56, 189, 248, 0.35);
  font-size: 16px;
}

html, body {
  min-height: 100%;
  background:
    radial-gradient(1200px 760px at -5% -5%, rgba(104, 117, 245, 0.22) 0%, transparent 55%),
    radial-gradient(1000px 600px at 110% 10%, rgba(14, 165, 233, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 45%, #03050b 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0.2px;
}

body {
  margin: 0;
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

h1, h2, h3, h4 {
  margin: 0 0 12px 0;
  font-weight: 600;
  letter-spacing: 0.4px;
}

h1 {
  font-size: 1.9rem;
  text-shadow: 0 6px 24px rgba(56, 189, 248, 0.24);
}

h2 {
  font-size: 1.25rem;
  color: var(--muted);
}

h3 {
  font-size: 1.05rem;
  color: var(--muted);
}

p {
  color: rgba(230, 237, 247, 0.92);
}

/* Compact control grid */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px 18px;
  align-items: end;
  background: linear-gradient(145deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--panel-outline);
  border-radius: var(--card-radius);
  padding: 18px;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 5;
}

.controls > div {
  position: relative;
  z-index: 5;
}

.controls label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

/* Dropdowns */
.compact-dropdown {
  position: relative;
  max-width: 240px;
  z-index: 10;
}

.compact-dropdown .Select-control {
         min-height: 40px;
         height: auto;
         background: rgba(8, 12, 22, 0.8);
         border: 1px solid rgba(56, 189, 248, 0.16);
         border-radius: 12px;
         transition: border-color 0.2s ease, box-shadow 0.2s ease;
         position: relative;
         padding-right: 76px;
     }

.compact-dropdown .Select-control:hover {
  border-color: rgba(168, 85, 247, 0.32);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* Keep dropdown background dark even while open / focused / with value */
.compact-dropdown.Select.is-open > .Select-control,
.compact-dropdown.Select.is-focused > .Select-control,
.compact-dropdown.Select.has-value > .Select-control {
  background: rgba(8, 12, 22, 0.8);
}

/* Multi-select: keep the control from becoming super tall */
.compact-dropdown.Select--multi .Select-control {
  max-height: 80px;
  overflow-y: auto;
}

/* Inner chip area – scroll instead of stretching forever */
.compact-dropdown.Select--multi .Select-multi-value-wrapper {
  max-height: 56px;
  overflow-y: auto;
}


/* Position arrow + clear “x” flush to the right of the control */
.compact-dropdown .Select-arrow-zone,
.compact-dropdown .Select-clear-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  padding: 0;
}

/* Clear-all “x” sits at the far right */
.compact-dropdown .Select-clear-zone {
  right: 12px;
}

/* Arrow is at the far right when alone… */
.compact-dropdown .Select-arrow-zone {
  right: 12px;
}

/* …but moves left when the clear “x” is present */
.compact-dropdown .Select-clear-zone ~ .Select-arrow-zone {
  right: 44px;
}


.compact-dropdown.is-open .Select-arrow {
  border-top-color: transparent;
  border-bottom-color: rgba(236, 244, 255, 0.75);
}

.compact-dropdown .Select-arrow {
   border-top-color: rgba(236, 244, 255, 0.75);
   }

.compact-dropdown .Select-placeholder,
.compact-dropdown .Select-value {
  font-size: 13px;
  padding: 6px 12px;
  color: rgba(242, 247, 255, 0.94);
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  align-items: center;
  white-space: normal;
}

.compact-dropdown.is-open .Select-arrow {
   border-top-color: transparent;
   border-bottom-color: rgba(236, 244, 255, 0.75);
   }
.compact-dropdown .Select-placeholder,
.compact-dropdown .Select-value {
  font-size: 13px;
  padding: 6px 12px;
  color: rgba(242, 247, 255, 0.94);
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  align-items: center;
  white-space: normal;
  }

.compact-dropdown .Select-multi-value-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px 6px;
}

.compact-dropdown.compact-dropdown--summary.Select--multi:not(.is-open) .Select-multi-value-wrapper {
  display: none; /* hide the chips when closed */
}

/* summary text overlay */
.compact-dropdown.compact-dropdown--summary.Select--multi:not(.is-open)::after {
  content: var(--dropdown-summary, "");
  position: absolute;
  inset: 0 36px 0 12px;
  display: flex;
  align-items: center;
  color: rgba(242, 247, 255, 0.7);
  font-size: 13px;
  pointer-events: none;   /* let clicks pass through */
  z-index: 0;             /* sit underneath the clickable layer */
  opacity: 0.9;
  transition: color 0.18s ease, opacity 0.18s ease;
}

/* clickable layer */
.compact-dropdown.compact-dropdown--summary .Select-control {
  min-height: 40px;
  position: relative;
  z-index: 1;             /* ensure the control gets the click */
}

/* when many chips are visible (menu open), keep them from becoming a massive column */
.compact-dropdown.compact-dropdown--summary .Select-multi-value-wrapper {
  max-height: 72px;
  overflow-y: auto;
}


.compact-dropdown.Select--single .Select-value,
.compact-dropdown.Select--single .Select-value-label {
  background: transparent;
  box-shadow: none;
}

.compact-dropdown.Select--multi .Select-value {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.45);
  margin: 4px 6px 4px 0;
  padding: 4px 10px;
  gap: 6px;
  align-items: center;
}

.compact-dropdown.Select--multi .Select-value-label {
  order: 1;
}

.compact-dropdown.Select--multi .Select-value-label {
  color: rgba(245, 248, 255, 0.98) !important;
  white-space: normal !important;
}

.compact-dropdown.Select--multi .Select-value-icon {
  border: 0;
  color: rgba(168, 195, 255, 0.85);
  font-size: 16px;
  transition: color 0.2s ease;
  order: 2;
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding-left: 6px;
}

.compact-dropdown.Select--multi .Select-value-icon:hover {
  color: rgba(239, 68, 68, 0.85);
}

.compact-dropdown .Select-input > input {
  height: 32px;
  line-height: 32px;
  padding: 0;
  color: rgba(242, 247, 255, 0.94);
}

.compact-dropdown .Select-value-label {
  color: rgba(242, 247, 255, 0.96) !important;
  white-space: normal !important;
}

/* Keep selected value text strong even with dropdown open */
.compact-dropdown.Select--single.is-open .Select-value-label {
  color: #ffffff !important;
  font-weight: 600;
}


.compact-dropdown .Select-menu-outer {
  position: absolute;
  z-index: 2000;
  background: rgba(5, 10, 20, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  box-shadow: 0 22px 48px rgba(3, 7, 18, 0.65);
  margin-top: 6px;
  overflow: hidden;
}

.compact-dropdown .Select-menu {
  background: transparent;
  border-radius: 10px;
}

.compact-dropdown .Select-option {
  background: transparent;
  color: rgba(226, 232, 240, 0.95);  /* a bit darker / higher-contrast */
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.6;
  white-space: normal;
  padding: 14px 14px;
}

.compact-dropdown .Select-option + .Select-option {
  margin-top: 4px;                /* gap between rows */
}

/* Hovered or selected option while menu is open */
.compact-dropdown .Select-option.is-focused,
.compact-dropdown .Select-option.is-selected {
  background: rgba(56, 189, 248, 0.28);
  color: #ffffff;          /* full white text */
  font-weight: 600;
}

/* Wider dropdown specifically for long article titles on Temporal Analysis */
.compact-dropdown--article-title {
  max-width: 420px;
  width: 100%;
}

/* Increase spacing between article titles in dropdown */
.compact-dropdown--article-title .Select-option {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
    line-height: 1.55 !important;
}

.compact-dropdown--article-title .Select-option {
    padding: 28px 24px !important;
}


.compact-dropdown--article-title .Select-option:last-child {
  border-bottom: none;
}


/* Give the article title menu more space + scroll */
.compact-dropdown--article-title .Select-menu-outer {
  max-height: 360px;
  width: 100%;
}

/* On smaller screens, just take the full width */
@media (max-width: 768px) {
  .compact-dropdown--article-title {
    max-width: 100%;
  }
}

/* animate arrow */
.compact-dropdown .Select-arrow {
  transition: transform 0.18s ease, border-top-color 0.18s ease, border-bottom-color 0.18s ease;
}

.compact-dropdown.is-open .Select-arrow {
  transform: rotate(180deg);
}

/* subtle neon glow when hovering the summary dropdown */
.compact-dropdown.compact-dropdown--summary .Select-control:hover {
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.22),
    0 18px 32px rgba(2, 6, 23, 0.7);
  border-color: rgba(168, 85, 247, 0.55);
}

/* brighten the summary text on hover */
.compact-dropdown.compact-dropdown--summary.Select--multi:not(.is-open):hover::after {
  color: rgba(248, 250, 252, 0.95);
  opacity: 1;
}


/* Event lag correlation – layout */
.lag-correlation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  margin: 12px 0 18px;
}

.lag-correlation-controls > div {
  min-width: 220px;
}

/* Make the first two (Event + Emotion) share the row nicely */
.lag-correlation-controls > div:nth-child(1),
.lag-correlation-controls > div:nth-child(2) {
  flex: 1 1 240px;
}

/* Lag window can grow but is allowed to wrap */
.lag-correlation-controls > div:nth-child(3) {
  flex: 1 1 200px;
}

/* On mobile, stack them again */
@media (max-width: 768px) {
  .lag-correlation-controls {
    flex-direction: column;
  }
}


/* Date range picker */
.date-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-filter .compact-dropdown--year {
  min-width: 110px;
  max-width: 140px;
}

.date-filter .compact-date {
  flex: 1 1 220px;
}

.compact-date {
  position: relative;
  max-width: 240px;
  width: 100%;
  z-index: 10;
}

.compact-date .DateRangePickerInput,
.compact-date .DateRangePickerInput__withBorder {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 40px;
  height: 40px;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}

.compact-date .DateRangePickerInput:hover,
.compact-date .DateRangePickerInput__withBorder:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
  background: rgba(8, 12, 22, 0.95);
}

.compact-date .DateRangePickerInput__withBorder {
  border: none;
}

.compact-date .DateInput,
.compact-date .DateInput input {
  background: transparent !important;
  border: none;
  box-shadow: none;
}

.compact-date .DateInput {
  width: 50%;
}

.compact-date .DateInput_input,
.compact-date .DateInput_input__focused {
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
  box-sizing: border-box;
  color: var(--text);
}

.compact-date .DateInput_input::placeholder {
  color: rgba(123, 137, 166, 0.7);
}

.compact-date .DateInput_input__focused {
  background: rgba(56, 189, 248, 0.08) !important;
  border-bottom: 2px solid rgba(56, 189, 248, 0.6);
}

.compact-date .DateRangePickerInput_arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: rgba(123, 137, 166, 0.8);
  background: rgba(8, 12, 22, 0.85);
}

.compact-date .DateRangePickerInput_arrow_svg,
.compact-date .DateRangePickerInput_arrow svg {
  fill: currentColor;
}

.compact-date .DateRangePickerInput_clearDates {
  display: none;
}

.compact-date .DayPicker {
  background: rgba(8, 12, 22, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 18px;
  box-shadow: 0 24px 40px rgba(3, 7, 18, 0.65);
}

.compact-date .CalendarMonth_caption {
  color: var(--text);
  font-weight: 600;
}

.compact-date .DayPicker_weekHeader_li {
  color: var(--muted);
  font-weight: 500;
}

.compact-date .CalendarDay__default,
.compact-date .CalendarDay__default:hover {
  border: 1px solid rgba(56, 189, 248, 0.12);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

.compact-date .CalendarDay__default:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #0d1220;
}

.compact-date .CalendarDay__selected,
.compact-date .CalendarDay__selected:active,
.compact-date .CalendarDay__selected:hover {
  background: rgba(56, 189, 248, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.8);
  color: #020617;
}

.compact-date .CalendarDay__blocked_out_of_range,
.compact-date .CalendarDay__blocked_out_of_range:hover {
  color: rgba(123, 137, 166, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.08);
  background: rgba(8, 12, 22, 0.65);
}

.compact-date .DayPickerNavigation_button {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: none;
  color: var(--text);
}

.compact-date .DayPickerNavigation_button:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #020617;
}

.date-clear-button {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.92);
  color: rgba(226, 232, 240, 0.92);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}

.date-clear-button:hover {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28);
}

/* --- Improve contrast for DatePicker month + header text --- */

/* Month header: "June 2021" */
.DateRangePicker .DayPicker .DayPicker-Caption div,
.DateRangePicker .CalendarMonth_caption {
  color: rgba(54, 69, 79, 0.95) !important;   /* bright readable text */
  font-weight: 600 !important;
}

/* Weekday row: Su Mo Tu We Th Fr Sa */
.DateRangePicker .DayPicker-Weekday abbr,
.CalendarMonth_table thead tr th {
  color: rgba(220, 230, 245, 0.85) !important;
  font-weight: 500 !important;
}

/* Darker background for the calendar panel itself */
.DateRangePicker .DayPicker,
.CalendarMonthGrid {
  background-color: rgba(15, 23, 42, 0.96) !important;
}


/* KPI layout */
.kpis {
  display: flex;
  gap: 14px 18px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 18px 0 24px;
}

.metric {
  position: relative;
  overflow: hidden;
  flex: 1 1 220px;
  min-width: 220px;
  background: linear-gradient(160deg, rgba(15, 31, 59, 0.92), rgba(8, 17, 32, 0.9));
  border: 1px solid var(--panel-outline);
  border-radius: var(--card-radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric::before {
  content: "";
  position: absolute;
  inset: -40% 40% 40% -40%;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.35), transparent 65%);
  opacity: 0.65;
  transform: rotate(8deg);
  pointer-events: none;
}

.metric:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px rgba(3, 7, 18, 0.65);
  border-color: rgba(56, 189, 248, 0.45);
}

.metric h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.metric p {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.metric--kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.metric-delta {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-delta--positive {
  color: var(--success);
}

.metric-delta--neutral {
  color: var(--muted);
}

.metric-delta--negative {
  color: var(--danger);
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
}

.metric-value--positive {
  color: var(--success);
}

.metric-value--neutral {
  color: var(--text);
}

.metric-value--negative {
  color: var(--danger);
}

.insights-panel {
  margin: 18px 0 32px;
  padding: 18px 22px;
  background: linear-gradient(150deg, rgba(10, 19, 35, 0.95), rgba(4, 9, 18, 0.92));
  border-radius: var(--card-radius);
  border: 1px solid var(--panel-outline);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}

.insights-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.2), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

.insights-panel h4 {
  margin-bottom: 10px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 0.95rem;
}

.insights-panel p {
  margin: 0 0 8px;
  color: rgba(230, 237, 247, 0.9);
  font-size: 0.95rem;
  line-height: 1.5;
}

.metric-sparkline {
  height: 64px;
}

/* Affect sections */
.affect-section {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: stretch;
  margin: 24px 0;
}

.affect-card {
  flex: 0 1 340px;
  min-width: 280px;
}

.affect-breakdown-card {
  flex: 1 1 360px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

.affect-breakdown-card .js-plotly-plot {
  flex: 1 1 auto;
}

/* Navigation */
.nav-links {
  margin: 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.floating-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  margin: 0 0 22px;

  background: linear-gradient(
      135deg,
      rgba(10, 18, 35, 0.92),
      rgba(4, 9, 18, 0.9)
  );
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--card-radius);
  backdrop-filter: blur(22px);

  box-shadow:
      0 20px 40px rgba(3, 7, 18, 0.65),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);

  overflow: hidden;
}


.nav-links .nav-button > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(14, 165, 233, 0.9));
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-nav .nav-button--active > button {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(14, 165, 233, 0.95));
  box-shadow: 0 16px 28px rgba(168, 85, 247, 0.4);
}

.nav-links .nav-button > button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(14, 165, 233, 0.4);
}

.nav-links .nav-button > button:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.35);
}

.nav-button--logout {
  margin-left: auto;
  order: 99;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(244, 114, 182, 0.85));
  border-color: rgba(239, 68, 68, 0.45);
  color: #fff;
  box-shadow: 0 14px 32px rgba(239, 68, 68, 0.35);
}





.nav-button--logout:hover {
    background: linear-gradient(135deg, rgba(255, 40, 40, 0.95), rgba(255, 90, 160, 0.95));
    transform: translateY(-3px);
    box-shadow:
        0 0 18px rgba(255, 40, 40, 0.85),
        0 0 28px rgba(255, 40, 40, 0.55),
        0 10px 32px rgba(0,0,0,0.45);
    filter: drop-shadow(0 0 8px rgba(255, 40, 40, 0.9));
}

.nav-button--logout:active {
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.4);
}

/* Buttons and primary actions */
.nav-button, .dash-button, button {
  background: linear-gradient(140deg, rgba(20, 31, 56, 0.92), rgba(9, 14, 24, 0.92));
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nav-button:hover, .dash-button:hover, button:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.42);
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.6), 0 0 0 3px var(--ring);
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background:
    radial-gradient(1200px 760px at -5% -5%, rgba(104, 117, 245, 0.18) 0%, transparent 55%),
    radial-gradient(1000px 600px at 110% 10%, rgba(14, 165, 233, 0.22) 0%, transparent 60%),
    linear-gradient(135deg, #030712 0%, #050b18 45%, #03050b 100%);
}

.login-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, rgba(11, 19, 33, 0.92), rgba(18, 32, 52, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 24px;
  padding: 32px 30px;
  box-shadow: 0 26px 65px rgba(2, 8, 23, 0.68), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
}

.login-card h1 {
  margin-bottom: 12px;
  font-size: 1.8rem;
}

.login-card p {
  margin-bottom: 18px;
  color: rgba(226, 232, 240, 0.88);
}

.login-credentials {
  list-style: none;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.login-credentials li {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 13px;
  letter-spacing: 0.4px;
  color: rgba(148, 163, 184, 0.95);
  padding: 4px 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.login-form > * {
  width: 100%;
}

.login-input {
  width: 100%;
  padding: 12px 18px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.login-submit {
  width: 100%;
  height: 48px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(14, 165, 233, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.38);
  box-shadow: 0 20px 36px rgba(14, 165, 233, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  font-size: 15px;
  box-sizing: border-box;
}

.login-submit:hover {
  box-shadow: 0 26px 48px rgba(14, 165, 233, 0.45);
}

.login-error {
  min-height: 20px;
}

.login-error-text {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 13px;
}

/* Network view */
.network-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  margin: 16px 0 6px;
}

/* --- Article Title dropdown: make selected values readable --- */

/* Make sure the chip and its label are bright, even when the menu is open */
.compact-dropdown--article-title.Select--multi .Select-value,
.compact-dropdown--article-title.Select--multi .Select-value-label {
  color: rgba(245, 248, 255, 0.98) !important;
}

/* Darken the chip background so the text doesn’t wash out */
.compact-dropdown--article-title.Select--multi .Select-value {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
}

/* (If you haven’t added the width tweak yet, keep this too) */
.compact-dropdown--article-title {
  max-width: 420px;
  width: 100%;
}

@media (max-width: 768px) {
  .compact-dropdown--article-title {
    max-width: 100%;
  }
}


.network-presets .compact-dropdown {
  width: 320px;
  max-width: 360px;
}

.network-presets label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(242, 247, 255, 0.88);
  margin-bottom: 6px;
  display: inline-block;
}

.network-presets__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 360px;
}

.network-viewport {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--panel-outline);
  border-radius: var(--card-radius);
  background: linear-gradient(145deg, var(--panel), var(--panel-strong));
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px);
}

.network-viewport .dash-cytoscape {
  border-radius: 12px;
  background: rgba(7, 12, 22, 0.9);
  box-shadow: var(--shadow-2);
}

#interaction-network {
  background: linear-gradient(160deg, rgba(8, 17, 32, 0.92), rgba(15, 23, 42, 0.92));
  border-radius: var(--card-radius);
  border: 1px solid var(--panel-outline);
  box-shadow: var(--shadow-1);
}

/* Event cards */
.event-mobilisation-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
}

.event-article-list,
.event-article-detail,
.article-detail-card {
  background: linear-gradient(145deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--panel-outline);
  border-radius: var(--card-radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(18px);
}

.event-article-list h3,
.event-article-detail h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--text);
}

.event-article-list p {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.article-detail-card--empty {
  border-style: dashed;
  color: rgba(123, 137, 166, 0.7);
}

.article-detail-card h4 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.article-detail-meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.article-detail-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}

/* Tables */
.dash-table-container .dash-spreadsheet-container {
  background: transparent !important;
}

.dash-table-container .dash-spreadsheet {
  border: 1px solid var(--panel-outline);
  background: linear-gradient(150deg, rgba(8, 16, 30, 0.95), rgba(12, 22, 40, 0.95)) !important;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-1);
}

.dash-table-container .dash-spreadsheet tr,
.dash-table-container .dash-spreadsheet td,
.dash-table-container .dash-spreadsheet th {
  color: rgba(248, 252, 255, 0.98) !important;
  font-weight: 600;
  border-color: rgba(148, 163, 184, 0.15) !important;
}

.dash-table-container .dash-spreadsheet td .dash-cell-value {
  color: rgba(255, 255, 255, 0.98) !important;
}

.dash-table-container .dash-spreadsheet th {
  color: #f8fbff !important;
  letter-spacing: 0.3px;
}

/* Graphs */
.js-plotly-plot,
.dash-graph,
.dash-graph .main-svg {
  width: 100% !important;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
  .metric {
    min-width: 200px;
  }

  .affect-card {
    flex: 1 1 100%;
  }

  .controls {
    gap: 12px 16px;
  }
}

@media (max-width: 768px) {
  .app {
    padding: 24px 16px 64px;
  }

  .controls {
    grid-template-columns: repeat(6, 1fr);
  }

  .controls > div {
    grid-column: span 6;
  }

  .compact-dropdown,
  .compact-date {
    max-width: 100%;
    width: 100%;
  }

  .metric {
    flex: 1 1 100%;
    min-width: 0;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links .nav-button {
    flex: 1 1 100%;
  }

  .nav-button--logout {
    width: 100%;
    margin-left: 0;
  }
}

/* ---------- Temporal Analysis: Article Title dropdown spacing ---------- */

/* Make each article option taller and add real breathing room between rows */
.compact-dropdown.compact-dropdown--article-title .Select-option {
  padding: 12px 20px !important;   /* inner padding */
  line-height: 1.7 !important;     /* more vertical room for multi-line titles */
}

/* Extra space *between* the options (on top of the padding) */
.compact-dropdown.compact-dropdown--article-title .Select-option + .Select-option {
  margin-top: 10px !important;     /* bigger gap between rows */
}

/* Keep the menu height reasonable */
.compact-dropdown.compact-dropdown--article-title .Select-menu-outer {
  max-height: 360px;
  width: 100%;
}



