/* ==========================================================================
   OT Reports-specific styles for "OT Validation" 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;
    /* Slightly more padding for readability */
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    /* Bump from 0.8 to 0.85 */
    word-break: break-word;
}

.report-table td.no-data-row {
    padding: 40px 20px;
    font-size: 1em;
    color: #ccc;
    text-align: center;
}

/* MODIFIED: Table column widths now match approve_ot_requests.css */
.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;
    /* MODIFIED: Changed from 'center' to 'end' for better alignment */
}

.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;
}


/* --- General Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-header {
    background: linear-gradient(90deg, #0072ff, #00c6ff);
    color: #fff;
    padding: 15px 25px;
    font-size: 1.3em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header .fas {
    margin-right: 10px;
}

.modal-header .close {
    font-size: 1.5rem;
    color: #fff;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 0;
    background: none;
    border: none;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
}


/* --- Edit Modal (#editModal) Specifics --- */
#editModal .modal-content {
    width: 100%;
    max-width: 800px;
    background: #203A43;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    color: #e0f0ff;
    overflow: hidden;
}

#editModal .form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: end;
}

#editModal .form-grid .form-group {
    display: flex;
    flex-direction: column;
}

#editModal .form-grid .grid-col-span-2 {
    grid-column: span 2;
}

#editModal .form-grid .grid-col-span-4 {
    grid-column: span 4;
}

#editModal .form-group label {
    margin-bottom: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: #b0c0d0;
}

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

#editModal .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

#editModal input[type="date"] {
    color-scheme: dark;
}

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

#editModal .modal-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 25px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#editModal .modal-footer button {
    padding: 8px 20px;
    font-size: 0.95em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#editModal .modal-footer .save-button {
    background: linear-gradient(90deg, #0072ff, #00c6ff);
    color: #fff;
}

#editModal .modal-footer .save-button:hover {
    box-shadow: 0 0 10px rgba(0, 198, 255, 0.6);
}

#editModal .modal-footer .cancel-button {
    background: #6c757d;
    color: #fff;
}

#editModal .modal-footer .cancel-button:hover {
    background: #5a6268;
}

/* --- STYLES FOR VALIDATION PAGE --- */
.manage-button {
    background-color: #6c757d;
    color: #fff;
    padding: 6px 14px;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.manage-button:hover {
    background-color: #5a6268;
}

#actionModal .modal-content {
    width: 100%;
    max-width: 450px;
    background: #203A43;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    color: #e0f0ff;
    overflow: hidden;
}

#actionModal .modal-body p {
    margin: 0;
    font-size: 1.1em;
    text-align: center;
}

#actionModal .modal-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

#actionModal .modal-footer button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex: 1;
    justify-content: center;
}

#actionModal .modal-footer .validate-button {
    background: #28a745;
    color: white;
}

#actionModal .modal-footer .validate-button:hover {
    background: #218838;
}

#actionModal .modal-footer .reject-button {
    background: #dc3545;
    color: white;
}

#actionModal .modal-footer .reject-button:hover {
    background: #c82333;
}

#actionModal .modal-footer .edit-button {
    background: #007bff;
    color: white;
}

#actionModal .modal-footer .edit-button:hover {
    background: #0069d9;
}


/* --- 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);
}