/* Form Layout Styles */

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.form-grid-2col-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.form-label {
  white-space: nowrap;
  flex-shrink: 0;
}

.form-input {
  flex: 1;
}

/* Custom Select Styles */

.custom-select {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
}

.custom-select__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem;
  border-style: solid;
  border-width: 0.1rem;
  border-color: rgb(196, 216, 229);
  border-radius: 0.4rem;
  background-color: rgb(255, 255, 255);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.custom-select__button:hover {
  border-color: rgb(150, 180, 210);
  background-color: #fafafa;
}

.custom-select__button:focus {
  outline: none;
  border-color: rgb(100, 150, 200);
  box-shadow: 0 0 0 3px rgba(196, 216, 229, 0.3);
}

.custom-select__button::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 0.5rem solid transparent;
  border-right: 0.5rem solid transparent;
  border-top: 0.75rem solid currentColor;
  pointer-events: none;
  margin-left: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.custom-select--open .custom-select__button::after {
  transform: rotate(180deg);
}

.custom-select__menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  background-color: rgb(255, 255, 255);
  border-style: solid;
  border-width: 0.1rem;
  border-color: rgb(196, 216, 229);
  border-radius: 0.4rem;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.custom-select--open .custom-select__menu {
  max-height: 20rem;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
}

.custom-select__option {
  padding: 0.75rem 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-select__option:hover {
  background-color: rgb(240, 248, 255);
}

.custom-select__option--highlighted {
  background-color: rgb(230, 242, 250);
  color: #000;
}

.custom-select__option--selected {
  background-color: rgb(210, 235, 250);
  font-weight: 600;
  color: #000;
}

.custom-select__option--highlighted.custom-select__option--selected {
  background-color: rgb(196, 216, 229);
}

/* Scrollbar styling for webkit */
.custom-select__menu::-webkit-scrollbar {
  width: 8px;
}

.custom-select__menu::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.custom-select__menu::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.custom-select__menu::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Disabled state */
.custom-select__button:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.6;
  border-color: rgb(220, 225, 230);
}

/* Mobile optimization */
@media (max-width: 768px) {
  .custom-select__button {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.7rem;
  }

  .custom-select__option {
    padding: 0.7rem;
  }

  .custom-select__menu {
    max-height: 15rem;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .custom-select__button {
    background-color: #2d2d2d;
    border-color: rgb(80, 100, 120);
    color: #fff;
  }

  .custom-select__button:hover {
    background-color: #3d3d3d;
    border-color: rgb(100, 120, 150);
  }

  .custom-select__menu {
    background-color: #2d2d2d;
    border-color: rgb(80, 100, 120);
  }

  .custom-select__option {
    color: #fff;
  }

  .custom-select__option:hover {
    background-color: rgb(50, 70, 90);
  }

  .custom-select__option--highlighted {
    background-color: rgb(60, 90, 120);
  }

  .custom-select__option--selected {
    background-color: rgb(60, 90, 120);
  }
}

