body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.footer {
  flex-shrink: 0;
  margin-top: auto;
  background-color: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 10;
}

.card {
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

//* Better text handling for long content */
.text-break {
  word-wrap: break-word;
  word-break: break-word;
}

/* Table Improvements */
.table-responsive {
  overflow-x: auto;
}

.table th, .table td {
  vertical-align: middle;
}

/* Resizable Quill Editor */
#detailedStepsEditor {
  resize: vertical;
  overflow: auto;
  min-height: 300px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

#detailedStepsEditor .ql-editor {
  min-height: 250px;
}

/* Fixed width columns for better alignment */
.table .findings-table-actions {
  width: 120px; /* Fixed width for actions column */
  min-width: 120px;
  text-align: right;
  white-space: nowrap;
}

.table .findings-name-column {
  min-width: 200px; /* Minimum width for name column */
  max-width: 400px; /* Maximum width to prevent excessive stretching */
}

.table .findings-name-cell {
  white-space: normal;
  word-break: break-word;
  max-width: 400px;
}

.table .findings-app-column {
  min-width: 150px;
  max-width: 250px;
}

.table .findings-severity-column, 
.table .findings-status-column {
  width: 100px;
  min-width: 100px;
  text-align: center;
}

.table .findings-date-column, 
.table .findings-ref-column {
  width: 120px;
  min-width: 120px;
  text-align: center;
}

/* Ensure TD content aligns with TH headers */
.table td[data-label="Severity"],
.table td[data-label="Status"],
.table td[data-label="Date"],
.table td[data-label="Reference"] {
  text-align: center;
}

/* Center badge content */
.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 65px;
}

/* Action buttons styling */
.action-buttons-container {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.action-buttons-container form {
  margin-bottom: 0;
}

/* Increase container width for larger screens */
@media (min-width: 1200px) {
  .container {
    max-width: 1340px;
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
}

@media (min-width: 1600px) {
  .container {
    max-width: 1540px;
  }
}

/* Responsive adjustments for small screens */
@media (max-width: 767.98px) {
  .table td {
    padding: 0.75rem 0.5rem;
  }
  
  .findings-table-actions {
    display: flex;
    justify-content: center;
    width: 100% !important;
  }
}

/* Mobile-optimized table */
@media (max-width: 575.98px) {
  .table-responsive {
    border: 0;
  }
  
  .table-responsive table {
    width: 100%;
  }
  
  .table-responsive thead {
    display: none;
  }
  
  .table-responsive tr {
    margin-bottom: 1rem;
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
  }
  
  .table-responsive td {
    display: block;
    text-align: right;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
  }
  
  .table-responsive td:before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
  }
  
  .table-responsive td:last-child {
    border-bottom: 0;
  }
  
  .findings-table-actions {
    text-align: center !important;
  }
  
  .action-buttons-container {
    justify-content: center;
  }
}
}

/* Evidence image container for better display */
.evidence-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  overflow: hidden;
  background-color: #f8f9fa;
}

/* Prevent large pre blocks from breaking layout */
pre {
  white-space: pre-wrap;
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
}

/* Better handling of very long content */
.overflow-auto {
  max-height: none;
}

/* For code blocks specifically */
pre.overflow-auto {
  max-height: 400px;
}

.img-thumbnail {
  max-height: 150px;
  object-fit: cover;
}

/* Severity badge colors */
.badge.bg-danger {
  background-color: #dc3545 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
}

.badge.bg-info {
  background-color: #0dcaf0 !important;
}

.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-secondary {
  background-color: #6c757d !important;
}

/* Header with action buttons styling */
.header-container {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.action-buttons {
  align-self: flex-end;
  margin-bottom: 15px;
}

/* Finding title styling */
.finding-title {
  margin-top: 10px;
  margin-bottom: 10px;
  width: 100%;
}

/* Status badge styling */
.status-badge {
  margin-left: 8px;
}

/* Bootstrap 5 Modal Improvements */
.modal-dialog {
  max-width: 600px;
}

@media (min-width: 992px) {
  .modal-lg, .modal-xl {
    max-width: 800px;
  }
}

/* Bulk Export button group styling */
.dropdown-toggle.btn-success::after {
  margin-left: 0.5em;
}

/* Clearfix for the header container */
.header-container:after {
  content: "";
  display: table;
  clear: both;
}

/* Responsive adjustments for small screens */
@media (max-width: 767.98px) {
  .card-body {
    padding: 1rem;
  }
  
  h5 {
    font-size: 1.1rem;
  }
  
  .evidence-image-container {
    height: 150px;
  }
  
  .d-md-flex {
    flex-direction: column;
  }
  
  .me-md-2 {
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }
  
  .action-buttons {
    align-self: flex-start;
    margin-bottom: 10px;
  }
  
  .action-buttons .btn {
    margin-bottom: 5px;
  }
  
  .findings-table-actions {
    display: flex;
    justify-content: center;
    width: 100% !important;
  }
  
  .table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Mobile-optimized table */
@media (max-width: 575.98px) {
  .table-responsive {
    border: 0;
  }
  
  .table-responsive table {
    width: 100%;
  }
  
  .table-responsive thead {
    display: none;
  }
  
  .table-responsive tr {
    margin-bottom: 1rem;
    display: block;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
  }
  
  .table-responsive td {
    display: block;
    text-align: right;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
  }
  
  .table-responsive td:before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
  }
  
  .table-responsive td:last-child {
    border-bottom: 0;
  }
  
  .findings-table-actions {
    text-align: center !important;
  }
}

/* Project table styling */
.project-table th, .project-table td {
  vertical-align: middle;
}

/* Column widths for better layout */
.project-name-column {
  min-width: 250px;
  width: 35%;
}

.project-app-column {
  min-width: 150px;
  width: 15%;
}

/* Fixed alignment for center columns */
.project-type-column,
.project-status-column,
.project-findings-column,
.project-date-column {
  width: 110px;
  min-width: 110px;
  text-align: center;
}

/* Ensure TD content aligns with TH headers */
.project-table td[data-label="Type"],
.project-table td[data-label="Status"],
.project-table td[data-label="Findings"],
.project-table td[data-label="Created"] {
  text-align: center;
}

.project-actions-column {
  width: 120px;
  min-width: 120px;
  text-align: right;
}

/* Project name cell styling */
.project-name-cell {
  white-space: normal;
  word-break: normal;
}

.project-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 400px;
}

/* Center badge content */
.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 65px;
}

/* Project row hover effect */
.project-row:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Responsive adjustments for project table */
@media (max-width: 991.98px) {
  .project-description {
    -webkit-line-clamp: 1;
  }
}

/* Mobile view for projects table */
@media (max-width: 767.98px) {
  .project-table .action-buttons-container {
    justify-content: center;
  }
  
  .project-description {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  /* Card-style display for project rows on mobile */
  .project-table thead {
    display: none;
  }
  
  .project-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  
  .project-table td {
    display: block;
    text-align: right;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
  }
  
  .project-table td:before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
  }
  
  .project-table td:last-child {
    border-bottom: 0;
  }
  
  .project-name-cell {
    background-color: #f8f9fa;
  }
  
  .project-name-cell div.d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }
  
  .project-name-cell div.project-icon {
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }
  
  .project-actions-column {
    text-align: center !important;
  }
  
  .action-buttons-container {
    justify-content: center;
  }
}

/* Toggle view button styling */
#toggleViewBtn {
  transition: all 0.2s ease;
}

#toggleViewBtn:hover {
  background-color: #6c757d;
  color: white;
}

/* Grid view card enhancements */
#gridView .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#gridView .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1) !important;
}

/* Fix for card footer buttons on mobile */
  @media (max-width: 767.98px) {
    .footer {
      text-align: center;
    }
    
    .footer .text-lg-start,
    .footer .text-lg-end {
      text-align: center !important;
    }
  }
  
    @media (min-height: 800px) {
    .content-wrapper {
      min-height: calc(100vh - 160px); /* Adjust based on navbar + footer height */
    }
  }
  
/* Validation Error Alert */
.validation-alert {
  position: fixed;
  top: 80px; /* Below navbar */
  right: 20px;
  max-width: 400px;
  z-index: 1055;
  animation: slideInRight 0.4s ease-out;
  border: none;
  box-shadow: 0 8px 32px rgba(220, 53, 69, 0.15);
  border-left: 4px solid #dc3545;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-tabs .nav-link.has-errors::before {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  background-color: #dc3545;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  z-index: 1;
}

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

/* Enhanced Field Validation - FIXED */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
  background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Custom Validation Feedback - FIXED */
.invalid-feedback {
  display: none; /* Always hidden by default */
  font-size: 0.875rem;
  color: #dc3545;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(220, 53, 69, 0.05);
  border-radius: 0.375rem;
  border-left: 3px solid #dc3545;
  animation: fadeInUp 0.3s ease-out;
}

/* Only show invalid feedback when explicitly set to display block */
.invalid-feedback.show,
.form-control.is-invalid + .invalid-feedback[style*="display: block"],
.form-select.is-invalid + .invalid-feedback[style*="display: block"] {
  display: block !important;
}

/* Ensure fields without validation classes have no special styling */
.form-control:not(.is-invalid):not(.is-valid),
.form-select:not(.is-invalid):not(.is-valid) {
  border-color: #ced4da; /* Default Bootstrap border color */
  box-shadow: none;
}

/* Enhanced Field Validation - IMPROVED */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
  background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Success States - IMPROVED */
.form-control.is-valid,
.form-select.is-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

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

.invalid-feedback i {
  margin-right: 0.5rem;
}

/* Progress Bar Enhancement */
.progress {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  transition: width 0.6s ease;
}

.progress-bar.bg-danger {
  background: linear-gradient(90deg, #dc3545, #c82333);
}

.progress-bar.bg-warning {
  background: linear-gradient(90deg, #ffc107, #ffb300);
}

.progress-bar.bg-success {
  background: linear-gradient(90deg, #28a745, #218838);
}

/* Summary Error Section */
.validation-summary {
  display: none;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
  border: 1px solid rgba(220, 53, 69, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

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

.validation-summary.show {
  display: block;
}

.validation-summary .error-list {
  margin: 0;
  padding-left: 1.5rem;
}

.validation-summary .error-list li {
  margin-bottom: 0.25rem;
  color: #721c24;
}

.validation-summary .error-list li::marker {
  color: #dc3545;
}

/* Remove the problematic tab validation indicator */
.tab-validation-indicator {
  display: none; /* Disable this completely */
}

/* Success States */
.form-control.is-valid,
.form-select.is-valid {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

.valid-feedback {
  display: none; /* Hide by default */
  font-size: 0.875rem;
  color: #28a745;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(40, 167, 69, 0.05);
  border-radius: 0.375rem;
  border-left: 3px solid #28a745;
}

/* Show valid feedback only when field has is-valid class */
.form-control.is-valid + .invalid-feedback + .valid-feedback,
.form-select.is-valid + .invalid-feedback + .valid-feedback {
  display: block;
}

    /* Clear button styling */
   .clear-input:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
  }