/* ========= JOB FAIR CALENDAR STYLES (Best Hire theme) =========
   Primary:   #1d5b8b
   Secondary: #ffab00  (virtual event type only)
   Highlight: #3ac6f4  (ALL highlights: today/next/selected/list-next)
============================================================== */

:root{
  --bh-blue: #1d5b8b;
  --bh-blue-2: #164a70;
  --bh-yellow: #ffab00;
  --bh-yellow-2: #e49a00;
  --bh-green: #2e7d32;

  /* NEW: One source of truth for ALL highlight UI */
  --bh-highlight: #3ac6f4;

  --text: #1f2937;
  --muted: #6b7280;

  --border: #e5e7eb;
  --border-2: #d1d5db;

  --card: #ffffff;
  --soft: #f8fafc;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --shadow-2: 0 6px 18px rgba(0,0,0,.08);
}

/* ===== Base wrapper ===== */

.jf-wrapper {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--text);
}

.jf-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.jf-title {
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.jfc-year-inline {
  font-size: 1.05rem;
  font-weight: 800;
  margin-left: 0.5rem;
  color: var(--muted);
}

/* ===== Controls ===== */

.jf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.jf-select {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  min-width: 150px;
  font-size: 0.92rem;
  background: #fff;
  color: var(--text);
  outline: none;
}
.jf-select:focus{
  border-color: rgba(29,91,139,.55);
  box-shadow: 0 0 0 3px rgba(29,91,139,.12);
}

/* Grid/List buttons (fix “text disappears on hover”) */
.jfc-view-btn {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-2);
  background: #fff;
  color: var(--bh-blue);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.jfc-view-btn:hover{
  background: rgba(29,91,139,.08);
  border-color: rgba(29,91,139,.35);
  color: var(--bh-blue);
}
.jfc-view-btn:active{ transform: translateY(1px); }

.jfc-view-btn.is-active {
  background: var(--bh-blue);
  border-color: var(--bh-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(29,91,139,.18);
}
.jfc-view-btn.is-active:hover{
  background: var(--bh-blue-2);
  border-color: var(--bh-blue-2);
  color: #fff;
}

.jfc-reset-btn{
  padding: 0.4rem 0.7rem;
  border: 1px solid #1d5b8b;
  background: #fff;
  color: #1d5b8b;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}
.jfc-reset-btn:hover{
  background: #1d5b8b;
  color: #fff;
}

/* ===== Details panel ===== */

.jf-details {
  margin-top: 0.25rem;
  margin-bottom: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
  background: var(--soft);
  box-shadow: var(--shadow);
}
.jf-details-title { font-weight: 800; margin-bottom: 0.25rem; }
.jf-details-empty { font-size: 0.92rem; color: var(--muted); }

.jf-event-list { margin: 0.6rem 0 0; padding: 0; list-style: none; }
.jf-event-item { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.jf-event-item:first-child { border-top: none; }

.jf-event-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}
.jf-event-title { font-weight: 900; font-size: 1.02rem; }
.jf-event-cityline { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.2rem; color: #111827; }
.jf-event-meta { font-size: 0.86rem; color: #4b5563; line-height: 1.45; }

/* Badge in details panel */
.jf-event-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  border: 1px solid var(--border);
  background: #eef7ff;
  color: var(--bh-blue);
  white-space: nowrap;
}
.jf-event-type-badge::before{
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: var(--bh-blue);
}
.jf-event-type-badge.virtual{
  background: #fff7e6;
  border-color: rgba(255,171,0,.45);
  color: #7a5200;
}
.jf-event-type-badge.virtual::before{ background: var(--bh-yellow); }
.jf-event-type-badge.special{
  background: #ecf8ee;
  border-color: rgba(46,125,50,.35);
  color: #1b5e20;
}
.jf-event-type-badge.special::before{ background: var(--bh-green); }
/* Some JS uses "in-person" as a class; safe styling */
.jf-event-type-badge.in-person{
  background: #eef7ff;
  border-color: rgba(29,91,139,.35);
  color: var(--bh-blue);
}
.jf-event-type-badge.in-person::before{ background: var(--bh-blue); }

/* Details CTA button */
.jf-event-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.6rem;
  padding: 0.65rem 1rem;
  background: var(--bh-blue);
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 900;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 14px rgba(29,91,139,.18);
}
.jf-event-button:hover{
  background: var(--bh-blue-2);
  box-shadow: 0 10px 22px rgba(29,91,139,.22);
}
.jf-event-button:active{ transform: translateY(1px); }

/* ===== Legend ===== */

.jf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.85rem 0 0.75rem;
  font-size: 0.85rem;
  color: #374151;
}
.jf-legend-item { display: flex; align-items: center; gap: 0.45rem; font-weight: 800; }
.jf-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.jf-legend-dot.inperson { background: var(--bh-blue); }
.jf-legend-dot.virtual { background: var(--bh-yellow); }
.jf-legend-dot.special { background: var(--bh-green); }

/* ===== Grid Calendar ===== */

.jf-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.jf-month {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.jf-month-name {
  text-align: center;
  font-weight: 900;
  margin-bottom: 0.55rem;
  font-size: 0.98rem;
  color: #111827;
}

.jf-weekdays,
.jf-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.78rem;
}

.jf-weekday {
  text-align: center;
  font-weight: 900;
  padding: 0.2rem 0;
  color: var(--muted);
}

.jf-day {
  text-align: center;
  padding: 0.22rem 0;
  min-height: 28px;
  cursor: default;
  border-radius: 10px;
  user-select: none;
  color: #111827;
}

/* Event day base */
.jf-day-event {
  cursor: pointer;
  position: relative;
  font-weight: 900;
  background: #eef7ff;
  border-radius: 12px;
  border: 1px solid rgba(29,91,139,.25);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

/* IMPORTANT:
   Your current JS adds classes like:
   jf-type-in-person | jf-type-virtual | jf-type-special
*/
.jf-day-event.jf-type-in-person{
  background: #eef7ff;
  border-color: rgba(29,91,139,.25);
}
.jf-day-event.jf-type-virtual{
  background: #fff7e6;
  border-color: rgba(255,171,0,.45);
}
.jf-day-event.jf-type-special{
  background: #ecf8ee;
  border-color: rgba(46,125,50,.35);
}

/* Dot indicator */
.jf-day-event::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: var(--bh-blue);
}
.jf-day-event.jf-type-virtual::after { background: var(--bh-yellow); }
.jf-day-event.jf-type-special::after { background: var(--bh-green); }

.jf-day-event:hover{
  box-shadow: 0 0 0 3px rgba(29,91,139,.12);
}

/* =========================================================
   Grid "selected", "today", and "next upcoming" states
   REQUIREMENT: ALL highlights use #3ac6f4 (var --bh-highlight)
========================================================= */

.jf-day.jf-day-selected {
  outline: 3px solid rgba(112, 209, 241, 0.70);
  outline-offset: 2px;
}

/* Today highlight */
.jf-day.jf-day-today {
  box-shadow: inset 0 0 0 2px rgba(112, 209, 241, 0.95);
  background: rgba(112, 209, 241, 0.22);
}

/* If Today is also an event day, keep event background but add Today ring */
.jf-day-event.jf-day-today{
  box-shadow: inset 0 0 0 2px rgba(112, 209, 241, 0.98);
}

/* Override dot for Today so it reads clearly */
.jf-day.jf-day-today::after{
  background: var(--bh-highlight) !important;
}

/* Next upcoming highlight (NOW BLUE, not yellow) */
.jf-day.jf-day-next {
  box-shadow: inset 0 0 0 2px rgba(112, 209, 241, 0.95);
  background: rgba(112, 209, 241, 0.18);
}

/* Dot override for Next as well */
.jf-day.jf-day-next::after{
  background: var(--bh-highlight) !important;
}

/* ===== List View (Best Hire colors) ===== */

.jfc-listwrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}

.jfc-list-header {
  display: grid;
  grid-template-columns: 160px 1fr 220px 140px;
  gap: 0;
  padding: 0.85rem 1rem;
  font-weight: 900;
  background: #f3f6fb;
  border-bottom: 1px solid var(--border);
  color: #111827;
}

.jfc-list-body {
  max-height: 650px;
  overflow: auto;
}

/* sticky month */
.jfc-month-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
  padding: 0.7rem 1rem;
  font-weight: 1000;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: #111827;
}

/* rows */
.jfc-row {
  display: grid;
  grid-template-columns: 160px 1fr 220px 140px;
  gap: 0;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #eef2f7;
  align-items: center;
  transition: background .12s ease;
}

.jfc-row:hover { background: #fafcff; }

.jfc-col-date { font-weight: 900; color: #111827; }
.jfc-col-name { font-weight: 900; }
.jfc-col-type { font-weight: 900; color: #111827; }
.jfc-col-info { text-align: right; }

/* Highlight the "next upcoming" row in list view (NOW BLUE, not yellow) */
.jfc-row.jfc-row-next {
  background: rgba(112, 209, 241, 0.16);
}

/* Event Info “pill button” (fix funky look + hover text issues) */
.jfc-info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  border: 1px solid rgba(29,91,139,.22);
  background: rgba(29,91,139,.08);
  color: var(--bh-blue);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.jfc-info-link::after{
  content: "→";
  font-weight: 1000;
}
.jfc-info-link:hover{
  background: var(--bh-blue);
  border-color: var(--bh-blue);
  color: #fff;
}
.jfc-info-link:active{ transform: translateY(1px); }

/* =========================
   List View – Type Pills
   (Requires JS to output .jfc-type-badge + jfc-type-*)
========================= */

.jfc-type-badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.92rem;
  line-height: 1;
  white-space: nowrap;
  border: 2px solid rgba(0,0,0,0.08);
  background: #f7f8fa;
  color: #1f2937;
  cursor: pointer;
  user-select: none;
}

.jfc-type-badge::before{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9ca3af;
}

/* In-person (blue) */
.jfc-type-badge.jfc-type-in-person,
.jfc-type-badge.jfc-type-in-person-job-fair{
  background: #eef4fa;
  color: var(--bh-blue);
  border-color: rgba(29,91,139,.35);
}
.jfc-type-badge.jfc-type-in-person::before,
.jfc-type-badge.jfc-type-in-person-job-fair::before{
  background: var(--bh-blue);
}

/* Virtual (yellow stays) */
.jfc-type-badge.jfc-type-virtual,
.jfc-type-badge.jfc-type-virtual-job-fair{
  background: #fff3d6;
  color: #8a5a00;
  border-color: rgba(255,171,0,.45);
}
.jfc-type-badge.jfc-type-virtual::before,
.jfc-type-badge.jfc-type-virtual-job-fair::before{
  background: var(--bh-yellow);
}

/* Featured / Special (green) */
.jfc-type-badge.jfc-type-featured,
.jfc-type-badge.jfc-type-special{
  background: #eaf5ea;
  color: var(--bh-green);
  border-color: rgba(46,125,50,.35);
}
.jfc-type-badge.jfc-type-featured::before,
.jfc-type-badge.jfc-type-special::before{
  background: var(--bh-green);
}

.jfc-type-badge:hover{
  filter: brightness(0.99);
  transform: translateY(-1px);
  transition: transform 120ms ease, filter 120ms ease;
}

/* ===== Responsive ===== */

@media (max-width: 980px) {
  .jf-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .jfc-list-header, .jfc-row {
    grid-template-columns: 140px 1fr 200px 120px;
  }
}

@media (max-width: 720px) {
  .jf-header { flex-direction: column; align-items: flex-start; }
  .jf-year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .jfc-list-header { display: none; }
  .jfc-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
  }
  .jfc-col-info { text-align: left; }
}

@media (max-width: 520px) {
  .jf-year-grid { grid-template-columns: minmax(0, 1fr); }
  .jf-month { padding: 0.75rem; }
}

/* Soft render polish (no layout jump) */
.jfc-embed.jfc-is-updating #jfc-view-grid,
.jfc-embed.jfc-is-updating #jfc-view-list {
  opacity: 0.55;
  transition: opacity 140ms ease;
}
#jfc-view-grid,
#jfc-view-list {
  transition: opacity 140ms ease;
}

/* Reset button (if JS injects it) */
.jfc-reset-btn {
  margin-top: 0px;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #ffab00;
  color: #1d5b8b;
  font-weight: 800;
  cursor: pointer;
}
.jfc-reset-btn:hover { filter: brightness(0.98); }

/* Reset button hover/focus: keep text readable */
.jfc-reset-btn:hover,
.jfc-reset-btn:focus {
  background: #f3a300;
  color: #1d5b8b;
  border-color: rgba(0,0,0,0.18);
  outline: none;
}
.jfc-reset-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(29, 91, 139, 0.25);
}

/* =========================================================
   NEW: Collapsible filter bar (mobile UX)
   JS injects: #jfc-filters-toggle + toggles .jfc-filters-collapsed on .jfc-embed
========================================================= */

.jfc-filters-toggle{
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: #fff;
  color: var(--bh-blue);
  font-weight: 900;
  cursor: pointer;
  width: 100%;
}

@media (max-width: 640px) {
  .jfc-filters-toggle{
    display: inline-flex;
    margin-bottom: 10px;
  }

  /* collapsed state */
  .jfc-embed.jfc-filters-collapsed .jf-controls{
    display: none;
  }
}

/* =========================================================
   MOBILE PORTRAIT FIX (List View)
   - Removes right-side whitespace
   - Stacks row content into a clean card layout
========================================================= */

@media (max-width: 560px) {
  /* Controls: 2-col grid + full-width rows where needed */
  .jf-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  /* Grid/List buttons should span full width nicely */
  .jfc-view-btn {
    width: 100%;
    justify-content: center;
  }

  /* Dropdowns full width */
  .jf-select {
    width: 100%;
    min-width: 0; /* prevent forcing overflow */
  }

  /* Month selector + reset button span full width */
  #jf-filter-month,
  .jfc-reset-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* Hide the desktop header row */
  .jfc-list-header {
    display: none !important;
  }

  /* CRITICAL: force rows to 1-column layout (kills whitespace) */
  .jfc-row {
    grid-template-columns: 1fr !important;
    gap: 10px;
    align-items: start;
    padding: 14px 14px;
  }

  /* Make each cell behave like a block row */
  .jfc-col-date,
  .jfc-col-name,
  .jfc-col-type,
  .jfc-col-info {
    width: 100%;
    text-align: left !important;
    justify-self: start;
  }

  /* Type badge sits naturally under the title */
  .jfc-col-type {
    margin-top: 2px;
  }

  /* Event Info button: don’t float right; make it feel like an action */
  .jfc-col-info {
    margin-top: 6px;
  }

  .jfc-info-link {
    width: auto;
    max-width: 100%;
    justify-content: center;
  }
}

/* Slightly larger phones */
@media (min-width: 561px) and (max-width: 720px) {
  .jfc-row {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .jfc-list-header {
    display: none !important;
  }
  .jfc-col-info {
    text-align: left !important;
  }
}