html, body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;  /* 🚫 prevent horizontal scroll */
  overflow-y: hidden;
  font-family: system-ui, sans-serif;
}

/* --- Header --- */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  height: 10vh;     /* match viewport units */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 0 20px;
  z-index: 20;
  backdrop-filter: blur(6px);
}

#app-header select#industry-filter {
  margin-right: 16px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 0.95rem;
}


#app-header h1 {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 700;
  color: #00eaff;
  text-shadow: 0 0 6px rgba(0, 234, 255, 0.6); /* softer glow */
}

#app-header .subtitle {
  margin: 2px 0 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: #ccc;
  text-shadow: 0 0 4px rgba(0, 234, 255, 0.3);
}

#app-header .header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

#app-header label {
  font-size: 0.95rem;
  color: #ccc;
}

#app-header select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 1rem;
}

/* --- Header Button --- */
#app-header button#tell-story {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #00eaff;     /* dark gray, matches header */
  color: #222;          /* white text */
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-right: 40px;   /* prevent bleed */
}

#app-header button:hover {
  background: #333;     /* slightly lighter gray on hover */
  transform: scale(1.05);
}

.subtle-btn {
  background: rgba(0, 234, 255, 0.1);
  border: 1px solid #00eaff;
  color: #00eaff;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  margin-right: 12px;
  transition: background 0.3s ease, color 0.3s ease;
}

.subtle-btn:hover {
  background: rgba(0, 234, 255, 0.25);
  color: #fff;
}

/* Role Filter dropdown */
#role-filter {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 0.95rem;
  appearance: none;         /* removes default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  width: auto;              /* shrink to fit text */
  min-width: 160px;         /* keep it readable */
  max-width: 220px;         /* prevent stretching */
  cursor: pointer;
}

/* Add a custom arrow */
#role-filter::after {
  content: "▼";
  font-size: 0.7rem;
  color: #00eaff;
  margin-left: 8px;
}


/* --- Map fills below header --- */
#map {
  position: absolute;
  top: 10vh;        /* start right below header */
  bottom: 0;
  left: 0;
  right: 0;
  background: #000;
}

/* --- Panel (tour controls) --- */
#panel {
  position: absolute;
  z-index: 15;
  top: 12%;
  left: 12px;
  background: rgba(255, 255, 255, 0.15);  /* light, translucent */
  border: 1px solid rgba(255, 255, 255, 0.25); /* subtle border */
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  display: grid;
  gap: 10px;
  color: #fff;
  font-size: 0.95rem;
  backdrop-filter: blur(10px); /* glass effect */
}

/* --- Buttons inside panel --- */
#panel button {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  background: rgba(0, 234, 255, 0.8); /* semi-transparent brand color */
  color: #111;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

#panel button:hover {
  background: rgba(0, 234, 255, 1);
  transform: translateY(-2px);
}

#panel button.secondary {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

#panel button.secondary:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* --- Dropdown (step speed) --- */
#panel select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 0.9rem;
}

/* --- Shared Side Panel Base --- */
.side-panel {
  position: fixed;
  top: 10vh;           /* below header */
  right: 0;
  bottom: 0;
  width: 400px;        /* unified width */
  background: rgba(20, 20, 20, 0.9); /* unified background */
  color: #fff;
  padding: 22px;       /* unified padding */
  box-shadow: -4px 0 12px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;

  overflow-y: auto;
  overflow-x: hidden;

  /* hidden state defaults */
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}


/* --- Story Panel --- */
#story-panel {
  z-index: 30;
}

#story-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

#story-form {
  display: block;      /* ✅ natural flow */
  overflow: visible;
}

#story-form > * {
  margin-bottom: 12px; /* keep spacing consistent */
}

#story-form input[type="text"],
#story-form input[type="number"],
#story-form select,
#story-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 0.95rem;
}


/* --- Info Panel --- */
#info-panel {
  z-index: 25;
}

#info-panel.open {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
}

#info-panel h2 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #00eaff;
  text-shadow: 0 0 6px #00eaff;
}

#info-panel p {
  margin: 6px 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

#info-panel blockquote {
  margin: 12px 0;
  padding-left: 12px;
  border-left: 3px solid #00eaff;
  font-style: italic;
  color: #ccc;
}

/* Role badges */
.role-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.role-badge.career {
  background: #00eaff;
  color: #111;
}

.role-badge.power {
  background: #444;
  color: #fff;
  border: 1px solid #00eaff;
}


/* --- Watermark --- */
#watermark {
  position: absolute;
  bottom: 15px;
  left: 15px;      /* stick to bottom-left */
  z-index: 999;    /* put it above all panels */
  width: 205px;
  opacity: 0.7;
  pointer-events: none;
}




/* close button (X) */
#close-story {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s ease;
}
#close-story:hover {
  color: #00eaff;
}
#story-panel h2 {
  margin-top: 0;
  color: #00eaff;
  text-shadow: 0 0 2px #00eaff;
  font-size: 1.1rem;
  font-weight: 700;
}

.step-helper {
  font-size: 0.8rem;
  color: #aaa;
  margin: -6px 0 12px 0; /* pull it a little closer to heading */
  font-style: italic;     /* optional */
}


/* Inputs */
#direct-quote {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
}

#story-form fieldset {
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

#story-form fieldset legend {
  font-weight: 600;
  color: #00eaff;
}

/* --- Autocomplete dropdown (dark theme) --- */
.suggestions-box {
  position: absolute;
  top: 100%;        /* place directly below input wrapper */
  left: 0;
  right: 0;
  background: #111;
  border: 1px solid #444;
  border-radius: 6px;
  margin-top: 4px;
  z-index: 1000;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.suggestions-box div {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #eee;
  background: #111;
  transition: background 0.2s ease, color 0.2s ease;

}

.suggestions-box div:hover {
  background: #00eaff;   /* brand color highlight */
  color: #111;           /* contrast text */
}



#tools-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid #444;
  padding: 5px;
  min-height: 40px;
  cursor: text;
  position: relative;
}

#tools-autocomplete {
  border: none;
  flex: 1;
  min-width: 150px;
  padding: 5px;
}

#tools-autocomplete:focus {
  outline: none;
}

#tools-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tool-tag {
  background: #00eaff;
  color: #111;
  border-radius: 3px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  font-size: 0.9em;
}

.tool-tag span {
  margin-right: 6px;
}

.tool-tag button {
  background: none;
  border: none;
  color: #111;
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
}


#work-location label,
#work-location select,
#work-location input {
  margin-top: 10px;   /* add vertical breathing room */
}

#work-location label:first-of-type {
  margin-top: 0;      /* don’t push down the first label (Country) */
}

#story-form textarea {
  resize: vertical;
}

/* Align checkboxes neatly */
#story-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

/* Modern checkbox styling */
#story-form input[type="checkbox"] {
  accent-color: #00eaff; /* modern browsers */
  transform: scale(1.2);
}

#story-panel.step1-open {
  background: rgba(0,0,0,1); /* fully opaque on step 1 */
}

/* Submit button pinned at bottom */
#story-form button[type="submit"] {
  margin-top: auto;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: #00eaff;
  color: #222;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

#story-form button[type="submit"]:hover {
  background: #00bcd4;
}

.form-row {
  display: flex;
  gap: 20px; /* space between the two columns */
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-col label {
  margin-bottom: 6px; /* space between label and input */
}

/* Extra spacing before Industry label specifically */
.form-col:nth-child(2) label {
  margin-top: 4px; /* push label down slightly */
}


/* Info badge styled like a distinct "cursive i" */
.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  background: #00eaff;
  color: #111;
  font-family: "Georgia", "Times New Roman", cursive; /* cursive-ish font */
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1;
  cursor: help;
  text-align: center;
  transition: background 0.3s ease, color 0.3s ease;
}

.info-badge:hover {
  background: #00bcd4;
  color: #000;
}

/* File upload wrapper */
.file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* Hide the default file input */
.file-upload input[type="file"] {
  display: none;
}

/* Custom label styled as subtle button */
.file-upload .file-label {
  background: rgba(0, 234, 255, 0.1);   /* subtle teal tint */
  border: 1px solid #00eaff;            /* teal outline */
  color: #00eaff;
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 500;                     /* lighter than Submit */
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.file-upload .file-label:hover {
  background: rgba(0, 234, 255, 0.2);   /* brighten a bit on hover */
  color: #fff;
}


/* Filename text */
.file-upload .file-name {
  color: #ccc;
  font-size: 0.9rem;
  max-width: 200px;        /* adjust as needed */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* adds "…" if too long */
}


.file-helper {
  font-size: 0.85rem;
  color: #aaa;
  margin: 6px 0 12px 0;
  line-height: 1.4;
}

#next-step {
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid #00eaff;
  border-radius: 6px;
  background: rgba(0, 234, 255, 0.1);
  color: #00eaff;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}


#next-step:hover {
  background: rgba(0, 234, 255, 0.25);
  color: #fff;
}

/* Add this to your CSS */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
  vertical-align: middle;
  margin-left: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.avatar-wrapper {
  width: 72px;       
  height: 72px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #ccc;     /* subtle border */
  box-shadow: 0 0 4px rgba(0,0,0,0.4); /* optional: give it some depth */
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.toast {
  position: fixed;
  top: 12vh; /* just under header (10vh) with small spacing */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 234, 255, 0.9); /* theme cyan with some transparency */
  color: #000; /* dark text for readability */
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0); /* little pop */
}

/* Chrome, Safari, Edge */
#years_in_field::-webkit-inner-spin-button,
#years_in_field::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
#years_in_field {
  -moz-appearance: textfield;
}

/* Data Viz Overlay */
#data-viz-panel {
  position: fixed;
  top: 10vh;  /* sit below the header */
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.95);
  color: #fff;
  z-index: 50; /* above map and panels */
  display: none; /* hidden by default */
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
}

#close-viz {
  position: absolute;
  top: 12px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: #00eaff;
  cursor: pointer;
}



.viz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns */
  grid-template-rows: repeat(2, 1fr);    /* 2 rows */
  gap: 12px;
  height: calc(100% - 40px);             /* fill the panel minus padding */
  box-sizing: border-box;
}

.viz-box {
  background: rgba(0,0,0,0.3);
  border: none;
  box-shadow: 0 0 8px rgba(0,234,255,0.15);
  border-radius: 10px;
  padding: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.viz-title {
  color: #00eaff;
  margin: 0 0 6px;
  font-size: 1rem;
  text-align: center;
}

.viz-box canvas {
  flex: 1; /* chart fills remaining box space */
  width: 100% !important;
}

/* Wrapper: KPIs (left) + Quotes (right) */
/* Snapshot container */
.snapshot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  height: 100%;
  box-sizing: border-box;
  align-items: start;
}

/* KPI section */
.kpi-section {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  color: #00eaff;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
}

/* KPI section */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 18px;                  /* a little more space between */
}

.kpi-card {
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 8px;
  padding: 24px 16px;          /* taller cards */
  text-align: center;
  min-height: 95px;           /* ensure consistent height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0,234,255,0.15); /* subtle cyan glow */
}

.kpi-value {
  font-size: 2rem;             /* larger value text */
  font-weight: bold;
  color: #00eaff;
  margin-bottom: 6px;
}

.kpi-label {
  font-size: 0.9rem;           /* bump label size slightly */
  color: #bbb;
}


/* Quote section */
.quote-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 8px;
  padding: 20px;
  overflow: hidden;
}

.quote-title {
  color: #00eaff;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: center;
}

.quote-rotator {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ddd;
  text-align: center;
  transition: opacity 0.6s ease;
  cursor: pointer;
}




/* Mobile: stack vertically with scroll */
/* --- Mobile cleanup --- */
@media (max-width: 768px) {
  /* Fullscreen panel: take everything under the header */
  .side-panel.fullscreen {
    top: 12vh;          /* match mobile header height */
    bottom: auto;
    height: calc(100vh - 12vh);
    width: 100%;
    border-radius: 0;
    transform: translateY(0);
  }

  /* Style the info panel close like #close-story */
  #close-info {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
  }
  #close-info:hover { color: #00eaff; }

  /* Hide subtitle entirely */
  #app-header .subtitle { display: none; }

  /* Hide the filters (industry + role) */
  #app-header label,
  #app-header select#industry-filter,
  #app-header select#role-filter {
    display: none;
  }

  /* Make header taller so buttons fit comfortably */
  #app-header {
    height: 12vh;
    padding: 0 12px;
    justify-content: space-between;
  }

  /* Shrink title text */
  #app-header h1 { font-size: 1.2rem; }

  /* Replace panel buttons with compact icon-style buttons */
  #panel {
    top: calc(12vh + 8px);  /* header height (12vh) + 8px gap */
    bottom: auto;
    left: 12px;
    transform: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }

  /* Add spacing between stacked buttons */
  #app-header #data-viz {
    margin-bottom: 8px;
  }

  #panel button {
    padding: 8px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    text-indent: -9999px; /* hide text labels */
    position: relative;
  }

  /* Add icons via pseudo-element */
  #panel button::after {
    text-indent: 0;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }


/* Map to actual button IDs */
  #panel button#prev::after    { content: "⏮"; }
  #panel button#playpause::after { content: "▶"; }   /* could toggle ⏸ in JS */
  #panel button#next::after    { content: "⏭"; }
  #panel button#restart::after { content: "⟲"; }

  #panel button#playpause::after {
    content: "⏸"; /* default state: playing */
  }
  #panel button#playpause.paused::after {
    content: "▶"; /* paused state */
  }
  /* Info/story panels: docked bottom, about 1/3 screen height */
  .side-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32vh;
    width: 100%;
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.5);
    transition: height 0.3s ease, transform 0.3s ease;
  }

  .side-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* Map stays visible behind */
  #map {
    top: 12vh;
    bottom: 0;
  }
  
  /* Lock the panel layout */
  #data-viz-panel {
    display: none;              /* keep hidden until opened */
    overflow-y: auto;           /* scroll inside panel */
  }

  /* Stack boxes vertically */
  .viz-grid {
    display: block;              /* stack naturally */
    height: auto !important;     /* don’t try to fill parent */
  }

  .viz-box {
    width: 100%;
    margin-bottom: 12px;         /* gap between boxes */
  }

  /* Make canvases behave */
  .viz-box canvas {
    height: 200px !important;    /* fixed height prevents flex loop */
    max-height: 200px;
  }

  /* Word map box: taller */
  #tags-cloud {
    min-height: 300px;   /* give it more room */
  }

  /* Hide employer type by industry on mobile */
  #employer-infographic {
    display: none !important;
  }
  /* Snapshot grid: single column */
  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  /* Hide the quotes entirely */
  .quote-section {
    display: none !important;
  }
}



