/* ===================================
   Research Queue Specific Styles
   Only affects ResearchQueue pages
   =================================== */

/* Base Popup Styles - Research Queue Only */
#approveAllPopup,
#denyAllPopup,
#moreInfoPopup {
    background: white;
    border: 1px solid #999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
}

#approveAllPopup .content,
#denyAllPopup .content,
#moreInfoPopup .content {
    border:  solid #334bff;
}

#approveAllPopup .buttons,
#denyAllPopup .buttons,
#moreInfoPopup .buttons {
    text-align: right;
    padding: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

#approveAllPopup .buttons .button,
#denyAllPopup .buttons .button,
#moreInfoPopup .buttons .button {
    margin-left: 5px;
}

/* Approve All Popup Specific */
#approveAllPopup {
    min-width: 300px;
}

#approveAllPopup .productGroupName {
    display: block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#approveAllPopup .chboxApproveProductGroup {
    cursor: pointer;
    width: 15px;
    height: 15px;
}

/* Deny/More Info Popup Specific */
#denyAllPopup,
#moreInfoPopup {
    min-width: 290px;
}

#denyAllPopup .margin-top-5px,
#moreInfoPopup .margin-top-5px {
    margin-top: 5px;
}

#denyAllPopup label,
#moreInfoPopup label {
    cursor: pointer;
    font-weight: normal;
}

#denyAllPopup input[type="radio"],
#moreInfoPopup input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
}

/* Submit Dialog - Research Queue Only */
#submitDialog {
    display: none;
}

#submitDialog .modalPopup {
    background: white;
}

#submitDialog .header-wrap {
/*    background: #f5f5f5;
    border-bottom: 1px solid #ddd;*/
    margin: 0;
    padding: 0;
}

#submitDialog .header-title {
    padding: 10px 15px;
    font-size: 16px;
    /*font-weight: bold;*/
    text-transform: uppercase;
}

#submitDialog .content-wrap {
    padding: 0;
    margin: 0;
}

#submitDialog .leftBorder,
#submitDialog .rightBorder {
    padding: 0;
    margin: 0;
}

#submitDialog .content {
    padding: 15px;
}

#submitDialog .mvc-modal-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 15px;
}

#submitDialog .mvc-modal-content table {
    min-width: 800px;
}

#submitDialog .mvc-modal-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#submitDialog .mvc-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#submitDialog .mvc-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#submitDialog .mvc-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#submitDialog table.data {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

#submitDialog table.data th {
    background: #f5f5f5;
    padding: 4px;
    border: 1px solid #ddd;
    font-weight: bold;
    text-align: center;
    font-size: 12px;
    vertical-align: top;
    white-space: nowrap;
}

#submitDialog table.data td {
    padding: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Column widths for proper alignment */
#submitDialog table.data th:nth-child(1),
#submitDialog table.data td:nth-child(1) {
    width: 15%;
    min-width: 120px;
}

#submitDialog table.data th:nth-child(2),
#submitDialog table.data td:nth-child(2) {
    width: auto;
    min-width: 200px;
}

#submitDialog table.data th:nth-child(3),
#submitDialog table.data td:nth-child(3) {
    width: 15%;
    min-width: 150px;
}

#submitDialog table.data th:nth-child(4),
#submitDialog table.data td:nth-child(4) {
    width: 20%;
    min-width: 200px;
}

#submitDialog .align-center {
    text-align: center;
}

/* Apply to All Rows - Research Queue Only */
#submitDialog .apply-to-all-row {
    /*background-color: #e3f2fd !important;*/
    background-color: #DFE9FF !important;
    font-weight: bold;
}

#submitDialog .apply-to-all-row td {
    /*background-color: #e3f2fd !important;*/
    background-color: #DFE9FF !important;
}

#submitDialog .highlight-blue {
    background-color: #e3f2fd;
}

/* Form Controls in Submit Dialog */
#submitDialog .form-control {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
}

#submitDialog textarea.form-control {
    height: 25px;
    min-height: 25px;
    max-height: 120px;
    resize: vertical;
    overflow-y: auto;
}

#submitDialog select.form-control {
    height: 30px;
}

#submitDialog .reason-dropdown {
    min-width: 150px;
}

#submitDialog .comments-textarea {
    min-width: 200px;
}

/* Response column with multiple doc groups */
#submitDialog table.data td:nth-child(2) {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Validation Styles - Research Queue Only */
#submitDialog .required-star {
    color: red;
    font-weight: bold;
    margin-left: 3px;
}

#submitDialog input.form-control[style*="border: 2px solid red"],
#submitDialog select.form-control[style*="border: 2px solid red"],
#submitDialog textarea.form-control[style*="border: 2px solid red"] {
    border-color: red !important;
}

/* Checkbox Styles - Research Queue Specific */
.entitlement-details input[type="checkbox"].chboxIsUserChecked,
.entitlement-details input[type="checkbox"].chboxDenyRequest,
.entitlement-details input[type="checkbox"].chboxMoreInfo,
.entitlement-details input[type="checkbox"].chboxDocGroup,
.entitlement-details input[type="checkbox"].parentDenyRequest,
.entitlement-details input[type="checkbox"].parentDocGroup,
#submitDialog input[type="checkbox"].docgroup-summary-checkbox,
#submitDialog input[type="checkbox"].apply-to-all-docgroup {
    cursor: pointer;
    width: 15px;
    height: 15px;
}

/* Submit Button States - Research Queue Only */
.entitlement .btn[data-group-key].action-enabled {
    opacity: 1;
    cursor: pointer;
}

.entitlement .btn[data-group-key].action-disabled,
.entitlement .btn[data-group-key].mvc-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dialog Buttons - Research Queue */
#submitDialog .buttons {
    text-align: right;
    padding: 10px 0;
    margin-top: 10px;
}

#submitDialog .buttons .button {
    margin-left: 5px;
}

/* Nowrap utility - Research Queue */
.entitlement-details .nowrap {
    white-space: nowrap;
}

/* Dialog overlay - Research Queue specific z-index */
.ui-dialog[aria-describedby="submitDialog"] {
    z-index: 1001 !important;
}

.ui-widget-overlay {
    z-index: 1000 !important;
    background: rgba(0, 0, 0, 0.5);
}

/* Table alignment - Research Queue */
#submitDialog table.data .align-center {
    text-align: center;
    vertical-align: middle;
}

/* Popup table styles */
#approveAllPopup table.data,
#denyAllPopup table.data,
#moreInfoPopup table.data {
    width: 100%;
    border-collapse: collapse;
}

#approveAllPopup table.data th,
#denyAllPopup table.data th,
#moreInfoPopup table.data th {
    background: #f5f5f5;
    padding: 8px;
    border: 1px solid #ddd;
    font-weight: bold;
    text-align: left;
}

#approveAllPopup table.data td,
#denyAllPopup table.data td,
#moreInfoPopup table.data td {
    /*padding: 8px;
    border: 1px solid #ddd;*/
    vertical-align: middle;
}

/* Apply to All checkbox alignment */
#submitDialog .apply-to-all-docgroup {
    display: inline-block;
    vertical-align: middle;
}

/* Responsive adjustments for submit dialog */
@media screen and (max-width: 1200px) {
    #submitDialog {
        width: 95% !important;
        max-width: 95% !important;
    }
    
    #submitDialog .mvc-modal-content {
        overflow-x: auto;
    }
}

/* Hover effects for popups */
#approveAllPopup tr:hover,
#denyAllPopup tr:hover,
#moreInfoPopup tr:hover {
    background-color: #f9f9f9;
}

/* Selected row highlighting in submit dialog */
#submitDialog table.data tr:hover:not(.apply-to-all-row) {
    background-color: #f9f9f9;
}

/* Disabled state for checkboxes */
.entitlement-details input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading state (if needed) */
#submitDialog.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error message styling in dialogs */
#submitDialog .error-message {
    color: red;
    font-weight: bold;
    padding: 10px;
    margin: 10px 0;
    background-color: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 3px;
}

/* Success message styling in dialogs */
#submitDialog .success-message {
    color: green;
    font-weight: bold;
    padding: 10px;
    margin: 10px 0;
    background-color: #e8f5e9;
    border: 1px solid #66bb6a;
    border-radius: 3px;
}

/* ===================================
   Row Highlighting for User Selection
   Color-coded by action type:
   - Approve: Light green (#eef9e3)
   - Deny: Light red (#ffe6e6)
   - Request More Info: Light blue (#e3f2fd)
   =================================== */

/* Approve highlighting (green) - spans both left and right tables */
.entitlement-details tr.row-selected-approve {
    background-color: #eef9e3 !important;
}

.entitlement-details tr.row-selected-approve td {
    background-color: #eef9e3 !important;
}

/* Deny highlighting (red) - spans both left and right tables */
.entitlement-details tr.row-selected-deny {
    background-color: #ffe6e6 !important;
}

.entitlement-details tr.row-selected-deny td {
    background-color: #ffe6e6 !important;
}

/* Request More Info highlighting (blue) - spans both left and right tables */
.entitlement-details tr.row-selected-moreinfo {
    background-color: #e3f2fd !important;
}

.entitlement-details tr.row-selected-moreinfo td {
    background-color: #e3f2fd !important;
}

/* Override alternating row colors when highlighted - all action types */
.entitlement-details tr.alternate.row-selected-approve,
.entitlement-details tr.alternate.row-selected-approve td {
    background-color: #eef9e3 !important;
}

.entitlement-details tr.alternate.row-selected-deny,
.entitlement-details tr.alternate.row-selected-deny td {
    background-color: #ffe6e6 !important;
}

.entitlement-details tr.alternate.row-selected-moreinfo,
.entitlement-details tr.alternate.row-selected-moreinfo td {
    background-color: #e3f2fd !important;
}

/* Ensure hover doesn't override selection highlight - all action types */
.entitlement-details tr.row-selected-approve:hover,
.entitlement-details tr.row-selected-approve:hover td {
    background-color: #eef9e3 !important;
}

.entitlement-details tr.row-selected-deny:hover,
.entitlement-details tr.row-selected-deny:hover td {
    background-color: #ffe6e6 !important;
}

.entitlement-details tr.row-selected-moreinfo:hover,
.entitlement-details tr.row-selected-moreinfo:hover td {
    background-color: #e3f2fd !important;
}

/* Maintain visibility of text on highlighted rows */
.entitlement-details tr.row-selected-approve,
.entitlement-details tr.row-selected-deny,
.entitlement-details tr.row-selected-moreinfo {
    color: #000;
}

/* Ensure checkboxes remain visible on highlighted rows */
.entitlement-details tr.row-selected-approve input[type="checkbox"],
.entitlement-details tr.row-selected-deny input[type="checkbox"],
.entitlement-details tr.row-selected-moreinfo input[type="checkbox"] {
    opacity: 1;
}

/* Special handling for pending/existing highlights with approve action */
.entitlement-details tr.highlight-green-light.row-selected-approve,
.entitlement-details tr.highlight-green-light.row-selected-approve td {
    background-color: #eef9e3 !important;
}
