/**
 * Enhanced Forms Styles
 * Additional Tailwind-compatible styles for enhanced form functionality
 */

/* Status indicator classes */
.status-new, .status-open {
  @apply bg-blue-100 text-blue-800;
}

.status-pending {
  @apply bg-yellow-100 text-yellow-800;
}

.status-hold {
  @apply bg-orange-100 text-orange-800;
}

.status-solved {
  @apply bg-green-100 text-green-800;
}

.status-closed {
  @apply bg-gray-100 text-gray-800;
}

/* Status dot classes */
.status-dot-new, .status-dot-open {
  @apply bg-blue-400;
}

.status-dot-pending {
  @apply bg-yellow-400;
}

.status-dot-hold {
  @apply bg-orange-400;
}

.status-dot-solved {
  @apply bg-green-400;
}

.status-dot-closed {
  @apply bg-gray-400;
}

/* Priority classes */
.priority-low {
  @apply bg-gray-100 text-gray-800;
}

.priority-normal {
  @apply bg-blue-100 text-blue-800;
}

.priority-high {
  @apply bg-orange-100 text-orange-800;
}

.priority-urgent {
  @apply bg-red-100 text-red-800;
}

/* Line clamp utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Enhanced form animations */
.form-slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* File upload enhancements */
.file-drop-zone {
  transition: all 0.2s ease;
}

.file-drop-zone.drag-over {
  @apply border-teal-400 bg-teal-50 scale-105;
}

.file-upload-progress {
  @apply w-full bg-gray-200 rounded-full h-2;
}

.file-upload-progress-bar {
  @apply bg-teal-600 h-2 rounded-full transition-all duration-300;
}

/* CC field enhancements */
.cc-tag {
  @apply inline-flex items-center px-2 py-1 bg-teal-100 text-teal-800 text-sm rounded-full;
  animation: tagSlideIn 0.2s ease-out;
}

@keyframes tagSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cc-tag button {
  @apply ml-1 text-teal-600 hover:text-teal-800 transition-colors;
}

/* Enhanced table styles */
.requests-table tbody tr {
  @apply hover:bg-gray-50 transition-colors cursor-pointer;
}

.requests-table tbody tr:focus {
  @apply bg-blue-50 outline-none ring-2 ring-blue-500 ring-opacity-50;
}

/* Form validation styles */
.field-error {
  @apply text-sm text-red-600 mt-1;
  animation: errorSlideIn 0.2s ease-out;
}

@keyframes errorSlideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading states */
.loading-overlay {
  @apply absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center;
}

.loading-spinner {
  @apply animate-spin rounded-full h-8 w-8 border-b-2 border-teal-600;
}

/* Suggested articles styles */
.suggested-articles {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 300px;
  }
}

/* Mobile responsive enhancements */
@media (max-width: 768px) {
  .mobile-card {
    @apply p-4;
  }
  
  .mobile-card .card-header {
    @apply flex-col items-start space-y-2;
  }
  
  .mobile-card .card-actions {
    @apply w-full justify-between;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break-before {
    page-break-before: always;
  }
  
  .print-break-after {
    page-break-after: always;
  }
  
  /* Ensure colors are preserved in print */
  .bg-gray-50,
  .bg-blue-50,
  .bg-green-50,
  .bg-yellow-50,
  .bg-orange-50,
  .bg-red-50 {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }
}

/* Accessibility enhancements */
.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 improvements */
.focus-visible:focus {
  @apply outline-none ring-2 ring-teal-500 ring-opacity-50;
}

/* Enhanced dropdown styles */
.enhanced-select {
  @apply appearance-none bg-white border border-gray-300 rounded-lg px-3 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:border-transparent;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

/* Enhanced checkbox and radio styles */
.enhanced-checkbox,
.enhanced-radio {
  @apply appearance-none w-4 h-4 border border-gray-300 rounded focus:ring-2 focus:ring-teal-500 focus:ring-opacity-50;
}

.enhanced-checkbox:checked,
.enhanced-radio:checked {
  @apply bg-teal-600 border-teal-600;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

.enhanced-radio {
  @apply rounded-full;
}

.enhanced-radio:checked {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}

/* Tooltip styles */
.tooltip {
  @apply invisible absolute z-10 px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 transition-opacity duration-300;
}

.tooltip.show {
  @apply visible opacity-100;
}

/* Enhanced button states */
.btn-loading {
  @apply relative text-transparent transition-none cursor-not-allowed;
}

.btn-loading::after {
  content: '';
  @apply absolute inset-0 flex items-center justify-center;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3e%3ccircle cx='12' cy='12' r='10' stroke='currentColor' stroke-width='4' class='opacity-25'/%3e%3cpath fill='currentColor' d='M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z' class='opacity-75'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1rem 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Enhanced form field styles */
.form-field {
  @apply space-y-2;
}

.form-field label {
  @apply block text-sm font-medium text-gray-700;
}

.form-field input,
.form-field textarea,
.form-field select {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 focus:border-transparent transition-colors;
}

.form-field input:invalid,
.form-field textarea:invalid,
.form-field select:invalid {
  @apply border-red-300 focus:border-red-500 focus:ring-red-500;
}

.form-field .field-help {
  @apply text-xs text-gray-500 mt-1;
}

.form-field .field-error {
  @apply text-sm text-red-600 mt-1;
}

/* Enhanced card styles */
.enhanced-card {
  @apply bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden transition-all duration-200;
}

.enhanced-card:hover {
  @apply shadow-md border-gray-300;
}

.enhanced-card .card-header {
  @apply px-6 py-4 bg-gray-50 border-b border-gray-200;
}

.enhanced-card .card-body {
  @apply p-6;
}

.enhanced-card .card-footer {
  @apply px-6 py-4 bg-gray-50 border-t border-gray-200;
}

/* Responsive utilities */
@media (max-width: 640px) {
  .mobile-stack {
    @apply flex-col space-y-4;
  }
  
  .mobile-full {
    @apply w-full;
  }
  
  .mobile-hide {
    @apply hidden;
  }
  
  .mobile-show {
    @apply block;
  }
}

@media (min-width: 641px) {
  .desktop-hide {
    @apply hidden;
  }
  
  .desktop-show {
    @apply block;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .dark-mode .bg-white {
    @apply bg-gray-800;
  }
  
  .dark-mode .text-gray-900 {
    @apply text-gray-100;
  }
  
  .dark-mode .text-gray-600 {
    @apply text-gray-300;
  }
  
  .dark-mode .border-gray-200 {
    @apply border-gray-700;
  }
}
