/**
 * Validation Styles for Business Valuation Form
 * Provides visual feedback for form validation states
 */

/* Form field validation states */
.validation-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.validation-warning {
  border-color: #ffc107 !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25) !important;
}

/* Validation messages */
.validation-message {
  margin-top: 5px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
}

.validation-error.validation-message {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.validation-warning.validation-message {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}

/* Icons for validation messages */
.validation-message::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  margin-top: 1px;
}

.validation-error.validation-message::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23721c24' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3E%3Cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z'/%3E%3C/svg%3E");
}

.validation-warning.validation-message::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23856404' viewBox='0 0 16 16'%3E%3Cpath d='M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z'/%3E%3C/svg%3E");
}

/* Submission messages */
.submission-message {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  animation: slideIn 0.3s ease-out;
}

.submission-error.submission-message {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.submission-success.submission-message {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

/* Submit button states */
button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  background-color: #6c757d !important;
}

button[type="submit"]:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21, 190, 191, 0.3);
}

/* Report container */
.report-container {
  margin-top: 40px;
  padding: 30px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.5s ease-out;
}

.report-container h1 {
  color: #15BEBF;
  border-bottom: 3px solid #15BEBF;
  padding-bottom: 10px;
  margin-bottom: 25px;
}

.report-container h2 {
  color: #495057;
  margin-top: 30px;
  margin-bottom: 15px;
  padding-left: 15px;
  border-left: 4px solid #15BEBF;
}

.report-container h3 {
  color: #6c757d;
  margin-top: 25px;
  margin-bottom: 12px;
}

.report-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-container th,
.report-container td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.report-container th {
  background-color: #15BEBF;
  color: white;
  font-weight: 600;
}

.report-container tr:hover {
  background-color: #f8f9fa;
}

.report-container ul,
.report-container ol {
  padding-left: 25px;
  margin: 15px 0;
}

.report-container li {
  margin-bottom: 8px;
  line-height: 1.6;
}

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

.loading-spinner-large {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #15BEBF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

/* Progress overlay */
.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.progress-content {
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  max-width: 500px;
  width: 90%;
}

.progress-content h3 {
  font-family: 'Source Serif Pro', serif;
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 12px;
  font-weight: 600;
}

.progress-content p {
  color: #6c757d;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.progress-time {
  font-size: 0.9rem !important;
  color: #15BEBF !important;
  font-weight: 500 !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #15BEBF 0%, #15BEBF 100%);
  border-radius: 4px;
  transition: width 0.5s ease-out;
  width: 0%;
  animation: progressShimmer 2s infinite;
}

/* Enhanced button loading state */
.submit-btn.loading-state {
  position: relative;
  color: transparent !important;
}

.submit-btn.loading-state .loading-text {
  color: white;
  font-weight: 600;
}

.submit-btn.loading-state .loading-spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: white;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes progressShimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .validation-message {
    font-size: 13px;
    padding: 6px 10px;
  }
  
  .submission-message {
    font-size: 14px;
    padding: 12px;
  }
  
  .report-container {
    margin-top: 30px;
    padding: 20px 15px;
  }
  
  .report-container table {
    font-size: 14px;
  }
  
  .report-container th,
  .report-container td {
    padding: 10px 12px;
  }
  
  .progress-content {
    padding: 30px 20px;
    margin: 0 16px;
  }
  
  .progress-content h3 {
    font-size: 1.25rem;
  }
  
  .progress-content p {
    font-size: 0.9rem;
  }
  
  .progress-spinner-large {
    width: 36px;
    height: 36px;
    border-width: 3px;
    margin-bottom: 20px;
  }
}

/* Focus improvements for accessibility */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(21, 190, 191, 0.3) !important;
}

.validation-error:focus {
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3) !important;
}

.validation-warning:focus {
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3) !important;
}

/* Print styles for reports */
@media print {
  .report-container {
    background: white !important;
    box-shadow: none !important;
    border: 1px solid #333 !important;
  }
  
  .validation-message,
  .submission-message {
    display: none !important;
  }
}