/* Global 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;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.login-box h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #5568d3;
}

.login-info {
    margin-top: 30px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.login-info code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-header h1 {
    color: #333;
    font-size: 1.8em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    font-size: 20px;
    color: #4caf50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#status-text {
    color: #666;
    font-size: 14px;
}

.btn-logout {
    padding: 10px 20px;
    background: #f44336;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #d32f2f;
}

/* Notification Area */
.notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    border-left: 5px solid #ff5722;
}

.notification-content.speed-alert {
    animation: blink-red 1s infinite;
    border-left-color: #f44336;
}

@keyframes blink-red {
    0%, 100% {
        background: white;
        box-shadow: 0 5px 30px rgba(244, 67, 54, 0.3);
    }
    50% {
        background: #ffebee;
        box-shadow: 0 5px 30px rgba(244, 67, 54, 0.8);
    }
}

.notification-content h3 {
    color: #333;
    margin-bottom: 15px;
}

.close-notification {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close-notification:hover {
    color: #333;
}

.notification-details {
    font-size: 14px;
    color: #555;
}

.notification-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.notification-details .detail-label {
    font-weight: 600;
}

.notification-details .speed-high {
    color: #f44336;
    font-weight: bold;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filters-section h2 {
    color: #333;
    margin-bottom: 15px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.filter-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filter-group input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-warning {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
}

/* Statistics Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card.stat-alert {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-card.stat-alert .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.stat-card.stat-alert .stat-value {
    color: white;
}

/* Table Section */
.table-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.table-header h2 {
    color: #333;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
}

#data-table {
    width: 100%;
    border-collapse: collapse;
}

#data-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

#data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

#data-table th.sortable:hover {
    background: #e8e8e8;
}

.sort-icon {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

#data-table th.sorted-asc .sort-icon {
    color: #667eea;
}

#data-table th.sorted-desc .sort-icon {
    color: #667eea;
}

#data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #555;
}

#data-table tbody tr:hover {
    background: #f9f9f9;
}

.speed-over-30 {
    color: #f44336;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: #999;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-page {
    padding: 8px 15px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-page:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    padding: 8px 15px;
    font-weight: 600;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .notification-area {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

#damill-text {
    margin-left: 20px;
    font-size: 12px;
    color: #888;
    text-align: right;
}