/**
 * Billing Review Tab Styles
 */

/* Container */
#billing-review-container {
    padding: 20px;
    background: #f8f9fa;
}

/* Header */
.billing-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.billing-review-header h3 {
    margin: 0;
    color: #333;
}

.billing-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Billing Sections */
.billing-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.billing-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.billing-section h4 i {
    margin-right: 8px;
    color: #007bff;
}

/* Finalized state */
.billing-review-content.finalized {
    opacity: 0.9;
}

.billing-review-content.finalized .billing-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Diagnosis List */
#diagnosis-list {
    max-height: 400px;
    overflow-y: auto;
}

.diagnosis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    transition: all 0.2s;
}

.diagnosis-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.diagnosis-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.diagnosis-code {
    font-weight: bold;
    color: #007bff;
    font-family: 'Courier New', monospace;
    min-width: 80px;
}

.diagnosis-description {
    flex: 1;
    color: #495057;
}

.diagnosis-actions {
    display: flex;
    gap: 5px;
}

.diagnosis-actions .btn {
    padding: 2px 8px;
}

/* Procedures List */
#procedures-list {
    max-height: 400px;
    overflow-y: auto;
}

.procedure-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    transition: all 0.2s;
}

.procedure-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.procedure-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.procedure-code {
    font-weight: bold;
    color: #28a745;
    font-family: 'Courier New', monospace;
}

.procedure-description {
    color: #495057;
}

.procedure-charge {
    color: #6c757d;
    font-weight: 600;
}

.procedure-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-input {
    width: 60px;
    text-align: center;
}

/* Billing Summary */
.billing-summary table {
    margin-bottom: 0;
}

.billing-summary table tr:last-child {
    font-size: 1.1rem;
    border-top: 2px solid #dee2e6;
}

/* Action Buttons */
.billing-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.billing-actions .btn {
    min-width: 150px;
}

/* Search Results */
.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    background: #fff;
}

.search-result-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result-item.selected {
    background: #007bff;
    color: white;
}

.search-result-item.selected .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

/* Badges */
.badge {
    padding: 4px 8px;
    font-size: 0.85rem;
}

.badge-primary {
    background-color: #007bff;
}

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

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
}

/* Form Controls */
.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.form-control:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .billing-review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .billing-actions {
        flex-direction: column;
    }
    
    .billing-actions .btn {
        width: 100%;
    }
    
    .diagnosis-item,
    .procedure-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .diagnosis-actions,
    .procedure-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Loading State */
.billing-review-loading {
    text-align: center;
    padding: 40px;
}

.billing-review-loading i {
    font-size: 2rem;
    color: #007bff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.billing-review-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* Empty State */
.text-muted {
    color: #6c757d !important;
}

/* Modal Customization */
.modal-lg {
    max-width: 800px;
}

.modal-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
}

/* Utility Classes */
.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.text-right {
    text-align: right;
}

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

.small {
    font-size: 0.875rem;
}

/* Modal Z-Index Fixes */
.modal {
    z-index: 10500 !important;
}

.modal-backdrop {
    z-index: 10400 !important;
}

.modal-dialog {
    z-index: 10501 !important;
}

/* Ensure modal content is clickable */
.modal-content {
    position: relative;
    z-index: 10502 !important;
    pointer-events: auto;
}

/* Ensure modal body is scrollable */
.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}
