/**
 * ===================================================================
 * BUS SEARCH FORM STYLES
 * Used by both [wbtm-bus-search-form] and [wbtm-bus-search]
 * ===================================================================
 */

/* --- Base Container --- */
.wbtm_style .wbtm_search_area {
  background: #263484ff;
}

.wbtm_style.wbtm_container.wbtm_form {
  --primary-color: white;
  --primary-dark: #2264AE;
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --input-radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --text-primary: white;
  --text-secondary: white;
  --bg-light: #f9fafb;

  padding: 0;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Form Layout --- */
#wbtm_area .mpForm {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 16px;
}

.wbtm_form.wbtm_bus_search #wbtm_area .mpForm .inputLine {
  display: flex;
  justify-content: center;
  align-items: end;
}

#wbtm_area .mpForm .inputLine {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
  #wbtm_area .mpForm .inputLine {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
  }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
  #wbtm_area .mpForm .inputLine {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Input Groups --- */
#wbtm_area .mpForm .inputGroup.point-input-group,
#wbtm_area .mpForm .inputGroup.locationGroup {
  flex-direction: row;
  align-items: center;
}

#wbtm_area .mpForm .inputGroup.date-passenger-group,
#wbtm_area .mpForm .inputGroup.datePassengerGroup {
  flex-direction: row;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  #wbtm_area .mpForm .inputGroup {
    flex-direction: column;
  }
  
  #wbtm_area .mpForm .inputGroup.point-input-group,
  #wbtm_area .mpForm .inputGroup.locationGroup {
    flex-direction: column;
  }
}

/* --- Input List (Individual Inputs) --- */
#wbtm_area .mpForm .inputList {
  flex: 1;
  margin: 0;
  min-width: 0;
  position: relative;
}

#wbtm_area .mpForm .inputList.wbtm_start_point,
#wbtm_area .mpForm .inputList.wbtm_dropping_point {
  flex: 1;
}

/* --- Label & Input Styling --- */
#wbtm_area .mpForm .fdColumn {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#wbtm_area .mpForm .fdColumn br {
  display: none;
}

#wbtm_area .mpForm .inputLabel {
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
  position: static;
}

#wbtm_area .mpForm .marker {
  position: relative;
  display: flex;
  align-items: center;
}

#wbtm_area .mpForm .marker > i,
#wbtm_area .mpForm .fas.fa-map-marker-alt {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 16px;
  z-index: 1;
}

#wbtm_area .mpForm .formControl {
  font-family: 'Inter', sans-serif;
  width: 100%;
  height: 52px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: unset;
  border-radius: 8px;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

#wbtm_area .mpForm .formControl:hover {
  border-color: #cbd5e1;
}

#wbtm_area .mpForm .formControl:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(19, 168, 158, 0.15);
}

#wbtm_area .mpForm .formControl::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

/* --- Route Swap Button --- */
#wbtm_area .point-line {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

#wbtm_area .point-line .line {
  width: 20px;
  height: 2px;
  background: var(--border-color);
  display: none;
}

@media (min-width: 768px) {
  #wbtm_area .point-line .line {
    display: block;
  }
}

#wbtm_area .point-swap {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 6px;
}

#wbtm_area .point-swap:hover {
  transform: rotate(180deg);
}

#wbtm_area .point-swap i {
  color: white;
  font-size: 14px;
  transition: color 0.2s ease;
  position: static;
  transform: none;
}


@media (max-width: 767px) {
  #wbtm_area .point-line {
    transform: rotate(90deg);
    margin: -8px 0;
  }
}

/* --- Trip Type Toggle --- */
#wbtm_area .trip-type-selector {
  margin-bottom: 0;
}

#wbtm_area .trip-type-buttons {
  display: flex;
  gap: 0;
  width: 100%;
}

#wbtm_area .trip-type-btn {
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  height: 52px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

#wbtm_area .trip-type-btn.left {
  border-radius: 8px 0 0 8px;
}

#wbtm_area .trip-type-btn.right {
  border-radius: 0 8px 8px 0;
}

#wbtm_area .trip-type-btn.active {
  background-color: rgba(255, 255, 255, 0.4);
}

#wbtm_area .trip-type-btn i {
  font-size: 12px;
  position: static;
  transform: none;
}

/* --- Date Inputs --- */
#wbtm_area .data-input-group {
  display: flex;
  gap: 12px;
  flex: 1;
}

#wbtm_area .wbtm_journey_date,
#wbtm_area .wbtm_return_date {
  flex: 1;
  min-width: 140px;
}

@media (max-width: 767px) {
  #wbtm_area .data-input-group {
    flex-direction: column;
    width: 100%;
  }
}

/* --- Passenger Picker --- */
#wbtm_area .passengerVisible {
  position: relative;
  min-width: 160px;
}

#wbtm_area .passengerHandle {
  font-family: 'Outfit', sans-serif;
  width: 100%;
  height: 52px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--input-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

#wbtm_area .passengerHandle:hover {
  border-color: #cbd5e1;
}

#wbtm_area .passengerHandle[aria-expanded="true"] {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(19, 168, 158, 0.15);
}

#wbtm_area .passengerHandle i {
  position: static;
  transform: none;
  color: var(--text-secondary);
  font-size: 12px;
  transition: transform 0.2s ease;
}

#wbtm_area .passengerHandle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

#wbtm_area .passengerDropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 100;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#wbtm_area .passengerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

#wbtm_area .passengerRow:last-of-type {
  border-bottom: none;
}

#wbtm_area .passengerRow__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#wbtm_area .passengerRow__label strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

#wbtm_area .passengerRow__label small {
  font-size: 12px;
  color: var(--text-secondary);
}

#wbtm_area .passengerInput {
  width: 50px;
  height: 40px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: 0;
  color: var(--text-primary);
  -moz-appearance: textfield;
  appearance: textfield;
}

#wbtm_area .passengerInput::-webkit-outer-spin-button,
#wbtm_area .passengerInput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#wbtm_area .passengerInput:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* --- Passenger Stepper Buttons (+/-) --- */
#wbtm_area .passengerStepper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#wbtm_area .stepperBtn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#wbtm_area .stepperBtn.stepperMinus {
  border-radius: 8px 0 0 8px;
  border-right: none;
}

#wbtm_area .stepperBtn.stepperPlus {
  border-radius: 0 8px 8px 0;
  border-left: none;
}

#wbtm_area .stepperBtn:hover {
  background: #e5e7eb;
}

#wbtm_area .stepperBtn:active {
  background: #d1d5db;
  transform: scale(0.95);
}

#wbtm_area .passengerActions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

#wbtm_area .btnClear,
#wbtm_area .btnApply {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#wbtm_area .btnClear {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

#wbtm_area .btnClear:hover {
  background: #e5e7eb;
}

#wbtm_area .btnApply {
  background: #FFFF61;
  border: none;
  color: #1f2937;
}

#wbtm_area .btnApply:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* --- Search Button --- */
#wbtm_area .wbtm_submit_holder {
  display: flex;
  align-items: flex-end;
}

#wbtm_area .wbtm_bus_submit,
#wbtm_area .get_wbtm_bus_list {
  height: 52px;
  padding: 0 32px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  background: rgb(255, 255, 97);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: 100%;
}

#wbtm_area .wbtm_bus_submit:hover,
#wbtm_area .get_wbtm_bus_list:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 97, 0.4);
}

#wbtm_area .wbtm_bus_submit:active,
#wbtm_area .get_wbtm_bus_list:active {
  transform: translateY(0);
}

@media (max-width: 767px) {
  #wbtm_area .wbtm_submit_holder {
    width: 100%;
  }
  
  #wbtm_area .wbtm_bus_submit,
  #wbtm_area .get_wbtm_bus_list {
    width: 100%;
  }
}

/* --- Route Dropdown List --- */
#wbtm_area .wbtm_start_point ul,
#wbtm_area .wbtm_dropping_point ul {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--input-radius);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 99;
  margin-top: 4px;
  padding: 8px 0;
}

#wbtm_area .wbtm_start_point ul li,
#wbtm_area .wbtm_dropping_point ul li {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.15s ease;
}

#wbtm_area .wbtm_start_point ul li:hover,
#wbtm_area .wbtm_dropping_point ul li:hover {
  background: var(--bg-light);
}

/* --- Responsive Adjustments --- */
@media (max-width: 480px) {
  #wbtm_area .mpForm .formControl {
    height: 48px;
    font-size: 13px;
  }
  
  #wbtm_area .passengerHandle {
    height: 48px;
    font-size: 13px;
  }
  
  #wbtm_area .wbtm_bus_submit,
  #wbtm_area .get_wbtm_bus_list {
    height: 48px;
    font-size: 14px;
  }
  
  #wbtm_area .trip-type-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
