/* Custom CSS for Barcode Validator App */

:root {
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-success: #198754;
  --bs-danger: #dc3545;
  --bs-warning: #ffc107;
  --bs-info: #0dcaf0;
  --bs-light: #f8f9fa;
  --bs-dark: #212529;
}

/* Compact Results Styles */
.compact-results-container {
  max-width: 100%;
  margin: 0 auto;
}

.compact-header {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
}

.compact-validation-table {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.compact-validation-table th {
  background-color: #e9ecef;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 8px 6px;
  border: 1px solid #dee2e6;
}

.compact-validation-table td {
  padding: 6px;
  border: 1px solid #dee2e6;
  vertical-align: middle;
}

.compact-validation-table .badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  min-width: 60px;
}

.image-container {
  padding: 10px;
}

.uploaded-image-container img {
  border: 2px solid #dee2e6;
  border-radius: 8px;
}

.no-image-placeholder {
  border: 2px dashed #dee2e6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .compact-validation-table {
    font-size: 0.75rem;
  }

  .compact-validation-table th,
  .compact-validation-table td {
    padding: 4px;
  }

  .compact-validation-table .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .compact-header h5 {
    font-size: 1rem;
  }
}

/* Validation Checklist Styles */
.validation-checklist {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.checklist-item {
  background: white;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.checklist-item:hover {
  transform: translateX(5px);
}

.checklist-item .fas {
  font-size: 1.1em;
}

.detail-item {
  margin-bottom: 8px;
}

.detail-item label {
  color: #495057;
  font-weight: 500;
}

.detected-info, .company-info, .raw-analysis {
  background: white;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #e9ecef;
}

.detected-info h6, .company-info h6, .raw-analysis h6 {
  color: #495057;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 8px;
  margin-bottom: 15px;
}

/* Custom button styles */
.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Navigation styles */
.navbar-brand {
  font-weight: 600;
}

.nav-link {
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-link.active {
  font-weight: 600;
}

/* Content sections */
.content-section {
  min-height: calc(100vh - 76px); /* Adjust for navbar height */
  padding-top: 20px;
}

/* Action buttons on home page */
.btn-lg {
  transition: all 0.3s ease;
}

.btn-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Results styling */
.result-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-left: 4px solid var(--bs-success);
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
}

.result-error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-left: 4px solid var(--bs-danger);
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
}

.result-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-left: 4px solid var(--bs-warning);
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
}

/* Card enhancements */
.card {
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Form enhancements */
.form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
  font-weight: 600;
  color: var(--bs-dark);
}

/* Tab styling */
.nav-tabs .nav-link {
  border: none;
  color: #6c757d;
  font-weight: 500;
}

.nav-tabs .nav-link.active {
  background-color: var(--bs-primary);
  color: white;
  border-radius: 6px 6px 0 0;
}

.nav-tabs .nav-link:hover {
  border: none;
  background-color: rgba(13, 110, 253, 0.1);
}

/* Loading spinner customization */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Image preview styling */
#image-preview img {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

/* Processing indicator */
#processing-indicator {
  background: rgba(13, 110, 253, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(13, 110, 253, 0.2);
}

/* History list styling */
.history-item {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.history-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.history-item.success {
  border-left: 4px solid var(--bs-success);
}

.history-item.error {
  border-left: 4px solid var(--bs-danger);
}

.history-item.warning {
  border-left: 4px solid var(--bs-warning);
}

/* Settings form styling */
.settings-form {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Badge styling */
.badge {
  font-size: 0.75em;
  padding: 0.5em 0.75em;
}

/* Alert enhancements */
.alert {
  border: none;
  border-radius: 8px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* Utility classes */
.text-primary {
  color: var(--bs-primary) !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

.border-primary {
  border-color: var(--bs-primary) !important;
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .content-section {
    padding-top: 10px;
  }
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
  
  .display-6 {
    font-size: 2rem;
  }
  
  .scanning-frame {
    width: 200px;
    height: 120px;
  }
}

@media (max-width: 576px) {
  .nav-tabs {
    flex-wrap: wrap;
  }
  
  .nav-tabs .nav-link {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  .settings-form {
    padding: 15px;
  }
}

/* Camera and scanning styles */
.scanning-frame {
    position: relative;
    width: 250px;
    height: 150px;
    border: 2px solid var(--bs-primary);
    border-radius: 8px;
    background: rgba(13, 110, 253, 0.1);
    margin: auto;
}

.scanning-frame::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--bs-primary);
    animation: scan-line 2s linear infinite;
}

@keyframes scan-line {
    0% {
        transform: translateY(-75px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(75px);
        opacity: 0;
    }
}
    height: 150px;
    border: 2px solid #0d6efd;
    border-radius: 8px;
    background: rgba(13, 110, 253, 0.1);
    animation: scanPulse 2s infinite;
}

@keyframes scanPulse {
    0%, 100% {
        border-color: #0d6efd;
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    50% {
        border-color: #0056b3;
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }
}

/* Camera capture effect */
.capture-flash {
    animation: captureFlash 0.2s ease-out;
}

@keyframes captureFlash {
    0% { background-color: rgba(255, 255, 255, 0); }
    50% { background-color: rgba(255, 255, 255, 0.8); }
    100% { background-color: rgba(255, 255, 255, 0); }
}

/* Camera controls */
.camera-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.camera-controls .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Camera video styling */
#camera-video {
    border-radius: 8px;
    background: #000;
    max-height: 400px;
    object-fit: cover;
    width: 100%;
}

/* Camera modal styling */
#cameraModal .modal-body {
    padding: 1rem;
    background: #000;
    border-radius: 8px;
}

#camera-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
}

#scanning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through to buttons below */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Barcode detection overlay */
.barcode-detected {
    position: absolute;
    border: 3px solid #28a745;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 4px;
    animation: barcodeDetected 0.5s ease-out;
}

@keyframes barcodeDetected {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Drag and drop styles */
.drag-over {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    border: 2px dashed #0d6efd;
    border-radius: 12px;
    animation: dragPulse 1s infinite;
}

@keyframes dragPulse {
    0%, 100% {
        border-color: #0d6efd;
        background: rgba(13, 110, 253, 0.1);
    }
    50% {
        border-color: #0056b3;
        background: rgba(13, 110, 253, 0.15);
    }
}

/* File upload enhancements */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

.upload-area.drag-over {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.drag-over .upload-icon {
    color: #0d6efd;
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* File preview enhancements */
#image-preview {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

#image-preview.fade-in {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

#preview-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Processing indicator */
.processing-spinner {
    animation: spin 1s linear infinite;
}

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

/* File type indicators */
.file-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Enhanced Results Display Styles */
.enhanced-results-container {
  background: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.results-header {
  border-bottom: 2px solid var(--bs-light);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.result-title h4 {
  color: var(--bs-dark);
  font-weight: 600;
}

.result-actions .btn {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-card {
  transition: all 0.15s ease-in-out;
  height: 100%;
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.status-card .card-body {
  padding: 1rem;
}

.status-card .fa-2x {
  font-size: 1.75rem;
}

.result-section {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.15s ease-in-out;
}

.result-section:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.section-header {
  background: var(--bs-light);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border-bottom: 1px solid #e9ecef;
}

.section-header:hover {
  background: #e9ecef;
}

.section-header h5 {
  margin: 0;
  color: var(--bs-dark);
  font-weight: 600;
}

.section-content {
  padding: 1.25rem;
}

.result-section-toggle {
  transition: transform 0.2s ease-in-out;
}

.summary-text .lead {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--bs-dark);
}

.quick-stats {
  background: var(--bs-light);
  border-radius: 0.375rem;
  padding: 1rem;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.stat-label {
  font-weight: 500;
  color: #6c757d;
}

.stat-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.compliance-grid {
  display: grid;
  gap: 1rem;
}

.compliance-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bs-light);
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.compliance-item:hover {
  background: #e9ecef;
}

.compliance-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  min-width: 40px;
}

.compliance-details {
  flex-grow: 1;
}

.compliance-details h6 {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  color: var(--bs-dark);
}

.compliance-details p {
  margin: 0;
  font-size: 0.875rem;
  color: #6c757d;
}

.compliance-status {
  margin-left: 1rem;
}

.issues-list .list-group-item,
.warnings-list .list-group-item {
  border-left: 4px solid transparent;
  transition: all 0.15s ease-in-out;
}

.issues-list .list-group-item {
  border-left-color: var(--bs-danger);
}

.warnings-list .list-group-item {
  border-left-color: var(--bs-warning);
}

.issues-list .list-group-item:hover,
.warnings-list .list-group-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item label {
  font-weight: 500;
  color: #6c757d;
  margin: 0;
  min-width: 120px;
}

.detail-item span {
  font-weight: 600;
  color: var(--bs-dark);
  text-align: right;
}

.batch-info,
.date-validation,
.expiry-analysis,
.company-info {
  background: var(--bs-light);
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.batch-info:last-child,
.date-validation:last-child,
.expiry-analysis:last-child,
.company-info:last-child {
  margin-bottom: 0;
}

.ai-insights {
  background: rgba(13, 202, 240, 0.1);
  border-radius: 0.375rem;
  padding: 1rem;
}

.ai-summary {
  background: rgba(13, 202, 240, 0.05);
  border-left: 4px solid var(--bs-info);
  padding: 1rem;
  border-radius: 0 0.375rem 0.375rem 0;
}

.recommendations-list {
  display: grid;
  gap: 1rem;
}

.recommendation-item {
  background: rgba(13, 202, 240, 0.05);
  border-radius: 0.375rem;
  padding: 1rem;
  transition: all 0.15s ease-in-out;
}

.recommendation-item:hover {
  background: rgba(13, 202, 240, 0.1);
}

.recommendation-number .badge {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.recommendation-content p {
  line-height: 1.5;
  color: var(--bs-dark);
}

.sources-list {
  display: grid;
  gap: 0.5rem;
}

.source-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.action-buttons-section {
  border-top: 2px solid var(--bs-light);
  padding-top: 1.5rem;
}

.action-buttons-section .btn {
  min-width: 140px;
}

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

/* Print styles */
@media print {
  .navbar,
  .btn,
  .modal {
    display: none !important;
  }

  .content-section {
    min-height: auto;
  }
}

/* UI Enhancement Styles */
.ui-enhanced {
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.loading-overlay.show {
  opacity: 1;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-content .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Button Ripple Effect */
.btn {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Card Hover Effects */
.card-hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  transition: all var(--transition-normal);
}

/* Enhanced Animations */
.fade-in {
  animation: fadeIn var(--transition-slow) ease-in-out;
}

.slide-in-up {
  animation: slideInUp var(--transition-slow) ease-out;
}

.slide-in-down {
  animation: slideInDown var(--transition-slow) ease-out;
}

.scale-in {
  animation: scaleIn var(--transition-normal) ease-out;
}

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
  max-width: 400px;
}

.notification {
  background: white;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-bottom: 1rem;
  animation: slideInDown var(--transition-normal) ease-out;
}

.notification-content {
  padding: 1rem;
  display: flex;
  align-items: center;
}

.notification-success {
  border-left: 4px solid var(--bs-success);
}

.notification-error {
  border-left: 4px solid var(--bs-danger);
}

.notification-warning {
  border-left: 4px solid var(--bs-warning);
}

.notification-info {
  border-left: 4px solid var(--bs-info);
}

.notification .btn-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.5;
}

.notification .btn-close:hover {
  opacity: 1;
}

/* Enhanced Focus Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-color: #86b7fe;
}

/* Improved Accessibility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--bs-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* Enhanced Modal Styles */
.modal-content {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.5rem;
}

/* Export Modal Enhancements */
.export-options .btn {
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-normal);
}

.export-options .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.export-options .btn i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Lazy Loading */
.lazy-load {
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-slow);
}

.lazy-load.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Progress Indicators */
.progress-enhanced {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e9ecef;
}

.progress-enhanced .progress-bar {
  transition: width 1s ease-in-out;
  border-radius: 4px;
}

/* Enhanced Tooltips */
.tooltip {
  font-size: 0.875rem;
}

.tooltip-inner {
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}

/* Responsive design for enhanced results */
@media (max-width: 768px) {
  .enhanced-results-container {
    padding: 1rem;
  }

  .results-header {
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
  }

  .status-card .card-body {
    padding: 0.75rem;
  }

  .section-header {
    padding: 0.75rem 1rem;
  }

  .section-content {
    padding: 1rem;
  }

  .compliance-item {
    padding: 0.75rem;
  }

  .compliance-icon {
    margin-right: 0.75rem;
    min-width: 30px;
    font-size: 1.25rem;
  }

  .detail-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .detail-item span {
    text-align: left;
  }

  .action-buttons-section .btn {
    min-width: auto;
    flex: 1;
  }

  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .export-options .btn {
    height: 60px;
  }

  .export-options .btn i {
    font-size: 1.25rem;
  }
}

/* History Management Styles */
.history-stats .stat-item {
    text-align: center;
    min-width: 60px;
}

.history-stats .stat-item small {
    display: block;
    font-size: 0.75rem;
}

.history-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.125);
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.history-list .table th {
    border-top: none;
    font-weight: 600;
    background-color: var(--bs-light);
}

.history-list .table tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.stat-card {
    transition: transform 0.2s ease;
    border: 1px solid rgba(0,0,0,0.125);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.risk-stats .d-flex,
.activity-stats .d-flex,
.top-issues .d-flex {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.risk-stats .d-flex:last-child,
.activity-stats .d-flex:last-child,
.top-issues .d-flex:last-child {
    border-bottom: none;
}

.view-toggle {
    border-radius: 0;
}

.view-toggle:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.view-toggle:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.view-toggle.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.empty-state {
    padding: 3rem 1rem;
}

.empty-state i {
    opacity: 0.5;
}

/* History filters */
#advanced-filters {
    background-color: rgba(var(--bs-light-rgb), 0.5);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

/* Bulk actions */
#bulk-actions {
    border-left: 4px solid var(--bs-info);
    background-color: rgba(var(--bs-info-rgb), 0.1);
}

/* History item animations */
.history-list tbody tr,
.history-card {
    animation: fadeInUp 0.3s ease-out;
}

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

/* History search highlighting */
.history-search-highlight {
    background-color: yellow;
    padding: 0 2px;
    border-radius: 2px;
}

/* History export modal */
.export-format-option {
    border: 2px solid transparent;
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-format-option:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.export-format-option.selected {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.export-format-option i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
}

/* History statistics charts */
.chart-container {
    position: relative;
    height: 200px;
    margin: 1rem 0;
}

/* Responsive adjustments for history */
@media (max-width: 768px) {
    .history-stats {
        display: none !important;
    }

    .history-list .table-responsive {
        font-size: 0.875rem;
    }

    .history-card {
        margin-bottom: 1rem;
    }

    .view-toggle {
        padding: 0.375rem 0.5rem;
    }

    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* History loading states */
.history-loading {
    text-align: center;
    padding: 2rem;
    color: var(--bs-secondary);
}

.history-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* History item status indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.valid {
    background-color: var(--bs-success);
}

.status-indicator.invalid {
    background-color: var(--bs-danger);
}

.status-indicator.pending {
    background-color: var(--bs-warning);
}

/* Image Crop Modal Styles */
#crop-container {
    min-height: 300px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

#crop-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
    border: 2px solid #dee2e6;
    display: block;
}

/* Mobile optimizations for crop modal */
@media (max-width: 767px) {
    #cropModal .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    #cropModal .modal-footer .btn {
        flex: 1 1 calc(50% - 4px);
        margin: 0 !important;
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    #cropModal .modal-footer .btn i {
        display: none;
    }

    #crop-container {
        min-height: 250px;
    }
}

/* Text Diff Highlighting Styles */
.diff-removed {
    background-color: #ffebee;
    color: #c62828;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
    text-decoration: line-through;
}

.diff-added {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

.diff-mismatch {
    color: #c62828;
    font-weight: 600;
}
