/* Version: 1.0.1 - Last updated: 2025-02-26 */
.progress {
    position: fixed;
    top: 56px;
    left: 230px;
    right: 0;
    z-index: 1000;
    margin: 0;
    height: 4px;
    width: 100%;
    border-radius: 2px;
    background-clip: padding-box;
    overflow: hidden;
    display: none;
    background-color: #f3f3f3; /* Add a background color */
  }
  .progress .indeterminate:before {
    content: "";
    position: absolute;
    background-color: inherit;
    top: 0;
    left: 0;
    bottom: 0;
    will-change: left, right;
    -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395)
      infinite;
    animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
    background-color: #007bff; /* Add a color for the progress bar */
  }
  .progress .indeterminate:after {
    content: "";
    position: absolute;
    background-color: inherit;
    top: 0;
    left: 0;
    bottom: 0;
    will-change: left, right;
    -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1)
      infinite;
    animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1)
      infinite;
    -webkit-animation-delay: 1.15s;
    animation-delay: 1.15s;
  }
  .progress {
    display: none;
  }
  body.htmx-request .progress {
    display: block; /* Change to block instead of inline */
  }
  .htmx-request .progress {
    display: block; /* Change to block instead of inline */
  }
  @-webkit-keyframes indeterminate {
    0% {
      left: -35%;
      right: 100%;
    }
    60% {
      left: 100%;
      right: -90%;
    }
    100% {
      left: 100%;
      right: -90%;
    }
  }
  @keyframes indeterminate {
    0% {
      left: -35%;
      right: 100%;
    }
    60% {
      left: 100%;
      right: -90%;
    }
    100% {
      left: 100%;
      right: -90%;
    }
  }
  @-webkit-keyframes indeterminate-short {
    0% {
      left: -200%;
      right: 100%;
    }
    60% {
      left: 107%;
      right: -8%;
    }
    100% {
      left: 107%;
      right: -8%;
    }
  }
  @keyframes indeterminate-short {
    0% {
      left: -200%;
      right: 100%;
    }
    60% {
      left: 107%;
      right: -8%;
    }
    100% {
      left: 107%;
      right: -8%;
    }
  }

/* Add these new styles at the end of the file */
.image-magnifier {
    position: relative;
    overflow: hidden;
}

.image-magnifier img {
    max-width: 100%;
    display: block;
}

.magnifier-glass {
    position: absolute;
    border: 3px solid #000;
    border-radius: 50%;
    cursor: none;
    width: 150px;
    height: 150px;
    display: none;
    pointer-events: none;
    transition: background-position 0.1s ease;
}

.pdf-viewer-container {
    position: relative;
    width: 100%;
}

.pdf-preview-wrapper {
    position: relative;
    width: 100%;
}

.pdf-preview {
    transition: opacity 0.3s ease-in-out;
    width: 100%;
    height: auto;
}

.pdf-preview.loading {
    opacity: 0.5;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050; /* Increased z-index to appear above preview */
    display: none;
}

.loading-spinner.active {
    display: block;
}

.pdf-controls-container {
    position: fixed;
    bottom: 10px;
    left: calc(230px + 25%); /* Sidebar width (230px) plus half of the remaining 50% column */
    transform: translateX(-50%); /* Center the controls */
    width: auto;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.pdf-controls {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
}

/* Responsive adjustments for PDF controls */
@media (max-width: 991.98px) {
    .pdf-controls-container {
        left: 50%; /* Center in mobile view */
        width: 90%;
        transform: translateX(-50%);
    }
}

/* Sidebar and main content styles */
@media (min-width: 992px) {
    #sidebar {
        width: 230px;
        visibility: visible !important;
        transform: none !important;
    }
    
    .main-content {
        margin-left: 230px;
        padding-top: 56px;  /* Height of navbar */
    }
    
    .progress {
        left: 230px;
    }
}

/* Navbar and sidebar styling */
.navbar {
    padding-left: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.nav-link {
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.nav-link:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.nav-link.active {
    background-color: #0d6efd;
    color: white;
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding-top: 56px;
    }
    
    .progress {
        left: 0;
    }
    .pdf-viewer-container,
    .preview-image-container {
        width: 100%;
        max-width: 100%;
    }
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 56px; /* Height of navbar */
    bottom: 0;
    left: 0;
    width: 230px;
    z-index: 100;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

/* Main content styles */
.main-content {
    margin-left: 230px;
    min-height: calc(100vh - 56px);
    width: calc(100% - 230px);
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .progress {
        left: 0;
    }
}

.uploaded-image-container {
    width: 100%;
    max-width: 100%;
}

#pdf-viewer-content {
    width: 100%;
    max-width: 100%;
}

/* Override any Bootstrap container constraints if needed */
.container-fluid .pdf-viewer-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Add these styles */
.image-viewer-container {
    width: 100%;
    max-width: 100%;
}

/* Style specifically for PDF pages */
.image-viewer-container #pdf-page {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Match the PDF container to image container */
#pdf-viewer-content {
    width: 100% !important;
    max-width: 100% !important;
}

/* Modal adjustments */
.modal-dialog {
    margin: 1.75rem auto;
}

.modal {
    padding-right: 0 !important;
}

/* Fix modal position relative to navbar */
body {
    padding-right: 0 !important;
}

body.modal-open {
    overflow: hidden;
}

/* Adjust modal content spacing */
.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Bank account entry styling */
.bank-account-entry {
    background-color: var(--bs-gray-100);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

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

/* Fix modal backdrop cleanup */
.modal-backdrop {
    opacity: 0.5;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Ensure body returns to normal after modal closes */
body:not(.modal-open) {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Vendor styles (from styles.css) */
.vendor-link {
    color: #007bff;
    text-decoration: none;
    background-color: transparent;
    cursor: pointer;
}

.vendor-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Red warning styles */
.btn-link.text-danger {
    color: #212529 !important;
}

.btn-link.text-danger .bi-exclamation-triangle-fill {
    color: #dc3545 !important;
}

.btn-link.text-danger small {
    color: #dc3545 !important;
}

.btn-link.border-danger {
    border-color: #dc3545 !important;
}

.btn-link.border-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.btn-link.border-danger:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.vendor-warning-btn {
    width: 100%;
    text-align: left;
    position: relative;
}

/* Temporary verification style - remove after testing */
/* .navbar-brand {
    background-color: #ffcc00 !important; 
    padding: 5px 10px !important;
    border-radius: 5px !important;
} */