/* streamlit-shell.css — page chrome: top header, collapsible sidebar drawer,
   wide main container, app header row. Mimics Streamlit's wide layout. */

/* ---- Top header bar (thin, like Streamlit's) ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 3rem;
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 1rem;
}
/* No visible separator line under the header on scroll (matches Streamlit). */

.hamburger {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  display: inline-flex;
  line-height: 0;
}
.hamburger:hover {
  background: var(--secondary-bg);
}

/* ---- Sidebar drawer ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 21rem;
  max-width: 85vw;
  background: var(--secondary-bg);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 100;
  padding: 1.5rem;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}
.sidebar.open {
  transform: translateX(0);
}
.sidebar h1,
.sidebar h2,
.sidebar h3,
.sidebar p,
.sidebar label {
  color: var(--blue);
}
.sidebar-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.sidebar-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--blue);
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Main wide container ---- */
.main-container {
  /* Streamlit's layout="wide" has NO max-width — content fills the viewport minus
     5rem (80px) side padding (measured). Capping at 1200px made our side margins
     much larger than Streamlit's on wide screens. */
  max-width: none;
  margin: 0;
  padding: 1rem 5rem 6rem;
}
@media (max-width: 900px) {
  .main-container {
    padding: 1rem 1.5rem 4rem;
  }
}

/* ---- App header row (calculator animation + title) ---- */
.app-title-row {
  display: grid;
  grid-template-columns: 1fr 8fr;
  align-items: center;
  gap: 0.5rem;
}
.app-title-anim {
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-title {
  color: var(--blue);
  font-size: 2.8em;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.15;
}
.app-subtitle {
  color: var(--red);
  font-size: 1.1em;
  margin-top: 0;
  margin-bottom: 0.25rem;
}
.app-updateinfo {
  color: #555;
  font-size: max(1rem, 0.85em);
  margin-top: 0.15rem;
  font-style: italic;
}

/* ---- Mobile / small screens ---- */
@media (max-width: 600px) {
  .app-header {
    padding: 0 0.5rem;
  }
  .main-container {
    padding: 0.75rem 1rem 3rem;
  }
  .app-title-row {
    grid-template-columns: 1fr;
  }
  .app-title-anim {
    display: none; /* decorative calculator animation — hide on phones */
  }
  .app-title {
    font-size: 1.9em;
  }
  .app-subtitle {
    font-size: 1em;
  }
}

/* ---- Section subheaders ---- */
.step-header {
  color: var(--blue);
  font-size: 1.75rem; /* Streamlit markdown h3 = 1.75rem (28px) */
  font-weight: 600;
  /* ~16px gaps to neighbours (Streamlit's uniform vertical block gap). */
  margin: 1rem 0;
}
.subhead {
  font-size: 1.5rem; /* Streamlit markdown h4 (####) = 1.5rem (24px) */
  font-weight: 600;
  margin: 1rem 0;
}
/* Chart heading: like the source's "### {title}" — h3 size, DARK text (only the
   year/range inside is coloured), unlike the blue .step-header. */
.chart-heading {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.5rem 0;
}
/* Any Plotly chart in fullscreen keeps a white backdrop (not black) and fills width.
   The container passed to Plotly.newPlot gets the .js-plotly-plot class, so this
   covers both the results charts and the trend-page charts. */
.js-plotly-plot:fullscreen {
  background: #fff;
  width: 100%;
  display: flex;
  align-items: center;
}
.page-title {
  color: var(--purple);
}

/* ---- Generic info box (st.info style used throughout) ---- */
.info-box {
  background: var(--info-bg);
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 10px;
  /* Streamlit renders st.info / these reminder boxes in blue text (#0054a3),
     not the default near-black body colour. */
  color: var(--info-text);
}
.info-box .big {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--info-text);
}
/* st.success-style green box (Final Results in the occupation breakdown). */
.success-box {
  background: #e6f4ea;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  color: #177233;
}

/* Trend-mode "Analysis Period" box: extra gap below the year slider so the
   slider-to-box distance matches Streamlit (~32px track-to-box, measured). */
.trend-period {
  margin-top: 1.6rem;
}

/* ---- Column grid helpers (replicate st.columns) ---- */
.cols {
  display: grid;
  gap: 1rem;
  align-items: start;
}
.cols > * {
  min-width: 0; /* allow grid items to shrink so long content wraps instead of overflowing */
}
.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 800px) {
  .cols-3 {
    grid-template-columns: 1fr;
  }
}

/* Plotly: show a normal cursor on hover (no crosshair), matching dragmode:false. */
.js-plotly-plot .nsewdrag,
.js-plotly-plot .drag,
.js-plotly-plot .draglayer rect {
  cursor: default !important;
}

/* ---- City footer animation ---- */
.city-footer {
  height: 300px;
  margin-top: 2rem;
}

/* error/caption text */
.field-caption {
  font-size: 1rem; /* Streamlit st.caption = 0.875rem (14px) */
  /* Streamlit st.caption = textColor (#262730) at opacity 0.6 (measured), not a
     separate grey — gives the muted look while keeping the exact hue. */
  color: var(--text);
  opacity: 0.6;
  margin-top: 0.25rem;
}
.field-error {
  background: #fff0f1;
  border: 1px solid #ffc2c9;
  color: #b3093c;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
  font-size: 1rem;
}
