/**
 * Change Within Reach - Employee Onboarding System
 * Custom styles to enhance the TailwindCSS framework
 */

/* Custom button animations */
.btn-primary {
  @apply bg-blue-600 hover:bg-blue-700 text-white font-semibold py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-secondary {
  @apply bg-gray-100 hover:bg-gray-200 text-gray-800 font-semibold py-2 px-4 rounded-md transition-colors duration-200;
}

.btn-success {
  @apply bg-green-600 hover:bg-green-700 text-white font-semibold py-2 px-4 rounded-md transition-colors duration-200;
}

/* Form styling enhancements */
.form-input {
  @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent;
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
  @apply block text-sm font-medium text-gray-700 mb-2;
}

/* Signature pad styling */
#signature-pad {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 2px solid #e5e7eb;
  border-radius: 8px;
}

#signature-pad canvas {
  border-radius: 6px;
}

#signature-pad:focus-within {
  border-color: #3b82f6;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Progress bar styling */
.progress-bar {
  transition: width 0.3s ease-in-out;
}

/* Modal animations */
.modal-overlay {
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(-20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Category card hover effects */
.category-card {
  @apply bg-white rounded-lg shadow-md p-6 transition-all duration-200;
}

.category-card:hover {
  @apply shadow-lg transform -translate-y-1;
}

.category-card.reviewed {
  @apply border-l-4 border-green-500;
}

.category-card.reviewed::after {
  content: '✓ Reviewed';
  @apply absolute top-2 right-2 text-xs text-green-600 bg-green-100 px-2 py-1 rounded-full;
}

/* File upload area styling */
.file-upload-area {
  transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.file-upload-area:hover {
  @apply border-gray-400 bg-gray-50;
}

.file-upload-area.dragover {
  @apply border-blue-400 bg-blue-50;
}

/* Loading spinner */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom checkbox styling */
.custom-checkbox {
  @apply h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded;
}

/* Success checkmark animation */
.success-checkmark {
  animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive design helpers */
@media (max-width: 640px) {
  .container {
    @apply px-4;
  }
  
  #signature-pad {
    width: 280px;
    height: 140px;
  }
  
  #signature-pad canvas {
    width: 280px;
    height: 140px;
  }
}

/* Print styles for forms */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  body {
    @apply text-black bg-white;
  }
  
  .form-page {
    page-break-after: always;
  }
  
  .form-page:last-child {
    page-break-after: auto;
  }
}

/* Accessibility improvements */
.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;
}

/* Focus indicators for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-input {
    border-width: 2px;
  }
  
  button {
    border: 2px solid currentColor;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if required */
}

/* Custom utility classes */
.glass-effect {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.9);
}

.shadow-custom {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Form validation styles */
.form-input.error {
  @apply border-red-500 focus:ring-red-500;
}

.form-input.success {
  @apply border-green-500 focus:ring-green-500;
}

.error-message {
  @apply text-red-600 text-xs mt-1;
}

.success-message {
  @apply text-green-600 text-xs mt-1;
}