/* ─── CSS Custom Properties (Brand Colors) ────────────────────────── */
:root {
  --lavender-dark: #3f324e;
  --lavender-500: #6A359C;
  --lavender-400: #804FB3;
  --lavender-300: #9969C7;
  --lavender-hover: #f0eefc;
  --lavender-white: #e6e6fa;
  --slider-gradient-end: #c69ceb;
  --gray-background: #f0f0f0;
  --border-color-light: #e0d8e8; /* Slightly adjusted for better visibility */
  --text-primary: var(--lavender-dark);
  --border-radius-standard: 12px; /* Increased for a softer look */
  --border-radius-pill: 999px;
}

/* ─── General Form & Field Styles ─────────────────────────────────── */
body .lms-match-form {
  display: flex;
  flex-direction: column;
  /* FIX: Reduced gap for tighter spacing */
  gap: 18px;
  max-width: 100%;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 12px;
  box-sizing: border-box;
}

.lms-field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lms-label {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Gender Toggle Buttons ───────────────────────────────────────── */
.lms-toggle-buttons {
  display: flex;
  gap: 12px;
}

.lms-toggle-btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: var(--border-radius-pill);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  border: 2px solid transparent;
  background-color: var(--lavender-white);
  color: var(--text-primary);
}

.lms-toggle-btn:not(.active):hover {
  background-color: var(--lavender-hover);
  transform: translateY(-2px);
}

.lms-toggle-btn.active {
  background-color: var(--text-primary);
  color: var(--lavender-white);
  border-color: var(--text-primary);
  transform: none;
}

/* ─── Age Section ─────────────────────────────────────────────────── */
.lms-age-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lms-age-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lms-sub-label {
  font-size: 14px;
  color: var(--text-primary);
}

.lms-age-input-wrapper input {
  width: 100%;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius-standard);
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
  box-sizing: border-box;
}

/* ─── noUiSlider Overrides ────────────────────────────────────────── */
#lms-age-slider {
  height: 8px;
  margin-top: 12px;
  border: none;
  box-shadow: none;
  margin-left: 12px;
  margin-right: 12px;
}

#lms-age-slider .noUi-target {
  background: var(--gray-background);
  border-radius: 4px;
  box-shadow: none;
}

#lms-age-slider .noUi-connect {
  background: linear-gradient(90deg, var(--lavender-dark) 0%, var(--slider-gradient-end) 100%);
}

#lms-age-slider .noUi-handle {
  width: 24px;
  height: 24px;
  right: -12px;
  top: -8px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--slider-gradient-end);
  box-shadow: none;
  cursor: grab;
}

#lms-age-slider .noUi-handle:active {
  cursor: grabbing;
}

#lms-age-slider .noUi-handle::before,
#lms-age-slider .noUi-handle::after {
  display: none;
}

/* ─── Select2 Overrides ───────────────────────────────────────────── */
.select2-container--default .select2-selection--single {
  background-color: #ffffff !important;
  border: 1px solid var(--border-color-light) !important;
  border-radius: var(--border-radius-standard) !important;
  height: 48px !important;
  padding: 0 12px !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: #e6e6fa !important;
    color: #3f324e !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary) !important;
  line-height: 46px !important;
  font-weight: bold;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-primary) !important;
  opacity: 0.6;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px !important;
  right: 12px !important;
  width: 20px !important;
}

/* FIX: Hide the default caret arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  display: none !important;
}

/* FIX: Create a new custom chevron arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid var(--text-primary);
  border-right: 2px solid var(--text-primary);
  transform: rotate(45deg);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -6px;
  margin-left: -6px;
  transition: transform 0.2s ease;
}

/* FIX: Rotate the chevron when the dropdown is open */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow::after {
  transform: rotate(-135deg);
  margin-top: -3px;
}

.select2-dropdown {
  background-color: #ffffff !important;
  border: 1px solid var(--border-color-light) !important;
  border-radius: var(--border-radius-standard) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  z-index: 99999 !important;
}

.select2-results__options {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.select2-search--dropdown .select2-search__field {
  background-color: #f8f9fa !important;
  border: 1px solid var(--border-color-light) !important;
  border-radius: 6px !important;
  color: var(--text-primary) !important;
  margin: 8px !important;
  padding: 8px !important;
  width: calc(100% - 16px) !important;
  outline-color: var(--lavender-300);
}

.select2-results__option {
  color: var(--text-primary) !important;
  padding: 10px 16px !important;
  font-weight: bold;
}

.select2-results__option--highlighted[aria-selected] {
  background-color: var(--lavender-white) !important;
  color: var(--lavender-dark) !important;
}

.select2-results__option[aria-selected="true"] {
  background-color: var(--lavender-white) !important;
  color: var(--lavender-dark) !important;
  font-weight: 600;
}

/* ─── Submit Button ──────────────────────────────────────────────── */
.lms-submit-btn {
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius-standard);
  transition: background-color 0.2s ease;
  background-color: var(--lavender-400);
  color: white;
}

.lms-submit-btn:hover {
  background-color: var(--lavender-500);
}
@media (max-width: 767px) {
  .lms-toggle-btn {
    flex: 1;
    padding: 6px 6px;
    font-size: 14px;
  }
}