/* Theme Switcher Styles */

#accessibility-menu {
  position: relative;
  z-index: 100;
}

/* Remove default focus indicators in light/dark mode as requested */
body:not(.high-contrast) input:focus,
body:not(.high-contrast) select:focus,
body:not(.high-contrast) textarea:focus,
body:not(.high-contrast) button:focus {
  outline: none !important;
  box-shadow: none !important;
}

.acc-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #1e2133;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.acc-btn:hover {
  transform: scale(1.1);
}

.acc-panel {
  position: absolute;
  top: 50px;
  right: 0;
  width: 220px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 16px;
  display: none;
  border: 1px solid #eee;
}

.acc-panel.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.acc-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.acc-option:last-child {
  border-bottom: none;
}

/* Toggle Switch Base Styles - Robust Fix */
.acc-option button[role="switch"],
#dark-mode-btn,
#high-contrast-btn {
  all: unset !important;
  position: relative !important;
  width: 44px !important;
  height: 24px !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
  outline: none !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Base Light Mode Background */
#dark-mode-btn,
#high-contrast-btn {
  background-color: #ccd2db !important;
  /* Visible gray */
}

/* Active State Background (Toggled On) */
#dark-mode-btn.bg-blue-600,
#high-contrast-btn.bg-blue-600,
button[class*="bg-blue"] {
  background-color: #2563eb !important;
}

/* Toggle Knob */
.acc-option button span,
#dark-mode-toggle,
#contrast-toggle {
  all: unset !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 20px !important;
  height: 20px !important;
  background-color: #ffffff !important;
  /* Force White */
  border-radius: 50% !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform: translateX(0) !important;
  display: block !important;
  z-index: 2 !important;
}

/* Toggle On Positions (Max travel is width 44 - knob 20 - left 2 - right 2 = 20px) */
.acc-option button.bg-blue-600 span,
.acc-option button[class*="bg-blue"] span,
#dark-mode-btn.bg-blue-600 span,
#high-contrast-btn.bg-blue-600 span {
  transform: translateX(20px) !important;
}

/* Focus Ring */
.acc-option button:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb !important;
}

/* Dark Mode Overrides */
body.dark {
  background-color: #0f172a;
  color: #f1f5f9;
}

body.dark nav,
body.dark header,
body.dark footer,
body.dark .bg-white,
body.dark section[role="search"],
body.dark input,
body.dark select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

/* Custom Select Arrow for Dark Mode */
body.dark select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: right 0.5rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1.5em 1.5em !important;
  padding-right: 2.5rem !important;
  appearance: none !important;
}

body.dark select:hover {
  border-color: #475569 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23f1f5f9' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
}

body.dark input::placeholder {
  color: #94a3b8 !important;
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark .text-2xl.font-bold,
body.dark .font-bold.text-gray-900 {
  color: #f8fafc !important;
}

body.dark footer a:hover {
  color: #ffffff !important;
}

body.dark .text-gray-600,
body.dark .text-gray-700,
body.dark .text-gray-800 {
  color: #cbd5e1 !important;
}

body.dark .text-gray-400,
body.dark .text-gray-500 {
  color: #94a3b8 !important;
}

/* Blue to Yellow Overrides for Dark Mode Branding */
body.dark .bg-blue-600,
body.dark .bg-blue-700,
body.dark .bg-blue-800 {
  background-color: #facc15 !important;
  color: #1e293b !important;
  /* Contrasting text for yellow bg */
}

body.dark .text-blue-600,
body.dark .text-blue-700,
body.dark .text-blue-800,
body.dark .text-brand-yellow {
  color: #facc15 !important;
}

body.dark .border-blue-100,
body.dark .border-blue-200,
body.dark .border-blue-600 {
  border-color: #facc15 !important;
}

body.dark .bg-blue-50 {
  background-color: rgba(250, 204, 21, 0.1) !important;
  color: #facc15 !important;
  border-color: rgba(250, 204, 21, 0.2) !important;
}

body.dark .group-hover\:text-blue-600:group-hover,
body.dark .hover\:text-blue-600:hover,
body.dark .hover\:text-blue-700:hover,
body.dark .hover\:border-blue-400:hover {
  color: #facc15 !important;
  border-color: #facc15 !important;
}


body.dark .view-all-btn,
body.dark .search-btn {
  border-color: #cbd5e1 !important;
  color: #f1f5f9 !important;
}

body.dark .view-all-btn:hover,
body.dark .search-btn:hover {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
}


/* Company Detail Branding - Dark Mode Fixes */
body.dark .bg-blue-700 {
  background-color: #facc15 !important;
  /* Brand Yellow background */
  color: #ffffff !important;
  /* White text */
}

body.dark .text-blue-800 {
  color: #facc15 !important;
  /* Brand Yellow (Yellow-400) */
}


body.dark #share-menu {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

body.dark #share-menu p {
  color: #94a3b8 !important;
}

body.dark #share-menu .bg-gray-200 {
  background-color: #475569 !important;
}

/* Share Menu Dark Mode Specifics */
body.dark #share-native-btn,
body.dark #share-copy-btn {
  background-color: #334155 !important;
  border-color: #475569 !important;
}

body.dark #share-native-btn *,
body.dark #share-copy-btn * {
  color: #f1f5f9 !important;
}

body.dark #share-native-btn:hover,
body.dark #share-copy-btn:hover {
  background-color: #475569 !important;
}


body.dark .acc-panel {
  background: #1e293b;
  color: white;
  border-color: #334155;
}

body.dark .acc-option {
  border-color: #334155;
}

/* High Contrast Overrides */
body.high-contrast {
  background-color: #ffffff !important;
}

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast p,
body.high-contrast span,
body.high-contrast i,
body.high-contrast label,
body.high-contrast footer,
body.high-contrast .text-gray-700,
body.high-contrast .text-gray-800,
body.high-contrast .text-gray-900,
body.high-contrast .text-white {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.high-contrast nav,
body.high-contrast header,
body.high-contrast section,
body.high-contrast footer,
body.high-contrast article,
body.high-contrast .bg-gray-50 {
  background-color: #ffffff !important;
  border-color: #000000 !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Specific borders for the banner and cards */
body.high-contrast .bg-brand-dark {
  background-color: #ffffff !important;
  border: none !important;
  border-top: 4px solid #000000 !important;
  /* Only top border for banner */
  background-image: none !important;
  box-shadow: none !important;
}

body.high-contrast .bg-brand-card {
  background-color: #ffffff !important;
  border: 4px solid #000000 !important;
  /* Full border for cards */
  background-image: none !important;
  box-shadow: none !important;
}




body.high-contrast button,
body.high-contrast a:not(.block):not(.flex) {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 4px solid #000000 !important;
  padding: 8px 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}

body.high-contrast a.block,
body.high-contrast a.flex {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 4px solid #000000 !important;
  display: block !important;
  text-decoration: none !important;
  box-shadow: none !important;
  padding: 16px !important;
}

body.high-contrast a.block:hover,
body.high-contrast a.flex:hover {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
  transform: translateY(-6px) !important;
}



body.high-contrast a.block:hover *,
body.high-contrast a.flex:hover * {
  color: #ffffff !important;
  border-color: #ffffff !important;
}




body.high-contrast input {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 4px solid #000000 !important;
  padding: 10px 15px !important;
  font-weight: 700 !important;
  display: block !important;
  width: 100% !important;
}

/* Maintain borderless look only inside the search container */
body.high-contrast section[role="search"] input {
  border: none !important;
}


body.high-contrast section[role="search"] {
  border: 4px solid #000000 !important;
  background-color: #ffffff !important;
}


@media (min-width: 768px) {
  body.high-contrast #hamburger-btn {
    display: none !important;
  }
}


/* Moving high-contrast select rules to bottom for maximum priority */


body.high-contrast input::placeholder {
  color: #000000 !important;
  opacity: 1 !important;
}

body.high-contrast .text-gray-400,
body.high-contrast .text-gray-500,
body.high-contrast .text-gray-600 {
  color: #000000 !important;
}

body.high-contrast button:hover,
body.high-contrast a:hover {
  background-color: #000000 !important;
  color: #ffffff !important;
}

body.high-contrast button:hover *,
body.high-contrast a:hover * {
  color: #ffffff !important;
  border-color: #ffffff !important;
  background-color: transparent !important;
}

body.high-contrast #accessibility-menu .acc-btn {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
  box-shadow: none !important;
}

body.high-contrast #accessibility-menu .acc-btn:hover {
  background-color: #000000 !important;
  color: #000000 !important;
  border-color: #fff !important;
}


body.high-contrast .view-all-btn,
body.high-contrast .search-btn {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 4px solid #000000 !important;
  font-weight: 900 !important;
}

body.high-contrast #share-menu {
  background-color: #ffffff !important;
  border: 4px solid #000000 !important;
}

body.high-contrast #share-menu button {
  color: #000000 !important;
  background-color: #ffffff !important;
  border: 2px solid #000000 !important;
  font-weight: 700 !important;
}

body.high-contrast #share-menu button:hover {
  background-color: #000000 !important;
  color: #ffffff !important;
}


/* --- HIGH CONTRAST SELECT FIX (NATIVE ARROW FALLBACK) --- */
body.high-contrast select {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;

  background-color: #ffffff !important;
  color: #000000 !important;
  border: 4px solid #000000 !important;
  border-radius: 4px !important;

  padding: 8px 16px !important;
  font-weight: 900 !important;
  height: 52px !important;
  cursor: pointer !important;
}

/* Job Grid Layout Fix */
body.high-contrast #job-grid {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

@media (min-width: 768px) {
  body.high-contrast #job-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  body.high-contrast #job-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}


/* Card Specific Fixes */
body.high-contrast #job-grid a.block h3,
body.high-contrast #job-grid a.block p,
body.high-contrast #job-grid a.block div {
  white-space: normal !important;
  overflow: visible !important;
  line-height: 1.4 !important;
}

body.high-contrast #job-grid a.block .w-12.h-12 {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #000000 !important;
}

/* Global Card Hover Animation for High Contrast */
body.high-contrast #job-grid a.block,
body.high-contrast #job-list article {
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

body.high-contrast #job-grid a.block:hover,
body.high-contrast #job-list article:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
}