@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  --primary: #0b2a44;
  --ocean: #1c6b8c;
  --ocean-soft: #7cc6dd;
  --accent: #2fc8c3;
  --accent-soft: rgba(47, 200, 195, 0.25);
  --coral: #ff8c7a;
  --text: #0a2438;
  --text-muted: rgba(10, 36, 56, 0.7);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-glass: rgba(255, 255, 255, 0.64);
  --border: rgba(28, 107, 140, 0.18);
  --shadow-soft: 0 16px 36px rgba(8, 34, 52, 0.18);
  --shadow-glass: 0 10px 22px rgba(8, 34, 52, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.7;
  background:
    radial-gradient(1000px 520px at 50% 15%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(900px 620px at 15% 75%, rgba(124, 198, 221, 0.35), transparent 70%),
    linear-gradient(180deg, #e8f6ff 0%, #cdeefe 45%, #a6d9ee 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(185deg, rgba(10, 36, 56, 0.05) 0 1px, transparent 1px 20px),
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(140% 80% at 50% 100%, rgba(28, 107, 140, 0.18), transparent 65%);
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.65), transparent 65%);
  pointer-events: none;
  z-index: -1;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4);
  position: relative;
  z-index: 1;
}

.app-header {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) calc(var(--space-4) + 6px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(120%);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.brand h1 {
  font-family: "Playfair Display", "Manrope", serif;
  font-size: 34px;
  margin: 0 0 var(--space-1);
  color: var(--primary);
  letter-spacing: 0.4px;
}

.brand p {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.header-logos {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-logos img {
  height: 90px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(8, 34, 52, 0.18));
}

.header-authors {
  margin: 0 0 var(--space-1);
  font-size: 13px;
  color: rgba(10, 36, 56, 0.6);
}

.tabs {
  margin-top: var(--space-4);
  border-bottom: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tab {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(47, 200, 195, 0.18);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tab::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(47, 200, 195, 0.3);
  opacity: 0;
  transition: var(--transition);
}

.tab:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(47, 200, 195, 0.4);
  box-shadow: 0 10px 20px rgba(8, 34, 52, 0.16);
}

.tab:hover::after {
  opacity: 1;
}

.tab--selected {
  background: linear-gradient(120deg, rgba(47, 200, 195, 0.22), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(47, 200, 195, 0.55);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(47, 200, 195, 0.22), 0 14px 26px rgba(8, 34, 52, 0.18);
}

.tab--selected::after {
  opacity: 1;
  background: linear-gradient(90deg, rgba(47, 200, 195, 0.75), rgba(47, 200, 195, 0.2));
  box-shadow: 0 0 12px rgba(47, 200, 195, 0.35);
}

.tab-container {
  background: var(--surface-glass);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glass);
  margin-top: var(--space-2);
  backdrop-filter: blur(18px) saturate(120%);
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(18px) saturate(120%);
}

.section h2 {
  margin-top: 0;
  color: var(--primary);
  font-family: "Playfair Display", "Manrope", serif;
  letter-spacing: 0.3px;
}

.section h3 {
  margin-top: var(--space-3);
  color: rgba(10, 36, 56, 0.9);
}

.section p,
.section li {
  color: var(--text-muted);
}

.hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-text h1 {
  font-family: "Playfair Display", "Manrope", serif;
  margin: 0 0 var(--space-2);
  font-size: 30px;
  color: var(--primary);
}

.hero-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
  flex: 1;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}

.kpi {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  border: 1px solid rgba(47, 200, 195, 0.25);
  box-shadow: 0 10px 20px rgba(8, 34, 52, 0.15);
  position: relative;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(47, 200, 195, 0.16);
  pointer-events: none;
}

.kpi span {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  letter-spacing: 0.3px;
}

.kpi small {
  font-size: 12px;
  color: var(--text-muted);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.button-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.btn {
  background: rgba(47, 200, 195, 0.2);
  border: 1px solid rgba(47, 200, 195, 0.4);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: rgba(47, 200, 195, 0.32);
  box-shadow: 0 8px 16px rgba(8, 34, 52, 0.18);
}

.dropdown .Select-control,
.dropdown .Select-menu-outer,
.dropdown .Select-menu {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 200, 195, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.dropdown .Select-placeholder,
.dropdown .Select-value-label,
.dropdown .Select-input {
  color: var(--text);
}

.numeric-input,
.text-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 200, 195, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-weight: 600;
}

.numeric-input:focus,
.text-input:focus {
  outline: 2px solid rgba(47, 200, 195, 0.4);
  box-shadow: 0 0 0 3px rgba(47, 200, 195, 0.15);
}

.radio-group label {
  font-weight: 600;
  color: var(--text);
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.dash-graph {
  background: var(--surface-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 10px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(16px);
}

.dash-graph .js-plotly-plot,
.dash-graph .plotly,
.dash-graph svg {
  background: transparent !important;
}

.js-plotly-plot .plotly .main-svg .bg {
  fill: rgba(0, 0, 0, 0) !important;
}

.js-plotly-plot .plotly .xtick text,
.js-plotly-plot .plotly .ytick text,
.js-plotly-plot .plotly .gtitle,
.js-plotly-plot .plotly .legend text,
.js-plotly-plot .plotly .annotation-text {
  fill: var(--text) !important;
}

.js-plotly-plot .plotly .xgrid,
.js-plotly-plot .plotly .ygrid {
  stroke: rgba(10, 36, 56, 0.12) !important;
}

.dash-table-container,
.dash-table-container .dash-spreadsheet-container {
  background: transparent !important;
}

.dash-table-container .dash-spreadsheet {
  background: rgba(255, 255, 255, 0.88) !important;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}

.dash-table-container th,
.dash-table-container td {
  background: rgba(255, 255, 255, 0.8) !important;
  color: var(--text) !important;
}

.dash-table-container th {
  font-weight: 700;
  color: var(--primary) !important;
}

.helper-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.note {
  background: rgba(47, 200, 195, 0.12);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  color: var(--text);
}

.summary-block {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
}

.rc-slider {
  padding: 6px 0;
}

.rc-slider-rail {
  background-color: rgba(10, 36, 56, 0.2);
}

.rc-slider-track {
  background-color: var(--accent);
}

.rc-slider-handle {
  border: 2px solid var(--accent);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 200, 195, 0.15);
}

:focus-visible {
  outline: 2px solid rgba(47, 200, 195, 0.5);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .tab-container {
    padding: 18px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 16px;
  }

  .tab {
    font-size: 12px;
    padding: 8px 14px;
  }

  .section {
    padding: 18px;
  }

  .header-logos img {
    height: 70px;
  }
}
