/* JBMHH Reporting System Styles */

/* Tab Navigation */
.jbmhh-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.jbmhh-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.jbmhh-tab:hover {
    color: #333;
    background: #f5f5f5;
}

.jbmhh-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.jbmhh-tab-content {
    display: none;
}

/* File Upload Section */
.jbmhh-file-drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.jbmhh-file-drop-zone:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.jbmhh-file-drop-zone.drag-over {
    border-color: #2563eb;
    background: #dbeafe;
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.drop-zone-hint {
    font-size: 0.9rem;
    color: #718096;
}

/* Selected Files List */
#jbmhh-selected-files {
    margin-top: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-icon {
    font-size: 1.5rem;
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.file-size {
    color: #718096;
    font-size: 0.9rem;
}

.remove-file-btn {
    background: #fee;
    border: none;
    color: #c53030;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.remove-file-btn:hover {
    background: #fc8181;
    color: white;
}

/* Upload Button */
#jbmhh-upload-btn {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#jbmhh-upload-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#jbmhh-upload-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* Upload Progress */
#jbmhh-upload-progress {
    margin-top: 1.5rem;
}

.progress-item {
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.progress-filename {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #2563eb;
    transition: width 0.3s ease;
}

.progress-status {
    font-size: 0.9rem;
    color: #718096;
}

.progress-item.success .progress-fill {
    background: #10b981;
}

.progress-item.success .progress-status {
    color: #10b981;
}

.progress-item.error .progress-fill {
    background: #ef4444;
}

.progress-item.error .progress-status {
    color: #ef4444;
}

/* Report Status List */
.report-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.report-status-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.report-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #1a202c;
}

.report-date {
    margin: 0;
    font-size: 0.9rem;
    color: #718096;
}

.report-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending .status-badge {
    background: #fef3c7;
    color: #92400e;
}

.status-processing .status-badge {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed .status-badge {
    background: #d1fae5;
    color: #065f46;
}

.status-failed .status-badge {
    background: #fee2e2;
    color: #991b1b;
}

/* QC Review */
.qc-report-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.qc-report-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.qc-validation-summary {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
}

.validation-pass {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.validation-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.validation-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.validation-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.validation-warnings {
    color: #92400e;
    font-weight: 500;
}

.qc-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-preview,
.btn-approve,
.btn-reject,
.btn-download,
.btn-small {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-preview {
    background: #e2e8f0;
    color: #1a202c;
}

.btn-preview:hover {
    background: #cbd5e0;
}

.btn-approve {
    background: #10b981;
    color: white;
}

.btn-approve:hover {
    background: #059669;
}

.btn-reject {
    background: #ef4444;
    color: white;
}

.btn-reject:hover {
    background: #dc2626;
}

.btn-download,
.btn-small {
    background: #2563eb;
    color: white;
}

.btn-download:hover,
.btn-small:hover {
    background: #1d4ed8;
}

/* Download Section */
.report-date-group {
    margin-bottom: 1.5rem;
}

.report-date-header {
    font-size: 1.1rem;
    color: #1a202c;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
}

.report-date-header:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.report-date-header .toggle-icon {
    font-size: 0.8rem;
    color: #718096;
    transition: transform 0.3s ease;
}

.report-date-header.expanded .toggle-icon {
    transform: rotate(0deg);
}

.report-date-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.report-date-header .date-text {
    flex: 1;
    font-weight: 600;
}

.report-date-header .report-count {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 400;
}

.report-list {
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.download-report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.download-report-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.download-report-item .report-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-icon {
    font-size: 1.5rem;
}

.report-name {
    font-weight: 500;
}

/* Loading and Error States */
.loading,
.no-reports,
.error-message {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.error-message {
    color: #c53030;
}

.error-message button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Toast Notifications */
.toast {
    position: fixed;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #2563eb;
}

.toast-warning {
    background: #f59e0b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .jbmhh-tabs {
        flex-wrap: wrap;
    }
    
    .jbmhh-tab {
        flex: 1 1 auto;
        min-width: 120px;
    }
    
    .report-status-item,
    .download-report-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .qc-actions {
        flex-direction: column;
    }
    
    .qc-actions button {
        width: 100%;
    }
}

/* QC Validation Table */
.qc-breakdown {
    margin-top: 1rem;
    padding: 1rem;
}

.qc-breakdown ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.qc-breakdown li {
    padding: 0.25rem 0;
    text-transform: capitalize;
}

.qc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.qc-table th,
.qc-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.qc-table th {
    background: #f7fafc;
    font-weight: 600;
}

.qc-errors {
    margin-top: 1rem;
}

.validation-fail {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

/* Report generation actions */
.report-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Reports toolbar — Clear All and Expand/Collapse buttons */
.reports-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.reports-count {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.btn-expand-all,
.btn-collapse-all {
    padding: 0.4rem 1rem;
    background: #fff;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-expand-all:hover,
.btn-collapse-all:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}

.btn-clear-all {
    padding: 0.4rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear-all:hover {
    background: #fca5a5;
    color: #7f1d1d;
}

/* Individual delete button */
.btn-delete {
    padding: 0.4rem 0.6rem;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Download report item actions wrapper */
.download-report-item .report-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* File type badge */
.file-type-badge {
    padding: 0.15rem 0.5rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Info toast */
.toast-info {
    background: #2563eb;
}
