/* ============================================================
   LOX DETAILS MODAL (Light + Dark Mode)
   ============================================================ */

#loxDetailsModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 2000;
}

/* Modal container */
.lox-modal-container {
    background: #ffffff;
    color: #2c3e50;
    border-radius: 10px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-sizing: border-box;
    padding-bottom: 20px;
}

/* Header */
.lox-modal-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.lox-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: inherit;
}

/* Close button */
.lox-modal-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section */
.lox-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.lox-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

/* Photos grid */
.lox-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.lox-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

/* ============================================================
   DARK MODE
   ============================================================ */

html.dark-mode #loxDetailsModal {
    background: rgba(0,0,0,0.75);
}

html.dark-mode .lox-modal-container {
    background: #1f1f1f;
    color: #e5e5e5;
}

html.dark-mode .lox-modal-header {
    background: #1f1f1f;
    border-bottom-color: #3a3a3a;
}

html.dark-mode .lox-modal-close {
    color: #bbbbbb;
}

html.dark-mode .lox-section {
    border-bottom-color: #3a3a3a;
}

html.dark-mode .lox-photo {
    border-color: #444;
}

.lox-table-header {
    background: #f3f4f6;
}

html.dark-mode .lox-table-header {
    background: #2d2d2d; /* or a matching dark shade */
}

/* ============================================================
   LOX SUBMISSIONS TABLE
   ============================================================ */

.lox-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; 
    min-width: 0;        
}

.lox-table th,
.lox-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lox-table tbody tr:last-child td {
    border-bottom: none;
}

/* Right-aligned PSI */
.lox-table th:last-child {
    text-align: right;
}

/* Center align numeric columns */
.lox-table th:nth-child(2),
.lox-table th:nth-child(3),
.lox-table th:nth-child(4),
.lox-table td:nth-child(2),
.lox-table td:nth-child(3),
.lox-table td:nth-child(4) {
    text-align: center;
}

/* Header background */
.lox-table-header {
    background: #f3f4f6;
    font-weight: 600;
}

html.dark-mode .lox-table-header {
    background: #2d2d2d;
    color: #e5e5e5;
}

html.dark-mode .lox-table th,
html.dark-mode .lox-table td {
    border-bottom-color: #3a3a3a;
}

/* ============================================================
   MOBILE OPTIMIZATION
   ============================================================ */

@media (max-width: 640px) {

    /* Shrink padding */
    .lox-table th,
    .lox-table td {
        padding: 6px 4px;
        font-size: 13px;
    }

    /* Allow header text to wrap if absolutely needed */
    .lox-table th {
        white-space: normal;
        line-height: 1.2;
    }

    /* Make Filled and PSI always visible */
    .lox-table th:nth-child(4),
    .lox-table td:nth-child(4),
    .lox-table th:nth-child(5),
    .lox-table td:nth-child(5) {
        width: 20%;
    }

    /* Asset # column shrinks nicely */
    .lox-table th:first-child,
    .lox-table td:first-child {
        width: 20%;
    }
}

/* ============================================================
   TWO-COLUMN LOX SECTIONS (Delivered / Removed)
   ============================================================ */

.lox-two-col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

.col-box {
    background: rgba(0,0,0,0.05);
    padding: 12px 15px;
    border-radius: 8px;
}

html.dark-mode .col-box {
    background: rgba(255,255,255,0.05);
}

.col-box h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}

.col-box p {
    margin: 0;
    white-space: pre-wrap;
}
