﻿/* Two Grid Layout - Main Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.grid-card {
    border-radius: 1.5rem;
    padding: 1.2rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

body.dark-mode .grid-card {
    background: rgba(18, 25, 45, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(66, 153, 225, 0.25);
}

body.light-mode .grid-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(44, 156, 212, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(66, 153, 225, 0.3);
}

.grid-title {
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-all {
    background: rgba(66, 153, 225, 0.3);
    color: #6bb5ff;
}

.badge-suspect {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* Table Styles */
.vehicle-table {
    width: 100%;
    font-size: 0.85rem;
}

    .vehicle-table thead th {
        padding: 0.7rem 0.5rem;
        font-weight: 600;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        position: sticky;
        top: 0;
        z-index: 1;
    }

body.dark-mode .vehicle-table thead th {
    background: rgba(0, 20, 40, 0.8);
    border-bottom: 2px solid #2c9cd4;
    color: #b9d0f0;
}

body.light-mode .vehicle-table thead th {
    background: rgba(44, 156, 212, 0.15);
    border-bottom: 2px solid #2c7cb6;
    color: #1a5276;
}

.vehicle-table tbody tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

body.dark-mode .vehicle-table tbody tr {
    border-bottom: 1px solid rgba(72, 120, 184, 0.2);
}

body.light-mode .vehicle-table tbody tr {
    border-bottom: 1px solid rgba(44, 156, 212, 0.15);
}

.vehicle-table tbody tr:hover {
    background: rgba(44, 156, 212, 0.1);
}

.vehicle-table tbody tr.suspect-alert-row {
    animation: suspectBlink 1s ease-in-out infinite;
}

body.dark-mode .vehicle-table tbody tr.suspect-alert-row {
    background: rgba(231, 76, 60, 0.28);
    border-bottom: 1px solid rgba(255, 120, 120, 0.55);
}

body.light-mode .vehicle-table tbody tr.suspect-alert-row {
    background: rgba(231, 76, 60, 0.16);
    border-bottom: 1px solid rgba(192, 57, 43, 0.38);
}

.vehicle-table tbody tr.suspect-alert-row td {
    font-size: 0.98rem;
    font-weight: 700;
}

.vehicle-table tbody tr.suspect-alert-row .status-suspect {
    background: rgba(192, 57, 43, 0.18);
    color: #fff;
}

@keyframes suspectBlink {
    0%, 100% {
        box-shadow: inset 0 0 0 0 rgba(231, 76, 60, 0.08);
        opacity: 1;
    }

    50% {
        box-shadow: inset 0 0 0 999px rgba(231, 76, 60, 0.14);
        opacity: 0.88;
    }
}

.vehicle-table td {
    padding: 0.7rem 0.5rem;
    vertical-align: middle;
}

body.light-mode .vehicle-table td {
    color: #2c3e50;
}

/* Status Badges */
.status-clear {
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

body.dark-mode .status-clear {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

body.light-mode .status-clear {
    background: rgba(46, 204, 113, 0.15);
    color: #1e8449;
}

.status-suspect {
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

body.dark-mode .status-suspect {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

body.light-mode .status-suspect {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

/* Table Container with Scroll */
.table-container {
    max-height: calc(100vh - 238px);
    overflow-y: auto;
    border-radius: 0.8rem;
}

    .table-container::-webkit-scrollbar {
        width: 5px;
    }

    .table-container::-webkit-scrollbar-track {
        background: rgba(66, 153, 225, 0.1);
        border-radius: 5px;
    }

    .table-container::-webkit-scrollbar-thumb {
        background: rgba(66, 153, 225, 0.4);
        border-radius: 5px;
    }

/* Empty State */
.empty-table {
    text-align: center;
    padding: 2rem;
    color: #8da3c0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-title {
        font-size: 1rem;
    }

    .vehicle-table thead th,
    .vehicle-table td {
        padding: 0.5rem 0.3rem;
        font-size: 0.7rem;
    }

    .grid-card {
        padding: 0.8rem;
    }
}
