.helpChooseDialogDiv {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.helpChooseDialogDiv select,
.helpChooseDialogDiv p {
  font-size: calc(var(--min-font-size) + 6px);
  font-weight: bold;
  color: var(--primary_txt_color);
}

.helpChooseAccessoryDiv {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100px;
  width: -webkit-fill-available;
  margin-bottom: 1em;
  align-items: center;
}

.helpChooseAccessoryDiv img {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Gentle float animation (respects reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .helpChooseAccessoryDiv img {
    animation: gentle-float 4s ease-in-out infinite;
  }
}

@keyframes gentle-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.02);
  }
}

.newSliderMenu {
  display: flex;
  margin-bottom: 1em;
}

.newSliders {
  display: flex;
}

.newSliderItem {
  height: 200px;
}

.sliderOpt {
  display: flex;
  flex-direction: column;
  margin-right: 1em;
}

.newSliderDesc {
  display: flex;
  flex-direction: column;
  margin-top: 2em;
}

.newSliderDesc article {
  color: var(--primary_txt_color);
  font-size: calc(var(--min-font-size) + 3px);
}

.newSliderDesc strong[id$="SliderP"] {
  margin-bottom: 1em;
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary_txt_color);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 0.4em 0.8em;
  background: linear-gradient(135deg, #fdbef5 0%, #ffffff 100%);
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-width: 100px;
  text-align: center;
}

@media (max-width: 768px) {
  .newSliderDesc strong[id$="SliderP"] {
    font-size: 1.3em;
    padding: 0.35em 0.7em;
  }
}

.sliderOpt strong {
  margin-bottom: 1em;
  color: var(--secondary_darker_txt_color);
}

.newSliderDesc span[id^="species_"] {
  background-image: linear-gradient(to right, #fdbef5, #ffffff);
  cursor: pointer;
}

.newSliderDesc span,
.sliderBolder {
  font-weight: bold;
  color: var(--primary_darker_txt_color);
}

.newSliderDesc a {
  font-size: calc(var(--min-font-size) + 2px);
  color: var(--secondary_darker_txt_color);
  text-decoration: none;
}

.newSliderDesc a:hover {
  background-image: linear-gradient(to right, #fdbef5, #ffffff);
}

.newSliderDescGrid {
  margin-bottom: 1em;
}

/* ========================================
   Responsive Mobile Adjustments
   ======================================== */

/* Tablet and smaller screens */
@media (max-width: 768px) {
  .newSliderMenu {
    flex-direction: column;
    align-items: center;
  }

  .newSliders {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    gap: 0.5em;
  }

  .sliderOpt {
    margin-right: 0;
    margin-bottom: 0;
  }

  /* Enlarge slider tracks to accommodate 44px handles */
  .newSliderItem {
    height: 180px; /* Taller for better control */
    width: 80px !important; /* Wider for 44px handles */
  }

  /* CRITICAL: Enlarge slider handles to 44px minimum for touch (Apple/Google HCI) */
  .newSliderItem .ui-slider-handle {
    width: 44px !important;
    height: 44px !important;
    left: 50% !important; /* Center horizontally on vertical track */
    margin-left: -22px !important; /* Offset by half width */
    margin-bottom: -22px !important; /* Offset by half height for vertical positioning */
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #f0f0f0);
    border: 2px solid var(--primary_txt_color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: grab;
  }

  .newSliderItem .ui-slider-handle:active {
    cursor: grabbing !important;
  }

  /* Ensure buttons meet 44px minimum */
  .helpChooseDialogDiv button {
    min-height: 44px;
    padding: 0.5em 1.5em;
  }

  .newSliderDesc {
    width: 100%;
    margin-top: 1em;
  }

  .helpChooseAccessoryDiv {
    height: 80px;
    width: 100%;
  }

  .helpChooseAccessoryDiv img {
    height: 80px;
  }

  /* Font sizes - prevent iOS auto-zoom (16px minimum) */
  .newSliderDesc article,
  .helpChooseDialogDiv p,
  .helpChooseDialogDiv select {
    font-size: 16px;
    line-height: 1.5;
  }

  .newSliderDesc strong[id$="SliderP"] {
    font-size: 18px; /* Legible value display */
  }
}

/* ========================================
   Ultra-Small Phones (iPhone SE, small Android)
   ======================================== */

@media (max-width: 374px) {
  .newSliders {
    gap: 0.3em;
    justify-content: space-evenly;
  }

  .newSliderItem {
    height: 110px;
    width: 70px;
  }

  .newSliderItem .ui-slider-handle {
    width: 42px !important;
    height: 42px !important;
    left: 50% !important;
    margin-left: -21px !important;
    margin-bottom: -21px !important;
  }

  .sliderOpt strong {
    font-size: 1.1em;
  }

  .newSliderDesc article {
    font-size: 16px; /* Maintain minimum */
    line-height: 1.3;
  }

  .newSliderDesc strong[id$="SliderP"] {
    font-size: 1.2em;
    padding: 0.3em 0.6em;
    min-width: 80px;
  }

  .helpChooseAccessoryDiv {
    height: 50px;
  }

  .helpChooseAccessoryDiv img {
    height: 50px;
  }
}

/* ========================================
   Small to Medium Phones (iPhone 11/12/13, Pro Max)
   ======================================== */

@media (min-width: 375px) and (max-width: 428px) {
  .newSliderItem {
    height: 140px;
    width: 70px;
  }

  .newSliderItem .ui-slider-handle {
    width: 46px !important;
    height: 46px !important;
    left: 50% !important;
    margin-left: -23px !important;
    margin-bottom: -23px !important;
  }

  .sliderOpt strong {
    font-size: 1.3em;
  }

  .newSliderDesc strong[id$="SliderP"] {
    font-size: 1.4em;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .newSliderItem {
    height: 120px;
    width: 85px !important; /* Wider for 48px handles */
  }

  /* Even larger handles for small phones */
  .newSliderItem .ui-slider-handle {
    width: 48px !important;
    height: 48px !important;
    left: 50% !important;
    margin-left: -24px !important;
    margin-bottom: -24px !important;
  }

  .sliderOpt strong {
    font-size: 20px; /* Larger letter labels (C, A, S, E) */
  }

  .newSliderDesc article {
    font-size: 16px; /* NOT 0.9em - maintain minimum to prevent iOS auto-zoom */
    line-height: 1.3;
  }

  .newSliderDesc strong[id$="SliderP"] {
    font-size: 18px; /* Legible value display */
  }

  .helpChooseAccessoryDiv {
    height: 60px;
  }

  .helpChooseAccessoryDiv img {
    height: 60px;
  }
}

/* ========================================
   Landscape Orientation (Short Viewports)
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
  .helpChooseDialogDiv {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .newSliderItem {
    height: 100px;
  }

  .newSliderDesc {
    margin-top: 0.5em;
  }

  .helpChooseAccessoryDiv {
    height: 60px;
    margin-bottom: 0.5em;
  }

  .helpChooseAccessoryDiv img {
    height: 60px;
  }
}

/* ========================================
   Accessibility - Enhanced Focus Styles
   ======================================== */

/* Slider focus with glow */
.newSliderItem:focus-visible,
.newSliderItem .ui-slider-handle:focus-visible {
  outline: 3px solid #4CAF50;
  outline-offset: 4px;
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

/* Species name focus with glow */
.newSliderDesc span[id^="species_"]:focus-visible {
  outline: 3px solid #9C27B0;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(156, 39, 176, 0.2);
}

/* Button focus with glow */
.helpChooseDialogDiv button:focus-visible {
  outline: 3px solid #2196F3;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.2);
}

/* Focus container glow */
.newSliderItem:focus-within::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 8px;
  background: rgba(76, 175, 80, 0.08);
  pointer-events: none;
}

/* ========================================
   Touch Feedback
   ======================================== */

/* Slider handle touch feedback */
.newSliderItem .ui-slider-handle:active {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #ed89ed, #99f599);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Hover effects (desktop only) */
@media (hover: hover) {
  .newSliderItem .ui-slider-handle:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  }
}

/* Button press feedback */
.helpChooseDialogDiv button:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* Species name tap feedback */
.newSliderDesc span[id^="species_"]:active {
  transform: scale(0.98);
  background-image: linear-gradient(to right, #ed89ed, #fdbef5);
}

/* Result link tap feedback */
.newSliderDesc a:active {
  opacity: 0.8;
  transform: translateX(2px);
}

/* Custom tap highlight color */
.newSliderItem,
.helpChooseDialogDiv button,
.newSliderDesc span[id^="species_"],
.newSliderDesc a {
  -webkit-tap-highlight-color: rgba(76, 175, 80, 0.2);
}

/* ========================================
   Smooth Transitions
   ======================================== */

.newSliderItem .ui-slider-handle {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.helpChooseDialogDiv button {
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.2s ease;
}

.newSliderDesc span[id^="species_"] {
  transition: transform 0.15s ease, background-image 0.2s ease;
}

.newSliderDesc a {
  transition: opacity 0.15s ease, transform 0.1s ease, background-image 0.2s ease;
}

strong[id$="SliderP"] {
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.helpChooseAccessoryDiv img {
  transition: filter 0.3s ease;
}

/* ========================================
   Enhanced Loading Spinner
   ======================================== */

#caseLoadingSpinner {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-in-out;
}

#caseLoadingSpinner p {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--primary_txt_color);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  animation: pulse 1.8s ease-in-out infinite;
}

#caseLoadingSpinner img {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

@keyframes fadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* ========================================
   Reduced Motion Support
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  /* Disable all transitions */
  .newSliderItem,
  .newSliderItem .ui-slider-handle,
  .helpChooseDialogDiv button,
  .newSliderDesc span,
  .newSliderDesc a,
  strong[id$="SliderP"] {
    transition: none !important;
  }

  /* Disable all animations */
  #caseLoadingSpinner,
  #caseLoadingSpinner p,
  .helpChooseAccessoryDiv img {
    animation: none !important;
  }

  /* Disable transforms except for necessary focus indicators */
  .newSliderItem .ui-slider-handle:active,
  .helpChooseDialogDiv button:active {
    transform: none !important;
  }
}

/* ========================================
   Color Contrast Enhancements
   ======================================== */

/* Ensure link contrast meets WCAG AA (4.5:1 minimum) */
.newSliderDesc a {
  color: #024702; /* Darker green for better contrast than default #035803 */
}

/* Enhance slider track contrast */
.newSliderItem .ui-slider-range {
  background: linear-gradient(to top, #4CAF50, #81C784);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Ensure value display text is visible on gradient */
.newSliderDesc strong[id$="SliderP"] {
  color: #000; /* High contrast on light gradient background */
}

/* ========================================
   High Contrast Mode
   ======================================== */

@media (prefers-contrast: high) {
  /* Stronger borders for visibility */
  .newSliderItem {
    border: 3px solid var(--primary_txt_color);
  }

  .newSliderItem .ui-slider-handle {
    border: 4px solid #000;
    background: #fff;
  }

  /* Enhance text contrast */
  strong[id$="SliderP"] {
    border: 2px solid currentColor;
    background: #fff;
    color: #000;
  }

  .newSliderDesc span[id^="species_"] {
    background: #fff;
    color: #000;
    border: 2px solid #000;
  }

  /* Remove gradient backgrounds */
  .newSliderDesc a:hover,
  .newSliderDesc span[id^="species_"] {
    background-image: none;
  }
}

/* ========================================
   CASE Slider Results Cards
   ======================================== */

.case-results-controls {
  margin: 1.5em 0;
  padding: 1em;
  background: #f5f5f5;
  border-radius: 8px;
}

.case-controls-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: center;
}

.case-controls-wrapper label {
  font-weight: 600;
  color: var(--primary_txt_color);
  margin-right: 0.5em;
}

.case-control-select {
  padding: 0.5em 1em;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: calc(var(--min-font-size) + 2px);
  background: white;
  cursor: pointer;
  min-width: 150px;
  transition: border-color 0.2s ease;
}

.case-control-select:hover {
  border-color: #999;
}

.case-control-select:focus {
  outline: 3px solid #2196F3;
  outline-offset: 2px;
  border-color: #2196F3;
}

.case-control-reset {
  padding: 0.5em 1.5em;
  background: var(--primary_darker_txt_color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  min-height: 44px;
}

.case-control-reset:hover {
  background: var(--secondary_darker_txt_color);
  transform: scale(1.02);
}

.case-control-reset:active {
  transform: scale(0.98);
}

.case-control-reset:focus {
  outline: 3px solid #2196F3;
  outline-offset: 2px;
}

.case-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1em;
  margin-bottom: 2em;
}

.case-result-card {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.75em;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.case-result-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.case-result-card:active {
  transform: scale(0.98);
}

.case-result-card:focus {
  outline: 3px solid #4CAF50;
  outline-offset: 4px;
}

.case-result-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.case-result-details {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

.case-result-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-result-heart {
  margin-left: 0.5em;
  color: #4CAF50;
  font-size: 1.1em;
}

.case-result-meta {
  font-size: 0.9em;
  color: #666;
  display: flex;
  gap: 0.5em;
  align-items: center;
}

.case-result-price {
  color: #2e7d32;
  font-weight: 600;
}

.case-result-type {
  color: #666;
}

.case-result-heart-btn {
  width: 44px;
  height: 44px;
  border: 2px solid #ddd;
  border-radius: 50%;
  background: white;
  color: #999;
  font-size: 1.5em;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-result-heart-btn:hover {
  border-color: #FF5722;
  color: #FF5722;
  transform: scale(1.1);
}

.case-result-heart-btn:active {
  transform: scale(0.95);
}

.case-result-heart-btn:focus {
  outline: 3px solid #2196F3;
  outline-offset: 2px;
}

.case-result-heart-btn.active {
  border-color: #4CAF50;
  color: #4CAF50;
  background: #e8f5e9;
}

.case-result-arrow {
  font-size: 1.5em;
  color: #FF9800;
  flex-shrink: 0;
}

.case-species-header {
  display: block;
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary_darker_txt_color);
  margin: 1.5em 0 0.75em 0;
  padding: 0.5em 0.75em;
  background: linear-gradient(135deg, #fdbef5, #ffffff);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.case-species-header:hover {
  background: linear-gradient(135deg, #fc9eeb, #f5f5f5);
}

.case-species-header:focus {
  outline: 3px solid #9C27B0;
  outline-offset: 2px;
}

.case-results-view-all {
  display: block;
  margin: 2em 0 1em 0;
  padding: 1em;
  text-align: center;
  font-size: 1.1em;
  font-weight: 600;
  color: white;
  background: var(--primary_darker_txt_color);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.case-results-view-all:hover {
  background: var(--secondary_darker_txt_color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.case-results-view-all:active {
  transform: translateY(0);
}

.case-results-view-all:focus {
  outline: 3px solid #2196F3;
  outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .case-results-grid {
    grid-template-columns: 1fr;
  }

  .case-controls-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .case-control-select {
    width: 100%;
  }

  .case-control-reset {
    width: 100%;
  }

  .case-result-card {
    padding: 0.6em;
  }

  .case-result-thumbnail {
    width: 50px;
    height: 50px;
  }

  .case-result-name {
    font-size: 0.9em;
  }

  .case-result-meta {
    font-size: 0.8em;
  }

  .case-result-heart-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3em;
  }
}

@media (max-width: 480px) {
  .case-results-controls {
    padding: 0.75em;
  }

  .case-species-header {
    font-size: 1.1em;
    padding: 0.4em 0.6em;
  }

  .case-results-view-all {
    font-size: 1em;
    padding: 0.8em;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .case-result-card,
  .case-result-heart-btn,
  .case-control-reset,
  .case-control-select,
  .case-species-header,
  .case-results-view-all {
    transition: none;
  }

  .case-result-card:hover,
  .case-result-heart-btn:hover,
  .case-control-reset:hover,
  .case-results-view-all:hover {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .case-result-card {
    border: 2px solid #000;
  }

  .case-result-heart-btn {
    border: 3px solid #000;
  }

  .case-control-select,
  .case-control-reset {
    border: 2px solid #000;
  }

  .case-species-header {
    background: white;
    border: 2px solid #000;
  }
}
