/* Forms & Input Styles */

/* Form container classes */
.form-container {
  background-color: rgb(var(--color-bg-secondary));
    /* border-default class - should be defined elsewhere */;
    border-radius: 0.5rem;
    /* p-xl class - should be defined elsewhere */;
    /* shadow-sm class - should be defined elsewhere */;
}

.form-container-elevated {
  background-color: rgb(var(--color-bg-primary));
    /* border-default class - should be defined elsewhere */;
    border-radius: 0.5rem;
    /* p-xl class - should be defined elsewhere */;
    /* shadow-md class - should be defined elsewhere */;
}

.form-container-card {
  background-color: rgb(var(--color-bg-primary));
    /* border-default class - should be defined elsewhere */;
    border-radius: 0.75rem;
    /* p-xl class - should be defined elsewhere */;
    /* shadow-lg class - should be defined elsewhere */;
  border-width: 2px;
}

  
.form-field {
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 0.5rem 1rem;
  width: 100%;
}

.form-field-text {
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 0.5rem 1rem;
  width: 100%;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-text-primary));
  margin-bottom: 0.5rem;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

  /* Form input styles */
  .form-input, .form-field {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-sm);
    flex-grow: 1;
    background-color: rgb(var(--color-bg-primary));
    color: rgb(var(--color-text-primary));
    border: 1px solid rgb(var(--color-border));
    border-color: rgb(var(--color-border));
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
  }

.form-input:focus, .form-field:focus, .form-field-text:focus {
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.1), var(--shadow-md);
  transform: translateY(-1px);
  outline: none;
}

.form-field-select, .form-input-select {
  flex-grow: 1;
  padding: 0.5rem 1rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.5rem;
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-field-date {
  padding: 0.5rem 1rem;
  border-width: 2px;
  border-radius: 0.5rem;
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 180px;
}


/* On medium screens and up, set a fixed width for date fields */
@media (min-width: 768px) {
  .form-field-date {
    width: 180px;
  }
}

.form-field-date:focus {
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.12), var(--shadow-md);
  outline: none;
  transform: translateY(-1px);
}

.form-field-date::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 1;
  cursor: pointer;
}

.form-field-date::placeholder {
  color: rgb(var(--color-text-secondary));
  opacity: 0.8;
}

.search-label {
  display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(var(--color-text-secondary));
    margin-bottom: 0.5rem;
}

.search-input {
  box-shadow: var(--shadow-sm);
  padding-left: 2.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  width: 100%;
  height: 2.5rem;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.1), 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transform: translateY(-1px);
  outline: none;
}

.search-input::placeholder {
  color: rgb(var(--color-text-secondary));
  opacity: 0.8;
}

.form-help-panel {
  margin-top: 0.75rem;
    padding: 1rem;
    background-color: rgb(var(--color-bg-secondary));
    border: 1px solid rgb(var(--color-border));
    border: 1px solid rgb(var(--color-border));
    border-radius: 0.5rem;
}

.form-help-text {
  font-size: 0.875rem;
    color: rgb(var(--color-text-secondary));
}

.form-button {
  padding-left: 0.75rem; padding-right: 0.75rem;
    padding-top: 0.5rem; padding-bottom: 0.5rem;
    color: rgb(var(--color-text-secondary));
    border: 1px solid rgb(var(--color-border));
    border-radius: 0.5rem;
    background-color: rgb(var(--color-bg-tertiary));
    color: rgb(var(--color-text-primary));
    box-shadow: 0 0 0 2px rgb(var(--color-border-focus));
    box-shadow: 0 0 0 2px rgb(var(--color-primary));
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;
  background-color: rgb(var(--color-bg-primary));
  border-color: rgb(var(--color-border));
}

.form-button-icon {
  color: rgb(var(--color-text-muted));
    color: rgb(var(--color-text-primary));
    background-color: rgb(var(--color-bg-tertiary));
    border-radius: 0.5rem;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;
    flex-shrink: 0;
}

/* Search control buttons - unified styling */
.search-control-button {
  height: 2.5rem;
    padding-left: 1rem; padding-right: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;
    transition-duration: 200ms;
    display: flex;
    align-items: center;
    justify-content: center;
  background-color: rgb(var(--color-bg-primary));
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-text-primary));
  min-width: 2.5rem;
}

.search-control-button:hover {
  background-color: rgb(var(--color-bg-tertiary));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-control-button:focus {
  box-shadow: 0 0 0 2px rgb(var(--color-border-focus));
    box-shadow: 0 0 0 2px rgb(var(--color-primary));
}

.search-control-button:active {
  transform: translateZ(0);
    transform: translateY(0);
}

/* Primary search button variant */
.search-control-button--primary {
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-text-inverse));
  border-color: rgb(var(--color-primary));
}

.search-control-button--primary:hover {
  background-color: rgb(var(--color-primary-700));
  border-color: rgb(var(--color-primary-700));
}

/* Danger button variant */
.search-control-button--danger {
  background-color: rgb(var(--color-error-bg));
  border-color: rgb(var(--color-error));
  color: rgb(var(--color-error));
}

.search-control-button--danger:hover {
  background-color: rgb(var(--color-error));
  color: rgb(var(--color-text-inverse));
}



.form-textarea {
  width: 100%;
    padding-left: 1rem; padding-right: 1rem;
    padding-top: 0.75rem; padding-bottom: 0.75rem;
    border: 2px solid rgb(var(--color-border));
    color: rgb(var(--color-text-primary));
    box-shadow: 0 0 0 2px rgb(var(--color-border-focus));
    box-shadow: 0 0 0 2px rgb(var(--color-primary));
    border-color: rgb(var(--color-border-focus));
  border-color: rgb(var(--color-border));
  background-color: rgb(var(--color-bg-primary));
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  transition: all 0.2s ease-in-out;
  resize: vertical;
  min-height: 100px;
}

.form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.1), 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transform: translateY(-1px);
}



/* Dropdown animation utilities */
.dropdown-enter {
  opacity: 0;
  transform: translateY(-10px);
}

.dropdown-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all var(--transition-normal);
}

.dropdown-exit {
  opacity: 1;
  transform: translateY(0);
}

.dropdown-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
}


.form-input-color {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
}

/* Datepicker Component Styles */
.datepicker-container {
  position: relative;
  max-width: 20rem; /* max-w-sm equivalent */
}

.datepicker-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 0.875rem; /* ps-3.5 equivalent */
  pointer-events: none;
  z-index: 10;
}

.datepicker-icon svg {
  width: 1rem; /* w-4 */
  height: 1rem; /* h-4 */
  color: rgb(var(--color-text-secondary));
  opacity: 0.7;
  transition: color 0.2s ease;
}

.datepicker-input {
  width: 100%;
  padding: 0.625rem 0.625rem 0.625rem 2.5rem; /* p-2.5 with left padding for icon */
  font-size: 0.875rem; /* text-sm */
  border-radius: 0.5rem; /* rounded-lg */
  border: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.datepicker-input:focus {
  outline: none;
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.1), var(--shadow-md);
  transform: translateY(-1px);
}

.datepicker-input::placeholder {
  color: rgb(var(--color-text-secondary));
  opacity: 0.8;
}

.datepicker-input:disabled {
  background-color: rgb(var(--color-bg-secondary));
  color: rgb(var(--color-text-secondary));
  opacity: 0.6;
  cursor: not-allowed;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .datepicker-icon svg {
    color: rgb(var(--color-text-secondary));
    opacity: 0.6;
  }
  
  .datepicker-input {
    background-color: rgb(var(--color-bg-secondary));
    border-color: rgb(var(--color-border));
  }
  
  .datepicker-input:focus {
    background-color: rgb(var(--color-bg-primary));
  }
}

/* Calendar picker indicator styling */
.datepicker-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  background: transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.datepicker-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Firefox date input styling */
.datepicker-input[type="date"] {
  color-scheme: light dark;
}

/* Focus state for the icon */
.datepicker-input:focus + .datepicker-icon svg,
.datepicker-input:focus ~ .datepicker-icon svg {
  color: rgb(var(--color-primary));
  opacity: 1;
}