/* Modal dialog styling */

/* Custom Alert Modal */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.custom-alert-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.custom-alert-content {
    padding: 30px;
    text-align: center;
}

.custom-alert-message {
    font-size: 18px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 25px;
    font-weight: 500;
}

.custom-alert-button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 80px;
}

.custom-alert-button:hover {
    background: #1976D2;
}

.custom-alert-button:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.custom-confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.custom-confirm-cancel {
    background: #6c757d;
}

.custom-confirm-cancel:hover {
    background: #5a6268;
}

.custom-confirm-ok {
    background: #2196F3;
}

.custom-confirm-ok:hover {
    background: #1976D2;
}

/* Garnishment Modal Styles */
.garnishment-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.garnishment-modal-content {
    padding: 0;
}

.garnishment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.garnishment-modal-header h3 {
    margin: 0;
    color: #495057;
}

.garnishment-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.garnishment-modal-close:hover {
    color: #495057;
}

.garnishment-form {
    padding: 0 20px 20px 20px;
}

.garnishment-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Tax Rate Modal Styles */
.tax-rate-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.tax-rate-modal-content {
    padding: 0;
}

.tax-rate-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.tax-rate-modal-header h3 {
    margin: 0;
    color: #495057;
}

.tax-rate-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tax-rate-modal-close:hover {
    color: #495057;
}

.tax-rate-form {
    padding: 0 20px 20px 20px;
}

.tax-rate-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Tax Rate History Styles */
.tax-rate-history {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.tax-rate-history h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.tax-rate-history-item {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.tax-rate-history-item:last-child {
    border-bottom: none;
}

.tax-rate-version {
    font-weight: 600;
    color: #007bff;
}

/* Post-Save Modal Styles */
.post-save-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.post-save-modal-content {
    padding: 0;
}

.post-save-modal-header {
    background: #2196F3;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    text-align: center;
}

.post-save-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.post-save-modal-body {
    padding: 20px;
}

.post-save-modal-body p {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.post-save-options {
    margin-bottom: 20px;
}

.post-save-option {
    margin-bottom: 15px;
}

.post-save-modal-buttons {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
    justify-content: space-between;
}

.post-save-modal-buttons .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.post-save-modal-buttons .btn-secondary:hover {
    background: #5a6268;
}

.post-save-modal-buttons .btn-primary {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.post-save-modal-buttons .btn-primary:hover {
    background: #1976D2;
}

/* Grid tooltip */
.grid-tooltip {
    display: none;
    position: fixed;
    background: rgba(33, 150, 243, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 280px;
    text-align: center;
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
}

.grid-tooltip.show {
    display: block;
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
    .garnishment-modal,
    .tax-rate-modal {
        width: 95%;
        margin: 20px;
    }
    
    .post-save-modal-buttons {
        flex-direction: column;
    }
    
    .post-save-modal-buttons button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Insurance Reports Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.insurance-reports-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #495057;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: #495057;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.insurance-reports-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.insurance-reports-table th,
.insurance-reports-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.insurance-reports-table th {
    background-color: #2196F3;
    color: white;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.insurance-reports-table tr:hover {
    background-color: #f9f9f9;
}

.insurance-reports-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.modal-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.modal-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #5a6268;
}

.modal-footer .btn-primary {
    background: #2196F3;
    color: white;
}

.modal-footer .btn-primary:hover {
    background: #1976D2;
}

@media (max-width: 768px) {
    .insurance-reports-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .insurance-reports-table th,
    .insurance-reports-table td {
        padding: 8px;
        font-size: 13px;
    }
}


/* Batch PDF Viewer Modal */
.batch-pdf-viewer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    max-width: 95vw;
    max-height: 95vh;
}

#pdf-viewer-area {
    background: #f5f5f5;
}

#pdf-viewer-area iframe {
    width: 100%;
    height: 100%;
}

#prev-btn:disabled,
#next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .batch-pdf-viewer-modal {
        width: 95vw;
        height: 95vh;
    }
}
