/* Custom Select Styles based on User Request */
/* Adapted to use project variables for colors */

:root {
  --select-bg: #ffffff;
  --select-border: #e2e8f0;
  --select-text: #334155;
  --select-hover: #1d4ed8; /* var(--primary-color) */
  --select-hover-text: #ffffff;
  --select-arrow: #334155;
}

.custom-select-container {
  width: 100%;
  position: relative;
  font-family: inherit;
  margin-top: 5px; /* Matches original input margin */
}

/* Hide the native select */
.custom-select-container select {
  display: none !important;
}

.custom-select-trigger {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--select-bg);
  border: 2px solid var(--select-border);
  border-radius: 10px; /* var(--radius) */
  color: var(--select-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.custom-select-trigger:hover {
  border-color: var(--select-hover);
}

.custom-select-arrow {
  height: 12px;
  width: 12px;
  fill: var(--select-arrow);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.custom-select-container.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background-color: var(--select-bg);
  border: 1px solid var(--select-border);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
}

.custom-select-container.open .custom-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  position: relative;
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--select-text);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.custom-option:hover {
  background-color: var(--select-hover);
  color: var(--select-hover-text);
}

.custom-option.selected {
  background-color: #eff6ff; /* light blue */
  color: var(--select-hover);
  font-weight: 600;
}

.custom-option.selected:hover {
  background-color: var(--select-hover);
  color: var(--select-hover-text);
}

/* Radio button hidden logic (preserved from request but implemented via JS & classes for robustness) */
.custom-option input[type="radio"] {
  display: none;
}

/* Dropup Variation */
.custom-select-container.dropup .custom-options {
  top: auto;
  bottom: calc(100% + 5px);
  transform: translateY(10px);
}

.custom-select-container.dropup.open .custom-options {
  transform: translateY(0);
}
