/* dvirDefects.cfm Custom Styles */

/* DVIR Defects Table Styling - Similar to approvals discrepancies table */
.dvir-defects-table .responsive-table {
    min-width: 1200px;
    font-size: 1rem;
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.dvir-defects-table .responsive-table th {
    background-color: #2c3e50;
    color: white;
    padding: 8px 18px 8px 4px;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.dvir-defects-table .responsive-table th:hover {
    background-color: #34495e;
}

.dvir-defects-table .responsive-table td {
    padding: 5px 3px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.78rem;
    white-space: nowrap;
}

.dvir-defects-table .responsive-table tbody tr:hover {
    background-color: #f5f5f5;
}

.dvir-defects-table .responsive-table a {
    color: #0066cc;
    text-decoration: none;
}

.dvir-defects-table .responsive-table a:hover {
    text-decoration: underline;
}

/* Desktop column widths for DVIR defects table */
@media (min-width: 769px) {
    .dvir-defects-table .responsive-table th:nth-child(1),
    .dvir-defects-table .responsive-table td:nth-child(1) { width: 15%; min-width: 100px; }    /* Truck */
    .dvir-defects-table .responsive-table th:nth-child(2),
    .dvir-defects-table .responsive-table td:nth-child(2) { width: 25%; min-width: 150px; }  /* Site */
    .dvir-defects-table .responsive-table th:nth-child(3),
    .dvir-defects-table .responsive-table td:nth-child(3) { width: 15%; min-width: 100px; }    /* Total By Site */
    .dvir-defects-table .responsive-table th:nth-child(4),
    .dvir-defects-table .responsive-table td:nth-child(4) { width: 20%; min-width: 120px; }  /* Last DVIR Created */
    .dvir-defects-table .responsive-table th:nth-child(5),
    .dvir-defects-table .responsive-table td:nth-child(5) { width: 25%; min-width: 120px; }    /* Action column */
}

/* Tablet layout for DVIR defects table */
@media (max-width: 768px) and (min-width: 481px) {
    .dvir-defects-table .responsive-table {
        min-width: 900px;
        font-size: 0.9rem;
    }
}

/* Mobile card layout for DVIR defects table */
@media (max-width: 768px) {
    .dvir-defects-table .responsive-table td:nth-child(1):before { content: "Truck: "; }
    .dvir-defects-table .responsive-table td:nth-child(2):before { content: "Site: "; }
    .dvir-defects-table .responsive-table td:nth-child(3):before { content: "Total By Site: "; }
    .dvir-defects-table .responsive-table td:nth-child(4):before { content: "Last DVIR Created: "; }
    .dvir-defects-table .responsive-table td:nth-child(5):before { content: "Actions: "; }

    /* Hide DVIR defects table on mobile and show card layout instead */
    .table-container.dvir-defects-table {
        display: none !important;
    }
}

/* Action buttons in table */
.dvir-defects-table .responsive-table .btn-details {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.dvir-defects-table .responsive-table .btn-details:hover {
    background-color: #0052a3;
}
