/* AI Card Styling */
.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
  transition: all 0.3s ease;
}

.card.shadow-sm:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Custom File Upload */
.custom-file-upload {
  text-align: center;
}

.upload-area {
  border: 2px dashed #dee2e6;
  cursor: pointer;
  transition: all 0.25s ease;
  background-color: #f8f9fa;
}

.upload-area:hover {
  border-color: #0d6efd;
  background-color: #eef5ff;
}

.upload-area:active {
  transform: scale(0.995);
}

.file-upload-label {
  display: inline-block;
  padding: 20px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px dashed rgba(255, 255, 255, 0.5);
}

.file-upload-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  border-color: white;
}

.file-upload-label i {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.file-label-text {
  font-size: 1rem;
  font-weight: 600;
}

.file-name-display {
  font-size: 0.9rem;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 4px;
  display: inline-block;
}

.dropzone {
  min-height: 220px;
  border: 2px dashed #d0d7de;
  background-color: #fafbfc;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dropzone:hover {
  border-color: #0d6efd;
  background-color: #f0f6ff;
}

.dropzone.dragover {
  border-color: #0d6efd;
  background-color: #e7f1ff;
  transform: scale(1.02);
}

.file-preview {
  background-color: #ffffff;
}

/* =========== */

.ai-file-upload-wrapper {
  width: 100%;
}

.file-drop-zone * {
  pointer-events: none;
}

.file-drop-zone input,
.file-drop-zone label {
  pointer-events: auto;
}

.file-drop-zone {
  position: relative;
  min-height: 220px;
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  background: #f8f9fa;
  padding: 20px 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.file-drop-zone:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.file-drop-zone.drag-over {
  border-color: #667eea;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  border-width: 2px;
}

.file-drop-zone.drag-over .drop-zone-content {
  display: none;
}

.file-drop-zone.drag-over .drop-zone-hover {
  display: flex;
}

.drop-zone-content {
  display: block;
  align-items: center;
}

.drop-zone-hover {
  display: none;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #667eea;
  font-weight: 600;
  font-size: 18px;
}

.upload-icon {
  font-size: 64px;
  color: #a0aec0;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.file-drop-zone:hover .upload-icon {
  color: #667eea;
  transform: translateY(-5px);
}

.upload-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 14px;
  color: #718096;
  margin-bottom: 15px;
}

.btn-choose-file {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  margin: 0;
}

.btn-choose-file:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.upload-hint {
  font-size: 13px;
  color: #a0aec0;
}

.selected-file-info {
  animation: slideDown 0.3s ease;
}

/* AI Button */
.btn-ai-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-ai-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  color: white;
}

.btn-ai-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ai-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.5s ease;
}

.btn-ai-primary:hover:not(:disabled)::before {
  left: 100%;
}

.file-info-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.file-info-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-icon {
  font-size: 40px;
  color: #e53e3e;
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  text-align: left;
}

.file-name {
  font-size: 15px;
  font-weight: 600;
  color: #2d3748;
  word-break: break-word;
}

.file-size {
  font-size: 13px;
  color: #718096;
}

.btn-remove-file {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fee;
  border: none;
  color: #e53e3e;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-remove-file:hover {
  background: #e53e3e;
  color: white;
  transform: rotate(90deg);
}

/* Progress Section */
.ai-progress-wrapper {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.progress-status {
  font-weight: 600;
  color: #667eea;
}

.progress-percentage {
  font-weight: 700;
  color: #764ba2;
  font-size: 1.1rem;
}

.ai-progress {
  height: 5px;
  border-radius: 12px;
  background-color: #e9ecef;
  overflow: hidden;
}

.ai-progress .progress-bar {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.progress-step-text {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Success/Error Messages */
.alert {
  border-radius: 8px;
  border: none;
}

.alert-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.alert-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
}

/* Animation */
.animated {
  animation-duration: 0.5s;
  animation-fill-mode: both;
}

.fadeIn {
  animation-name: fadeIn;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Spinning icon */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .file-upload-label {
    padding: 15px 30px;
  }

  .file-upload-label i {
    font-size: 1.5rem;
  }
}

/* Mobile responsive */
@media (max-width: 576px) {
  .file-drop-zone {
    padding: 30px 15px;
  }

  .upload-icon {
    font-size: 48px;
  }

  .upload-title {
    font-size: 16px;
  }

  .btn-choose-file {
    padding: 10px 20px;
    font-size: 14px;
  }
}
