/* ==========================================================================
   OT Reports-specific styles for "OT View" view
   This file contains all necessary styles for the table, filters,
   and feedback elements. (Adapted from validate_ot_requests.css)
   ========================================================================== */

/* --- 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: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    word-break: break-word;
}

/* Column Widths */
.report-table th:nth-child(1),
.report-table td:nth-child(1) {
    width: 70px;
}

/* Serial No */
.report-table th:nth-child(2),
.report-table td:nth-child(2) {
    width: 110px;
    white-space: nowrap;
}

/* Date */
.report-table th:nth-child(3),
.report-table td:nth-child(3) {
    width: 150px;
    white-space: nowrap;
}

/* Employee Name */
.report-table th:nth-child(4),
.report-table td:nth-child(4) {
    width: 150px;
    white-space: nowrap;
}

/* Requested By */
.report-table th:nth-child(5),
.report-table td:nth-child(5) {
    width: 150px;
}

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

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

/* OT Hours */
.report-table th:nth-child(8),
.report-table td:nth-child(8) {
    width: 120px;
    white-space: nowrap;
}

/* Status */
.report-table th:nth-child(9),
.report-table td:nth-child(9) {
    width: auto;
}

/* Description */

/* Helper class added by JavaScript for long names */
.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.even-row {
    background: rgba(255, 255, 255, 0.05);
}

.report-table tr.odd-row {
    background: rgba(255, 255, 255, 0.03);
}

.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: 20px;
}

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

.filter-row.primary-filters {
    justify-content: flex-start;
}

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

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

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

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