/* Custom CSS for PulseExtract */

:root {
    --upload-area-bg: hsl(210 11% 98%);
    --upload-area-border: hsl(210 11% 85%);
    --upload-area-hover: hsl(210 20% 95%);
    --upload-area-active: hsl(210 30% 92%);
}

/* Contract Details Table Styling */
.contract-table td {
    vertical-align: top;
    word-wrap: break-word;
}

.contract-description-cell {
    max-width: 400px;
    min-width: 200px;
    white-space: normal;
    line-height: 1.4;
}

.contract-table .table-responsive {
    overflow-x: auto;
}

/* Upload Area Styling */
.upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover {
    background-color: var(--upload-area-hover);
    border-color: var(--bs-primary) !important;
}

.upload-area.drag-over {
    background-color: var(--upload-area-active);
    border-color: var(--bs-primary) !important;
    border-style: solid !important;
}

/* File list styling */
#fileList {
    position: relative !important;
    z-index: 20 !important;
    background: var(--bs-body-bg) !important;
    border: 2px solid var(--bs-border-color) !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

#fileList h6 {
    color: var(--bs-body-color) !important;
    margin-bottom: 0.75rem !important;
    font-weight: 600 !important;
}

.file-item {
    background-color: var(--bs-gray-100) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    width: 100%;
}

.file-item .file-info {
    flex-grow: 1;
    display: block !important;
}

.file-item .file-name {
    font-weight: 500 !important;
    margin-bottom: 0.25rem;
    color: var(--bs-dark) !important;
    display: block !important;
}

.file-item .file-size {
    font-size: 0.875rem !important;
    color: var(--bs-secondary) !important;
    display: block !important;
}

.file-item .remove-file {
    color: var(--bs-danger);
    cursor: pointer;
    padding: 0.25rem;
}

.file-item .remove-file:hover {
    background-color: var(--bs-danger);
    color: white;
    border-radius: 50%;
}

/* Progress bar enhancements */
.progress {
    background-color: var(--bs-gray-200);
}

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

/* Status badges */
.badge {
    font-size: 0.75em;
}

/* Table improvements */
.table th {
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: var(--bs-gray-50);
}

/* Card enhancements */
.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: var(--bs-gray-50);
    border-bottom: 1px solid var(--bs-border-color);
}

/* Statistics cards */
.stats-card {
    text-align: center;
    padding: 1.5rem;
}

.stats-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-card .number {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.stats-card .label {
    color: var(--bs-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Invoice detail styling */
.invoice-header {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    color: white;
    padding: 2rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.invoice-amount {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Line items table */
.line-items-table {
    font-size: 0.9rem;
}

.line-items-table th {
    background-color: var(--bs-gray-100);
    color: var(--bs-gray-800);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.line-items-table td {
    vertical-align: middle;
}

.line-items-table .description {
    max-width: 300px;
    word-wrap: break-word;
}

/* Processing status */
.processing-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-pending { background-color: var(--bs-secondary); }
.status-processing { 
    background-color: var(--bs-warning);
    animation: pulse 1.5s infinite;
}
.status-completed { background-color: var(--bs-success); }
.status-failed { background-color: var(--bs-danger); }

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-area {
        min-height: 150px;
        padding: 1rem;
    }
    
    .invoice-amount {
        font-size: 2rem;
    }
    
    .stats-card .number {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Dark theme adjustments */
[data-bs-theme="dark"] {
    --upload-area-bg: hsl(210 11% 15%);
    --upload-area-border: hsl(210 11% 25%);
    --upload-area-hover: hsl(210 20% 20%);
    --upload-area-active: hsl(210 30% 25%);
}

[data-bs-theme="dark"] .upload-area {
    background-color: var(--upload-area-bg);
    border-color: var(--upload-area-border);
}

[data-bs-theme="dark"] .file-item {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-gray-700) !important;
}

[data-bs-theme="dark"] .file-item .file-name {
    color: var(--bs-light) !important;
}

[data-bs-theme="dark"] .file-item .file-size {
    color: var(--bs-gray-400) !important;
}

[data-bs-theme="dark"] #fileList {
    background: var(--bs-gray-800) !important;
    border-color: var(--bs-gray-600) !important;
}

[data-bs-theme="dark"] #fileList h6 {
    color: var(--bs-light) !important;
}



[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: var(--bs-gray-800);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

[data-bs-theme="dark"] .loading::after {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-dashed {
    border-style: dashed !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Animation for new elements */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Custom scrollbar for webkit browsers */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bs-gray-100);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] .custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}


