/* Form Elements Styling */

/* Custom Select Box Styling - Override default appearance */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem !important;
}

/* Focus state for select */
select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity));
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
  border-color: rgb(168 85 247);
}

/* Hover state for select */
select:hover:not(:disabled) {
  border-color: rgb(209 213 219);
}

/* Disabled state for select */
select:disabled {
  background-color: rgb(249 250 251);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Common form element styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="search"],
input[type="time"],
input[type="week"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(209 213 219);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(17 24 39);
  background-color: white;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Focus states for all form elements */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="search"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
textarea:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity));
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
  border-color: rgb(168 85 247);
}

/* Hover states for all form elements */
input[type="text"]:hover:not(:disabled),
input[type="email"]:hover:not(:disabled),
input[type="password"]:hover:not(:disabled),
input[type="number"]:hover:not(:disabled),
input[type="tel"]:hover:not(:disabled),
input[type="url"]:hover:not(:disabled),
input[type="date"]:hover:not(:disabled),
input[type="datetime-local"]:hover:not(:disabled),
input[type="month"]:hover:not(:disabled),
input[type="search"]:hover:not(:disabled),
input[type="time"]:hover:not(:disabled),
input[type="week"]:hover:not(:disabled),
textarea:hover:not(:disabled),
select:hover:not(:disabled) {
  border-color: rgb(156 163 175);
}

/* Invalid states */
input:invalid,
textarea:invalid,
select:invalid {
  border-color: rgb(239 68 68);
}

input:invalid:focus,
textarea:invalid:focus,
select:invalid:focus {
  --tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity));
  border-color: rgb(239 68 68);
}

/* File input custom styling */
input[type="file"] {
  background-color: white;
  border: 1px solid rgb(209 213 219);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  padding: 0.25rem;
}

input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.25rem 0.75rem;
  background-color: rgb(249 250 251);
  border: 1px solid rgb(209 213 219);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(55 65 81);
  cursor: pointer;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

input[type="file"]::file-selector-button:hover {
  background-color: rgb(243 244 246);
}

/* Checkbox and Radio custom styling */
input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  color: rgb(124 58 237);
  border: 1px solid rgb(209 213 219);
  border-radius: 0.25rem;
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

input[type="radio"] {
  border-radius: 100%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: rgb(124 58 237);
  border-color: rgb(124 58 237);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity));
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

/* Label styling */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(55 65 81);
  margin-bottom: 0.25rem;
}

/* Form group spacing */
.form-group {
  margin-bottom: 1rem;
}

/* Helper text styling */
.form-help-text {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgb(107 114 128);
}

/* Error text styling */
.form-error-text {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgb(239 68 68);
}

/* Success text styling */
.form-success-text {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgb(34 197 94);
}