/**
 * ENHANCED FILE VALIDATION MODAL STYLES
 * Provides styling for the file validation modal system
 * Designed to work with Tailwind CSS but provides fallbacks
 */

/* Modal overlay and container */
#fileValidationModal {
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease-in-out;
}

/* Ensure overlay is visible when modal is shown */
#fileValidationModal:not(.hidden) {
  display: block !important;
  background-color: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

#fileValidationModal.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Ensure inner container properly centers modal */
#fileValidationModal > div {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Modal content styling */
#fileValidationModal .bg-white {
  animation: modalSlideIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Enhanced styling for validation results */
.validation-success-icon {
  color: #10b981;
}

.validation-error-icon {
  color: #ef4444;
}

.validation-warning-icon {
  color: #f59e0b;
}

/* File list styling in validation modal */
.file-validation-list {
  max-height: 200px;
  overflow-y: auto;
}

.file-validation-item {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 4px solid transparent;
}

.file-validation-item.valid {
  background-color: #f0fdf4;
  border-left-color: #10b981;
}

.file-validation-item.invalid {
  background-color: #fef2f2;
  border-left-color: #ef4444;
}

.file-validation-item.warning {
  background-color: #fffbeb;
  border-left-color: #f59e0b;
}

/* Button styling enhancements */
#validationModalProceed:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#validationModalProceed:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Progress indicator for file uploads */
.file-upload-progress {
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.file-upload-progress-bar {
  height: 100%;
  background-color: #3b82f6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Custom scrollbar for modal content */
#fileValidationModal ::-webkit-scrollbar {
  width: 6px;
}

#fileValidationModal ::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#fileValidationModal ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#fileValidationModal ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive design adjustments */
@media (max-width: 640px) {
  #fileValidationModal .max-w-md {
    max-width: 90vw;
    margin: 20px;
  }
  
  #fileValidationModal .p-6 {
    padding: 1rem;
  }
}

/* Enhanced alert styling */
.validation-alert {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0;
}

.validation-alert.success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.validation-alert.error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.validation-alert.warning {
  background-color: #fffbeb;
  border: 1px solid #fed7aa;
  color: #92400e;
}

/* File type icon styling */
.file-type-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Loading spinner for validation */
.validation-spinner {
  border: 2px solid #f3f4f6;
  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); }
}

/* Drag and drop zone styling enhancements */
.file-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #f9fafb;
}

.file-drop-zone.drag-over {
  border-color: #3b82f6;
  background-color: #eff6ff;
  transform: scale(1.02);
}

.file-drop-zone:hover {
  border-color: #6b7280;
  background-color: #f3f4f6;
}

/* File size indicator styling */
.file-size-indicator {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
}

.file-size-indicator.large {
  color: #f59e0b;
  font-weight: 500;
}

.file-size-indicator.too-large {
  color: #ef4444;
  font-weight: 600;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  #fileValidationModal .bg-white,
  .file-drop-zone,
  #validationModalProceed {
    animation: none;
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #fileValidationModal {
    backdrop-filter: none;
    background-color: rgba(0, 0, 0, 0.8);
  }
  
  .validation-alert {
    border-width: 2px;
  }
}