/* ==========================================================================
   OT Reports-specific styles for "OT Approval" view
   This file contains all necessary styles for the table, filters, modals,
   and feedback elements.
   ========================================================================== */

/* --- Containers & General Layout --- */
.table-container {
    margin: 20px 0;
    width: 100%;
    overflow-x: auto;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #ccc;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.error {
    text-align: center;
    padding: 15px;
    color: #dc3545;
    font-size: 0.95em;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}


/* --- Report Table Styling --- */
.report-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    table-layout: fixed;
}

.report-table th,
.report-table td {
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    word-break: break-word;
}

/* New style for the "no data" message inside a table row */
.report-table td.no-data-row {
    padding: 40px 20px;
    font-size: 1em;
    color: #ccc;
    text-align: center;
}

.report-table th:nth-child(1),
.report-table td:nth-child(1) {
    width: 4%;
}

/* # */
.report-table th:nth-child(2),
.report-table td:nth-child(2) {
    width: 10%;
}

/* Date */
.report-table th:nth-child(3),
.report-table td:nth-child(3) {
    width: 6%;
}

/* Emp No */
.report-table th:nth-child(4),
.report-table td:nth-child(4) {
    width: 12%;
    text-align: left;
}

/* Employee Name */
.report-table th:nth-child(5),
.report-table td:nth-child(5) {
    width: 10%;
}

/* Section */
.report-table th:nth-child(6),
.report-table td:nth-child(6) {
    width: 12%;
}

/* Reason */
.report-table th:nth-child(7),
.report-table td:nth-child(7) {
    width: 5%;
}

/* OT (Hrs) */
.report-table th:nth-child(8),
.report-table td:nth-child(8) {
    width: 12%;
    text-align: left;
}

/* Requested By */
.report-table th:nth-child(9),
.report-table td:nth-child(9) {
    width: auto;
    min-width: 150px;
    text-align: left;
}

/* Description */
.report-table th:nth-child(10),
.report-table td:nth-child(10) {
    width: 8%;
}

/* Status */
.report-table th:nth-child(11),
.report-table td:nth-child(11) {
    width: 8%;
}

/* Action */

.report-table th:nth-child(9),
.report-table td:nth-child(9) {
    font-size: 60%;
}

.report-table td:nth-child(1) {
    font-size: 80%;
}

.report-table td.allow-wrap {
    white-space: normal;
}

.report-table th {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-header);
    font-weight: 600;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.report-table th:hover {
    background: rgba(255, 255, 255, 0.15);
}

.report-table tr:hover {
    background: rgba(0, 198, 255, 0.1);
    transition: background 0.2s ease;
}

/* Status Colors */
.report-table td.status-pending {
    color: #ffc107;
}

.report-table td.status-approved {
    color: #28a745;
}

.report-table td.status-validated {
    color: #17a2b8;
}

.report-table td.status-rejected {
    color: #dc3545;
}


/* --- Filter & Search Section --- */
.filter-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.filter-container h4 {
    margin: 0 0 15px 0;
    color: #00c6ff;
    font-weight: 500;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.filter-container h4 .fas {
    margin-right: 8px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.filter-row.secondary-actions {
    justify-content: space-between;
    align-items: center;
}

.filter-row .form-group {
    flex: 1 1 180px;
    min-width: 180px;
}

.filter-row .form-group.employee-group {
    flex: 2 1 250px;
    min-width: 250px;
}

.filter-row .form-group.full-width {
    flex: 1 1 100%;
}

.filter-row .form-group.search-group {
    flex: 1 1 40%;
    max-width: 600px;
}

.filter-form label {
    display: block;
    font-size: 0.9em;
    font-weight: 500;
    color: #b0c0d0;
    margin-bottom: 5px;
}

.filter-form input,
.filter-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: #2c5364 !important;
    color: #e0f0ff !important;
    font-size: 0.9em;
    font-family: 'Poppins', sans-serif;
}

.filter-form input[type="date"] {
    color-scheme: dark;
    padding: 6.5px 8px;
}

.filter-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.8);
    cursor: pointer;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
}

.filter-buttons .clear-btn {
    background-color: #6c757d;
    color: #fff;
}

.filter-buttons .clear-btn:hover {
    background-color: #5a6268;
}

.filter-buttons .export-excel-btn {
    background-color: #218838;
    color: #fff;
}

.filter-buttons .export-excel-btn:hover {
    background-color: #1e7e34;
}

.filter-buttons .export-pdf-btn {
    background-color: #c82333;
    color: #fff;
}

.filter-buttons .export-pdf-btn:hover {
    background-color: #b21f2d;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    min-width: fit-content !important;
    margin-right: 15px;
}

.radio-group input[type="radio"] {
    width: auto;
    accent-color: #00c6ff;
    cursor: pointer;
}

.radio-group label {
    margin-bottom: 0;
    font-weight: 400;
    color: #e0f0ff;
    cursor: pointer;
}


/* --- UI Feedback Elements --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #00c6ff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.toast-notification {
    visibility: hidden;
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    z-index: 10000;
    font-size: 1em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: visibility 0.5s, opacity 0.5s, transform 0.5s;
    transform: translateX(100%);
}

.toast-notification.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

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

.toast-notification.error {
    background-color: #dc3545;
}


/* --- CUSTOM EXPANDABLE DROPDOWN --- */
.custom-dropdown-container {
    position: relative;
    width: 100%;
}

.custom-dropdown-display {
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: #2c5364;
    color: #e0f0ff;
    font-size: 0.9em;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    box-sizing: border-box;
}

.custom-dropdown-display::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    font-size: 0.8em;
}

.custom-dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: #203A43;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 6px 6px;
    margin-top: 2px;
    z-index: 1050;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.custom-dropdown-panel.show {
    display: block;
}

.custom-dropdown-panel ul {
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.custom-dropdown-panel li {
    padding: 8px 12px;
    color: #e0f0ff;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-panel li.disabled {
    color: #8090a0;
    cursor: default;
    font-weight: 500;
}

.custom-dropdown-panel li:not(.disabled):hover {
    background-color: rgba(0, 198, 255, 0.1);
}

/* --- Action Staging Buttons in Table --- */
.action-cell {
    text-align: center;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.stage-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4em;
    transition: transform 0.2s ease, color 0.2s;
    padding: 0 5px;
}

.stage-btn:hover {
    transform: scale(1.2);
}

/* Default state: both buttons are semi-transparent (greyed out) */
.stage-btn.stage-approve {
    color: rgba(40, 167, 69, 0.4);
}

.stage-btn.stage-reject {
    color: rgba(220, 53, 69, 0.4);
}

/* When staged for approval: make approve icon bright green */
.action-buttons.staged-approve .stage-approve {
    color: #28a745;
}

/* When staged for rejection: make reject icon bright red */
.action-buttons.staged-reject .stage-reject {
    color: #dc3545;
}

/* On hover, always show the bright color */
.stage-btn.stage-approve:hover {
    color: #28a745;
}

.stage-btn.stage-reject:hover {
    color: #dc3545;
}


/* --- Action Staging Panel (Compact Floating View) --- */
.action-staging-panel {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: auto;
    background: #1a2a33;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border-top: 2px solid #00c6ff;
    border-radius: 10px;
    z-index: 2000;
    transform: translateY(calc(100% + 30px));
    transition: transform 0.4s ease-in-out;
    padding: 10px 15px;
}

.action-staging-panel.visible {
    transform: translateY(0);
}

.action-staging-panel .panel-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-summary {
    display: flex;
    gap: 15px;
    color: #e0f0ff;
    font-size: 0.9em;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    border-radius: 5px;
}

.summary-item.approve-summary .fa-check-circle {
    color: #28a745;
}

.summary-item.reject-summary .fa-times-circle {
    color: #dc3545;
}

.summary-item strong {
    font-size: 1.1em;
    font-weight: 600;
}

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

.panel-actions form {
    margin: 0;
    padding: 0;
}

.process-btn {
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: 500;
    background: linear-gradient(90deg, #1D976C, #93F9B9);
    color: #111;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 151, 108, 0.4);
}

.process-btn:disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.clear-all-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.clear-all-btn:hover {
    background: #5a6268;
}