/* Table Styles - Appending to style.css semantics or new file */

/* General overrides for light theme table look */
body {
    background: #fdfdfd !important;
    color: #333 !important;
    overflow-y: hidden;
    /* Hide body scroll, use app-container for scroll */
}

/* App Container */
.app-container {
    background: white !important;
    border: 1px solid #eee !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: none !important;
    max-width: 100% !important;
    margin: 1rem !important;
    height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    border-radius: 4px !important;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: white;
    z-index: 100;
    /* Much higher */
    position: relative;
    /* Ensure z-index applies */
}

.btn-black {
    background: black;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-black:hover {
    background: #333;
}

/* Device List */
.device-list {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 0;
    position: relative;
}

/* Table */
.vehicle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.vehicle-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.vehicle-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #111;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    background: white;
}

.vehicle-table th i {
    font-size: 0.8rem;
    color: #999;
    margin-left: 4px;
    cursor: pointer;
}

.vehicle-table td {
    padding: 1rem;
    border-bottom: 1px solid #f9f9f9;
    color: #333;
    vertical-align: middle;
}

.vehicle-table tr:hover {
    background: #fcfcfc;
}

/* Sticky Columns Logic */
.vehicle-table th:nth-child(1),
.vehicle-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 10;
    background: white;
    border-right: 1px solid #eee;
}

.vehicle-table th:nth-child(2),
.vehicle-table td:nth-child(2) {
    position: sticky;
    left: 45px;
    z-index: 10;
    background: white;
    border-right: 1px solid #eee;
    box-shadow: 2px 0 5px rgba(0,0,0,0.02);
}

/* Ensure the sticky header stays on top of sticky columns */
.vehicle-table thead th:nth-child(1),
.vehicle-table thead th:nth-child(2) {
    z-index: 20; 
    background: white;
}

/* Maintain background for sticky cells on hover */
.vehicle-table tr:hover td:nth-child(1),
.vehicle-table tr:hover td:nth-child(2) {
    background: #fcfcfc !important;
}

/* Status Icons */
.status-icon.active {
    color: #10b981;
}

.status-icon.inactive {
    color: #ef4444;
}

/* Expiry Indicators */
.expiry-indicator {
    display: inline-block !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    content: ' ';
    background-color: #ccc;
}

/* Colors */
.expiry-green {
    background-color: #10b981 !important;
}

.expiry-red {
    background-color: #ef4444 !important;
}

.expiry-yellow {
    background-color: #f59e0b !important;
}

/* Animations - 2 Second Interval */
.expiry-blue-blink {
    background-color: #3b82f6 !important;
    animation: blink-animation 2s infinite;
}

.expiry-blue {
    background-color: #3b82f6 !important;
}

.expiry-red-blink {
    background-color: #ef4444 !important;
    animation: blink-animation 1s infinite;
}

.expiry-yellow-blink-fast {
    background-color: #f59e0b !important;
    animation: blink-animation 1s infinite;
}

.expiry-yellow-blink {
    background-color: #f59e0b !important;
    animation: blink-animation 2s infinite;
}

@keyframes blink-animation {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Action Buttons */
.action-buttons-row {
    display: flex;
    gap: 8px;
}

.action-buttons-row button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    padding: 2px;
}

.action-buttons-row button:hover {
    color: black;
}

.device-card {
    display: none;
}