/**
 * ============================================
 * 241 RUNNERS AWARENESS - FORMS & VALIDATION CSS
 * ============================================
 * 
 * This stylesheet contains styles for forms, input validation, and data input functionality.
 * It complements the main styles.css file and provides specialized styling for interactive elements.
 * 
 * Features:
 * - Form validation styles and states
 * - Input field styling and focus states
 * - Error and success message styling
 * - Form layout and responsive design
 * - Search functionality styling
 * - Multi-step form progress indicators
 * 
 * Version: 20250128f - Forms & Validation
 * Last Updated: January 2025
 */

/* ============================================
 * FORM VALIDATION & INPUT STYLES
 * ============================================
 */

/* Form Container Styles */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  background-color: #f9fafb;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Form Header */
.form-header {
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

.form-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.form-header p {
  color: #6b7280;
  margin: 0;
}

/* Progress Bar for Multi-step Forms */
.progress-container {
  margin-bottom: 2rem;
  width: 100%;
  max-width: 600px;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background-color: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #dc2626;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Form Steps */
.form-step {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  display: none;
  width: 100%;
  max-width: 600px;
}

.form-step.active {
  display: block;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
  color: #374151;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #d1d5db;
}

/* Form Validation States */
.form-group input.valid,
.form-group select.valid,
.form-group textarea.valid {
  border-color: #10b981;
  background-color: #f0fdf4;
}

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.form-group input.required,
.form-group select.required,
.form-group textarea.required {
  border-left: 4px solid #dc2626;
}

/* Validation Messages */
.validation-message {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  display: none;
}

.validation-message.show {
  display: block;
}

.validation-message.error {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.validation-message.success {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.validation-message.warning {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fed7aa;
}

/* Required Field Indicator */
.required-field::after {
  content: " *";
  color: #dc2626;
  font-weight: bold;
}

/* ============================================
 * SEARCH FUNCTIONALITY STYLES
 * ============================================
 */

/* Search Container */
.search-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.search-btn {
  padding: 0.75rem 1.5rem;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.search-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.search-btn:active {
  transform: translateY(0);
}

/* Search Results */
.search-results {
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
}

.search-results h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  padding: 1rem 1rem 0.5rem 1rem;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 1rem 1rem 1rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.search-result-item:hover {
  border-color: #dc2626;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.search-result-item.selected {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  flex-shrink: 0;
  font-size: 1.25rem;
  color: #6b7280;
  font-weight: 600;
}

.search-result-info {
  flex: 1;
}

.search-result-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.search-result-details {
  font-size: 0.875rem;
  color: #6b7280;
}

.search-result-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.search-result-status.missing {
  background-color: #fef2f2;
  color: #dc2626;
}

.search-result-status.found {
  background-color: #f0fdf4;
  color: #16a34a;
}

.search-result-status.safe {
  background-color: #f0fdf4;
  color: #16a34a;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-style: italic;
}

/* ============================================
 * FORM LAYOUT & RESPONSIVE DESIGN
 * ============================================
 */

/* Form Rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row.full-width {
  grid-column: 1 / -1;
}

/* Form Navigation */
.form-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  width: 100%;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Button styles are now defined in styles.css to avoid duplication */

/* ============================================
 * MESSAGE & NOTIFICATION STYLES
 * ============================================
 */

/* Message Container */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  max-width: 400px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
  border-left: 4px solid transparent;
}

.message-success {
  background-color: #10b981;
  border-left-color: #059669;
}

.message-error {
  background-color: #ef4444;
  border-left-color: #dc2626;
}

.message-warning {
  background-color: #f59e0b;
  border-left-color: #d97706;
}

.message-info {
  background-color: #3b82f6;
  border-left-color: #2563eb;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Toast Messages */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #dc2626;
  min-width: 300px;
  animation: slideInRight 0.3s ease-out;
}

.toast.success {
  border-left-color: #10b981;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.info {
  border-left-color: #3b82f6;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
 * RESPONSIVE DESIGN
 * ============================================
 */

@media (max-width: 768px) {
  .form-container {
    padding: 1rem;
  }
  
  .form-step {
    padding: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .form-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .search-container {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
  }
  
  .message {
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .toast {
    min-width: auto;
    margin: 0 10px;
  }
}

@media (max-width: 480px) {
  .form-header h1 {
    font-size: 1.5rem;
  }
  
  .form-step {
    padding: 0.75rem;
  }
  
  .search-result-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .search-result-avatar {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

/* ============================================
 * ACCESSIBILITY & FOCUS MANAGEMENT
 * ============================================
 */

/* Focus Indicators */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
.btn:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .form-group input,
  .form-group select,
  .form-group textarea {
    border-width: 3px;
  }
  
  .btn {
    border-width: 3px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .form-group input,
  .form-group select,
  .form-group textarea,
  .btn,
  .search-result-item {
    transition: none;
  }
  
  .message,
  .toast {
    animation: none;
  }
} 