/**
 * AniWorld - Form Styles
 *
 * Form inputs, labels, validation states,
 * and form group layouts.
 */

/* Input fields */
.input-field {
  width: 120px;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-background);
  color: var(--color-text-primary);
  font-size: var(--font-size-body);
  transition: border-color var(--animation-duration-fast) var(--animation-easing-standard);
}

.input-field:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Input groups */
.input-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.input-group .input-field {
  flex: 1;
  width: auto;
}

.input-group .btn {
  flex-shrink: 0;
}

/* Search input */
.search-input {
  flex: 1;
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-body);
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  transition: all var(--transition-duration) var(--transition-easing);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.search-input-group {
  display: flex;
  gap: var(--spacing-sm);
  max-width: 600px;
}

/* Checkbox custom styling */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-background);
  position: relative;
  transition: all var(--animation-duration-fast) var(--animation-easing-standard);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label:hover .checkbox-custom {
  border-color: var(--color-accent);
}

/* Form groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.9rem;
}

/* Config item styling */
.config-item {
  margin-bottom: var(--spacing-lg);
}

.config-item:last-child {
  margin-bottom: 0;
}

.config-item label {
  display: block;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.config-value {
  padding: var(--spacing-sm);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-family: monospace;
  font-size: var(--font-size-caption);
  color: var(--color-text-secondary);
  word-break: break-all;
}

.config-value input[readonly] {
  background-color: var(--color-bg-secondary);
  cursor: not-allowed;
}

[data-theme="dark"] .config-value input[readonly] {
  background-color: var(--color-bg-secondary-dark);
}

/* Config description */
.config-description {
  font-size: 0.9em;
  color: var(--muted-text);
  margin: 4px 0 8px 0;
  line-height: 1.4;
}

/* Config actions */
.config-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  flex-wrap: wrap;
}

.config-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* Validation styles */
.validation-results {
  margin: 12px 0;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
}

.validation-results.hidden {
  display: none;
}

.validation-error {
  color: var(--color-error);
  margin: 4px 0;
  font-size: 0.9em;
}

.validation-warning {
  color: var(--color-warning);
  margin: 4px 0;
  font-size: 0.9em;
}

.validation-success {
  color: var(--color-success);
  margin: 4px 0;
  font-size: 0.9em;
}

/* Responsive form adjustments */
@media (max-width: 768px) {
  .config-actions {
    flex-direction: column;
  }

  .config-actions .btn {
    flex: none;
    width: 100%;
  }
}
