/**
 * Validation Styles for Admin Pages
 * Common CSS for validation errors and messages
 */

/* Error state for input fields */
.validation-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.validation-error:focus {
  outline-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Error message container */
.validation-error-message {
  display: block;
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

/* Success state (optional) */
.validation-success {
  border-color: #10b981 !important;
  background-color: #f0fdf4 !important;
}

.validation-success:focus {
  outline-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Form group wrapper (recommended structure) */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #334155;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, background-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Required field indicator */
.form-group label.required::after {
  content: ' *';
  color: #ef4444;
}

/* Inline validation (show error next to field) */
.form-group-inline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.form-group-inline label {
  min-width: 120px;
  margin-bottom: 0;
  padding-top: 10px;
}

.form-group-inline .form-control-wrapper {
  flex: 1;
}

/* Compact error message (for inline forms) */
.validation-error-message.compact {
  font-size: 11px;
  margin-top: 2px;
}

/* Error icon (optional) */
.validation-error-message::before {
  content: '⚠ ';
  margin-right: 4px;
}

/* Success icon (optional) */
.validation-success-message {
  display: block;
  color: #10b981;
  font-size: 12px;
  margin-top: 4px;
}

.validation-success-message::before {
  content: '✓ ';
  margin-right: 4px;
}
