body { background: #f8f9fa; }

/* Required field indicator styling - only show red asterisk for actual required fields */
.form-label:has(+ input[required]),
.form-label:has(+ select[required]),
.form-label:has(+ textarea[required]) {
  /* marker for required fields */
}

.form-label:has(+ input[required])::after,
.form-label:has(+ select[required])::after,
.form-label:has(+ textarea[required])::after {
  content: ' *';
  color: #dc3545;
  font-weight: bold;
}

#categoryButtonGroup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-check-wrapper {
  display: inline-block;
}

#subCategoryOther.invalid-other {
  border-color: #dc3545;
  border-width: 2px;
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  border-width: 2px;
}

.entry-card { margin-bottom: 0.75rem; }
.entry-card { position: relative; }
.entry-title { font-weight: 600; display: inline-flex; align-items: center; }
.heart-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.heart-toggle:hover { color: #d6336c; }
.heart-toggle.active { color: #d6336c; }
.heart-toggle:focus { outline: 2px solid #11693D; outline-offset: 2px; }
.plan-gold .heart-toggle { display: inline-flex; }
.meta { font-size: 0.9rem; color: #444; }
.raw-json { font-family: monospace; font-size: 0.85rem; white-space: pre-wrap; background:#fff; padding:8px; border-radius:6px; border:1px solid #e9ecef; }

@media (min-width: 768px) {
	#filesAccordion { max-height: 80vh; overflow: auto; padding-right: 8px; }
}

/* responsive adjustments */
.logo-img { height: 44px; object-fit: contain; }
#map { width:100%; height:100%; min-height:300px; border-radius:6px; overflow:hidden; box-shadow:0 0 6px rgba(0,0,0,0.08); }

@media (max-width: 767.98px) {
  .logo-img { height: 34px; }
  #map { height: 50vh; min-height: 220px; }
  #filesAccordion { max-height: 55vh; }
  #resultsPanel { margin-bottom: 12px; }
  #categoryCheckboxes { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  #searchActionsCol { width: 100%; }
}

/* remove left-side padding for main container to eliminate left gutter */
main.container-fluid { padding-left: 0.5rem; padding-right: 0.5rem; }

/* ads panel styling */
#adsPanel { border-left: 1px solid rgba(0,0,0,0.04); }
#adsPanel .adsbygoogle { min-height: 250px; }

/* ensure state input is compact like zip on small screens */
#stateInput { width: 60px; }

/* Theme styles */
/* .theme-light .navbar { background-color: #ffffff !important; }
.theme-light .navbar .nav-link { color: #000 !important; }
.theme-light .navbar .navbar-brand, .theme-light .navbar .navbar-brand img { color: #000; } */
body.theme-light { background: #ffffff; color: #111; }
body.theme-dark { background: #1f2937; color: #e6eef8; }

/* theme switch styles */
.theme-switch { display: inline-block; position: relative; }
.theme-switch input { display: none; }
.theme-switch .slider { display: inline-block; width: 54px; height: 20px; border-radius: 999px; position: relative; box-sizing: border-box; padding: 2px; transition: background .12s, border-color .12s; background-color: gray !important; border: 1px solid #9ca3af; }
.theme-switch .slider .icon { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; line-height: 1; transition: opacity .12s, color .12s; }
.theme-switch .slider .icon.sun { left: 6px; }
.theme-switch .slider .icon.moon { right: 6px; }
.theme-switch .slider::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; top: 50%; transform: translateY(-50%); left: 2px; transition: left .12s, background .12s, box-shadow .12s; box-shadow: 0 2px 6px rgba(2,6,23,0.25); background: var(--switch-knob); z-index: 1; }
.theme-switch input:checked + .slider::after { left: calc(100% - 22px); }

/* subtle inner track glow when active */
.theme-switch .slider::before { content: ''; position: absolute; inset: 3px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03)); pointer-events: none; }

/* hide/show icons appropriately when knob overlaps them */
.theme-switch input + .slider .icon.sun { opacity: 1; }
.theme-switch input + .slider .icon.moon { opacity: 1; }
.theme-switch input:checked + .slider .icon.sun { opacity: 0.15; }
.theme-switch input:checked + .slider .icon.moon { opacity: 1; }
.theme-switch input:not(:checked) + .slider .icon.moon { opacity: 0.15; }

/* theme variables for switch; will be overridden by theme classes */
:root { --switch-bg: #e9ecef; --switch-border: #c8c8c8; --switch-knob: #ffffff; --switch-icon: #212529; }
.theme-light { --switch-bg: #f0f0f0; --switch-border: #bdbdbd; --switch-knob: #ffffff; --switch-icon: #111; }
.theme-dark { --switch-bg: #2b3440; --switch-border: #4b5563; --switch-knob: #111827; --switch-icon: #e6eef8; }
.theme-switch .slider { background: var(--switch-bg); border: 1px solid var(--switch-border); }
.theme-switch .slider::after { background: var(--switch-knob); }
/* Force a consistent medium gray track regardless of theme */
.theme-switch .slider { background-color: gray !important; border-color: #4b5563 !important; }
.theme-switch .slider .icon { color: var(--switch-icon); }

/* Make the switch line up nicely with navbar links */
.navbar .theme-switch .slider { height: 20px; width: 54px; padding: 2px; vertical-align: middle; background-color: gray !important; }
.navbar .theme-switch .slider::after { width: 20px; height: 20px; }

/* Force dark-theme switch appearance regardless of current theme */
.theme-switch .slider { background-color: #2b3440 !important; border-color: #4b5563 !important; }
.theme-switch .slider::after { width: 20px !important; height: 20px !important; background: #111827 !important; box-shadow: 0 2px 6px rgba(0,0,0,0.6) !important; z-index: 2; }
.theme-switch .slider .icon { color: #ffffff !important; opacity: 1 !important; z-index: 99999 !important; pointer-events: none; }
.theme-switch input:checked + .slider::after { left: calc(100% - 22px) !important; }
.navbar .theme-switch .slider { background-color: #2b3440 !important; border-color: #4b5563 !important; vertical-align: middle; }

/* ensure icons overlay the knob */
.theme-switch .slider .icon { z-index: 9999; pointer-events: none; }
.theme-switch .slider::after { z-index: 1; }

/* Theme-specific icon opacity & color: visible in dark, hidden in light */
body.theme-dark .theme-switch .slider .icon.sun,
body.theme-dark .theme-switch .slider .icon.moon { opacity: 1 !important; color: white !important; }
/* removed: icons hidden in light theme - now icons remain visible regardless of theme */

/* vertical alignment: center in navbar */
.navbar .theme-switch .slider { vertical-align: middle; }

/* Align the switch vertically with navbar text */
.navbar .theme-switch .slider { vertical-align: middle; }

/* Explicit icon colors: moon = black, sun = white */
.theme-switch .slider .icon.sun { color: #ffffff; opacity: 0; }
.theme-switch .slider .icon.moon { color: #000000; opacity: 1; }

/* Make both sun and moon icons visible and styled appropriately */
/* (reverted custom icon overrides) */
/* .theme-switch .slider .icon.sun { opacity: 1 !important; color: #FFD43B !important; left: 8px !important; } */
/* .theme-switch .slider .icon.moon { opacity: 1 !important; color: #ffffff !important; right: 8px !important; } */
/* .navbar .theme-switch .slider .icon.sun { color: #FFD43B !important; } */
/* .navbar .theme-switch .slider .icon.moon { color: #ffffff !important; } */

/* card and control colors per theme */
.theme-light .card { background: #ffffff; color: #111; }
.theme-dark .card { background: #0b1220; color: #e6eef8; border-color: rgba(255,255,255,0.04); }
.theme-dark .meta, .theme-dark .entry-title { color: #dfe9f3; }
.theme-dark .btn-outline-primary { color: #cce3ff; border-color: #2b6cb0; }
.theme-dark .btn-outline-secondary { color: #cbd5e1; border-color: #374151; }
.theme-dark .alert-info { background-color: #0b1220; color: #cbd5e1; border-color: #1f2937; }

/* apply theme to main container and common controls */
.theme-light main.container { background: #ffffff; }
.theme-dark main.container { background: #071019; }
.theme-dark #filesAccordion, .theme-dark .accordion, .theme-dark .accordion-body { background: transparent; color: var(--text-color, #e6eef8); }
.theme-dark .raw-json { background: #0b1220; color: #dfe9f3; border-color: #1f2937; }
.theme-dark .form-control { background: #071019; color: #e6eef8; border-color: #22303b; }
.theme-dark input::placeholder { color: #9aa7b6; }
.theme-dark .card { background: #071019; }
.theme-dark .navbar, .theme-dark .navbar .navbar-brand { background-color: #071019 !important; }

/* ensure select styling for radius follows theme */
.theme-dark .form-select { background: #071019; color: #e6eef8; border-color: #22303b; }

/* Category checkbox row styling */
#categoryCheckboxes { gap: 8px; }
#categoryCheckboxes .form-check { margin: 0; }
#categoryCheckboxes .form-check-label { margin-left: 0.3rem; font-size: 0.9rem; }

/* Keep category controls on single line: reduce label and checkbox font sizes */
#categoryDiv .form-label { font-size: 0.85rem; margin-right: 0.5rem; }
#categoryCheckboxes { gap: 6px; white-space: nowrap; }
#categoryCheckboxes .form-check-label { font-size: 0.75rem; margin-left: 0.2rem; }
#categoryCheckboxes .form-check-input { transform: scale(0.9); }

/* Favorites filter checkbox: match category checkbox styling */
#favoritesFilterGroup { display: flex; flex-direction: column; justify-content: center; gap: 0px; }
#favoritesFilterGroup .form-check { margin-top: 0; margin-bottom: 0; line-height: 1; }
#favoritesFilterGroup .form-check:nth-child(2) { margin-top: -5px; }
#favoritesFilterGroup .form-check-label { font-size: 0.75rem; margin-left: 0.25rem; margin-top: 0; margin-bottom: 0; }
#favoritesFilterGroup .form-check-input { transform: scale(0.85); margin-top: 0; margin-bottom: 0; }

/* Ensure table headers vertically center their content (images + text alignment) */
table.table th { vertical-align: middle !important; }

/* Memberships section heading: slightly larger than table header text */
#membershipsView h1 { font-size: 1.25rem; font-weight: bold; }

/* Memberships table: controlled column widths */
#membershipsView table.table { table-layout: fixed; }
#membershipsView table.table th:first-child,
#membershipsView table.table td:first-child { width: 40%; }
#membershipsView table.table th:not(:first-child),
#membershipsView table.table td:not(:first-child) { width: 15%; padding-left: 5px; padding-right: 5px; }

/* Bottom-align Free header to match Bronze/Silver/Gold text baseline */
table.table thead th { vertical-align: bottom !important; }

/* (removed flex display that was causing column headers to stack) */

/* Panel header pin and color label */
.panel-pin { display: inline-block; vertical-align: middle; margin-left: 10px; }
.panel-pin svg { height: 14px; width: 14px; display: inline-block; vertical-align: middle; }
.panel-color-label { margin-left: 6px; font-size: 0.85rem; color: #444; }
.theme-dark .panel-color-label { color: #d0d8e3; }

/* keep pin inline immediately after the title with a 10px gap */
.accordion-button { position: relative; }
.accordion-button .panel-pin { position: static; right: auto; top: auto; transform: none; margin-left: 10px; }
.accordion-button .panel-pin svg { display: block; }

/* hide header color/pin when on Free plan */
body.plan-free .panel-pin,
body.plan-free .panel-color-label { display: none !important; }



/* small touch: ensure zip input doesn't expand too wide on very small screens */
@media (max-width: 575.98px) {
  #zipInput { min-width: 60px !important; }
}

/* zip validation feedback: hidden by default, shown when input has validation state */
#zipInput + .invalid-feedback, #zipInput + .valid-feedback { display: none; }
#zipInput.is-invalid + .invalid-feedback { display: block; }
#zipInput.is-valid + .valid-feedback { display: block; }

/* Accordion: ensure dark theme items and buttons are dark and readable */
.theme-dark .accordion-item { background: #071019; color: #e6eef8; border-color: rgba(255,255,255,0.04); }
.theme-dark .accordion-button { background: #071019; color: #e6eef8; border: 1px solid rgba(255,255,255,0.03); box-shadow: none; }
.theme-dark .accordion-button:not(.collapsed) { background: #0b1220; color: #e6eef8; }
.theme-dark .accordion-button::after { filter: invert(1) brightness(1.4); }

.btn-theme { padding: 4px 8px; }

.entry-highlight { box-shadow: 0 0 0 2px rgba(13,110,253,0.15); background: #e9f5ff; border-left: 4px solid #0d6efd; }

/* Verification badge in card action row */
.verif-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.verif-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.verif-full { background-color: #198754; }
.verif-full .verif-icon { background-color: #198754; }
.verif-partial { background-color: #ff9900; color: #212529; }
.verif-partial .verif-icon { background-color: #ff9900; }
.verif-none { background-color: #dc3545; color: #fff; }
.verif-none .verif-icon { background-color: #dc3545; }

/* ensure card content doesn't sit under badge */
.entry-card .card-body { padding-top: 0.75rem; }

/* FINAL OVERRIDES: force dark-style appearance for theme toggle in all themes */
.theme-switch .slider,
.navbar .theme-switch .slider {
  background: gray !important;
  border-color: #4b5563 !important;
}
.theme-switch .slider::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.04)) !important;
}
.theme-switch .slider::after {
  /* knob color changed from #111827 to #11693d per user request; previous value kept here for revert */
  /* previous: background: #111827 !important; */
  background: #11693d !important;
  box-shadow: 0 3px 8px rgba(2,6,23,0.6) !important;
  width: 20px !important;
  height: 20px !important;
  z-index: 2 !important;
}
.theme-switch .slider .icon {
  color: #ffffff !important;
  opacity: 1 !important;
  z-index: 999999 !important;
}
.theme-switch input:checked + .slider::after {
  left: calc(100% - 22px) !important;
}

/* Strong navbar overrides: force #11693D background and white text in all themes */
.theme-light .navbar, 
body.theme-light .navbar,
.theme-dark .navbar, 
body.theme-dark .navbar,
.theme-dark .navbar, 
.theme-dark .navbar .navbar-brand,
.navbar, 
.navbar.bg-dark, 
.navbar.navbar-dark {
  background-color: #11693D !important;
  color: #ffffff !important;
}
.navbar .nav-link, 
.theme-light .navbar .nav-link,
.navbar .navbar-brand, 
.navbar .navbar-text, 
.navbar .navbar-toggler {
  color: #ffffff !important;
}
/* make dropdown match navbar colors */
.navbar .dropdown-menu {
  background-color: #11693D !important;
  border: none;
}
.navbar .dropdown-item {
  color: #fff !important;
}
.navbar .dropdown-item:hover, .navbar .dropdown-item:focus {
  background-color: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

/* Modal button styles: primary (green matching navbar) and cancel (dark gray) */
.modal-btn-primary {
  background-color: #11693D !important;
  border-color: #11693D !important;
  color: #fff !important;
}
.modal-btn-primary:hover { background-color: #0f5f33 !important; border-color: #0f5f33 !important; }
.modal-btn-cancel {
  background-color: #343a40 !important;
  border-color: #343a40 !important;
  color: #fff !important;
}
.modal-btn-cancel:hover { background-color: #2b3236 !important; border-color: #2b3236 !important; }

/* Ensure search actions are right-aligned across breakpoints */
#searchActionsCol { justify-content: flex-end !important; }

  /* Profile dropdown: remove caret for the profile toggle only */
  #profileDropdownToggle::after { display: none !important; }

  /* Narrow the profile dropdown to fit text and add small margins */
  #profileDropdownMenu {
    min-width: 0 !important;
    width: auto !important;
    white-space: nowrap;
    padding: 2px !important;
  }

  #profileDropdownMenu .dropdown-item {
    padding: 2px 6px !important; /* 2px vertical margins */
    font-size: 10pt !important;
  }

  /* Ensure the dropdown border and background match navbar but remain compact */
  #profileDropdownMenu { border-radius: 4px; }

  /* Position profile dropdown so its left edge aligns with the profile icon's left border */
  #profileNav { position: relative; }
  #profileNav .dropdown-menu {
    right: auto !important;
    left: 0 !important;
    transform: none !important;
    transform-origin: left top !important;
  }
/* selected plan checkmark prefix */
.dropdown-item.selected-plan::before {
  content: '✓';
  display: inline-block;
  margin-right: 0.5rem;
  color: #fff;
  font-weight: 600;
}
/*
.navbar .navbar-brand img { filter: none !important; opacity: 1 !important; }
.navbar .navbar-toggler-icon { filter: brightness(0) invert(1) !important; }
*/

/* Sponsor panel: bottom of mainPanel */
#sponsorPanel { margin-top: 0.5rem; }
#sponsorPanel .sponsor-overlay {
  position: absolute;
  bottom: -2px; /* slightly below the panel */
  background: rgba(255,255,255,0.92); /* light background for visibility */
  color: #111; /* dark text on light background */
  padding: 0; /* remove padding per request */
  border-radius: 4px;
  font-weight: bold; /* emphasized per request */
  font-size: 0.8rem; /* slightly smaller */
  box-shadow: 0 1px 3px rgba(2,6,23,0.08);
  z-index: 1065;
}
#sponsorPanel a { color: inherit; text-decoration: none; }

/* Ensure sponsor image and container always fill the panel height and resize responsively */
#sponsorPanel { height: 100px; }
#sponsorPanel .col-12, #sponsorPanel a { height: 100%; display: block; }
#sponsorPanel img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; border-radius: 6px; }

@media (max-width: 767.98px) {
  #sponsorPanel { height: 80px !important; }
  #sponsorPanel .sponsor-overlay { bottom: -2px; font-size: 0.75rem; }
}

/* Fix sponsor and ads panels to bottom on medium+ screens */
@media (min-width: 768px) {
  /* width reserved for ads panel when fixed */
  :root { --ads-panel-width: 220px; }

  /* Fix the ads panel to the bottom-right */
  #adsPanel {
    position: fixed;
    right: 0;
    bottom: 0;
    width: var(--ads-panel-width);
    height: 100px;
    z-index: 1060;
    border-left: 1px solid rgba(0,0,0,0.06);
    background: transparent;
    box-sizing: border-box;
    padding: 8px;
    display: block !important;
  }
  #adsPanel .adsbygoogle { min-height: 0; height: 100%; }

  /* Sponsor panel occupies the bottom area left of the ads panel */
  #sponsorPanel {
    position: fixed;
    left: 0;
    bottom: 0;
    height: 100px !important;
    width: calc(100% - var(--ads-panel-width));
    z-index: 1050;
    padding: 8px;
    box-sizing: border-box;
    margin: 0;
    background: transparent;
  }

  /* Ensure the anchor and image fill the sponsor panel height */
  #sponsorPanel .col-12, #sponsorPanel a { height: 100%; }
  #sponsorPanel a { display: block; }
  /* Use contain so the full sponsor image is visible without vertical cropping. */
  #sponsorPanel img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; border-radius: 6px; background: transparent; }

  /* Prevent main content from being covered by the fixed bottom panels */
  main.container-fluid { padding-bottom: 120px; padding-right: calc(var(--ads-panel-width) + 0.5rem); }

  /* Constrain results panel height to prevent overlay of sponsor panel */
  #resultsPanel {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    z-index: 1040;
    position: relative;
  }
  
  /* Ensure #filesAccordion matches parent height */
  #filesAccordion {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
  }
  
  /* Constrain map panel height to match results panel */
  #mapPanel {
    height: calc(100vh - 280px);
    max-height: calc(100vh - 280px);
    overflow-y: auto;
  }
}

/* Search button styling */
.btn-search {
  background-color: #11693D !important;
  color: #ffffff !important;
  border-color: #11693D !important;
}
.btn-search:hover, .btn-search:focus {
  background-color: #11693D !important;
  color: #ffffff !important;
  border-color: #11693D !important;
  box-shadow: none !important;
}

/* Split button dropdown menu styling */
#searchDropdownMenu {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}
#searchDropdownMenu .dropdown-item {
  color: #212529;
  padding: 0.5rem 1rem;
}
#searchDropdownMenu .dropdown-item:hover,
#searchDropdownMenu .dropdown-item:focus {
  background-color: #f8f9fa;
  color: #212529;
}
#searchDropdownMenu .dropdown-item.disabled {
  color: #999;
  pointer-events: none;
  cursor: not-allowed;
}

/* Onboarding modal form tweaks */
.onboarding-form .form-label { font-weight: 600; }
#onboardingModal .form-control[disabled] { background-color: #e9ecef; }
#onboardingModal .form-check { margin-right: 12px; }
#onboardingModal .bi-info-circle { cursor: help; color: #6c757d; }
#onboardingModal .modal-body { max-height: 60vh; overflow: auto; }