/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Dashboard Container */
.dashboard {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

/* Stat Cards - สีขาวสะอาดตามรูป */
.stat-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* สีของ stat cards ตามรูป */
.stat-card.car {
    background: linear-gradient(135deg, #4285f4, #3367d6);
}

.stat-card.motorcycle {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.stat-card.truck {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.stat-card.people {
    background: linear-gradient(135deg, #00c853, #00a642);
}

/* Controls - พื้นหลังขาวใส */
.controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 0.85rem;
}

.control-group select,
.control-group input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: white;
    color: #374151;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

/* Data Table - พื้นหลังขาวสะอาด */
.data-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.table-header h3 {
    margin: 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.export-btn {
    background: linear-gradient(135deg, #00c853, #00a642);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.2);
}

.export-btn:hover {
    background: linear-gradient(135deg, #00a642, #00c853);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

/* Table - พื้นหลังขาวสะอาด */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #f8fafc;
}

th {
    padding: 12px 15px;
    text-align: left;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 12px 15px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.85rem;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Vehicle type badges - สีตามรูป */
.vehicle-type {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vehicle-type.car {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.vehicle-type.motorcycle {
    background-color: #fed7aa;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.vehicle-type.truck {
    background-color: #fecaca;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.vehicle-type.people {
    background-color: #bbf7d0;
    color: #059669;
    border: 1px solid #86efac;
}

/* Confidence badges - สีตามรูป */
.confidence {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.confidence.high {
    background-color: #bbf7d0;
    color: #059669;
    border: 1px solid #86efac;
}

.confidence.medium {
    background-color: #fed7aa;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.confidence.low {
    background-color: #fecaca;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

/* Pagination - พื้นหลังขาว */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
}

.pagination button {
    background: white;
    color: #4285f4;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background: #f3f4f6;
    border-color: #4285f4;
}

.pagination button:disabled {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .dashboard {
        padding: 20px;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .dashboard {
        padding: 15px;
    }
}