/* ROCXtract Custom Styles */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Feature Icons */
.feature-icon {
    width: 64px;
    height: 64px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background-color: var(--light-color);
}

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

.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: var(--border-radius);
    background-color: var(--light-color);
}

.progress-bar {
    border-radius: var(--border-radius);
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dark-color);
}

.table td {
    vertical-align: middle;
    font-size: 0.95rem;
}

.result-row {
    transition: background-color 0.15s ease-in-out;
}

.result-row:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.result-row.table-active {
    background-color: rgba(13, 110, 253, 0.2) !important;
    font-weight: 500;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.8em;
    border-radius: calc(var(--border-radius) / 2);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* PDF Container */
#pdfContainer {
    border-radius: var(--border-radius);
    background: var(--light-color);
}

#pdfContainer canvas {
  width: auto;
  max-width: none;
  height: auto;
  transform-origin: 0 0;
}

/* Statistics */
.stat-item {
    padding: 1rem;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-item small {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
        margin-bottom: 0.25rem;
    }
    
    #pdfContainer {
        height: 400px !important;
    }
    
    .table-responsive {
        height: 400px !important;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-item h3 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* File Upload Drag & Drop */
.form-control:hover {
    border-color: var(--primary-color);
    transition: border-color 0.15s ease-in-out;
}

/* Utility Classes */
.text-decoration-none:hover {
    text-decoration: none !important;
}

.cursor-pointer {
    cursor: pointer;
}

.font-monospace {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Custom Scrollbars */
.table-responsive::-webkit-scrollbar,
#pdfContainer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track,
#pdfContainer::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.table-responsive::-webkit-scrollbar-thumb,
#pdfContainer::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: var(--border-radius);
}

.table-responsive::-webkit-scrollbar-thumb:hover,
#pdfContainer::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Print Styles */
@media print {
    .btn, .navbar, .modal, .card-header {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table {
        font-size: 12px;
    }
}

#pdfContainer { cursor: grab; }
#pdfContainer:active { cursor: grabbing; }

/* when #previewRow has .expanded:
   - hide the pdf pane
   - make the extract pane full-width */
#previewRow.expanded #pdfPane {
  display: none !important;
}
#previewRow.expanded #extractPane {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}
 /* ensure extracted-tables column always sits above any overlays */
  #extractPane {
    position: relative;
    z-index: 20;
  }
