/* Custom Styles for Traccar Web */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Map Styles */
#map {
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Status Indicators */
.status-online {
    color: #10b981;
}

.status-offline {
    color: #ef4444;
}

.status-moving {
    color: #3b82f6;
}

.status-stopped {
    color: #f59e0b;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
    }
    
    #map {
        height: 400px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Add to your existing CSS */

/* Smooth transitions for number changes */
.number-transition {
    transition: all 0.5s ease-in-out;
}

/* Prevent layout shifts */
.layout-fixed {
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Loading spinner for refresh */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent unwanted focus changes during refresh */
.no-focus-outline:focus {
    outline: none;
}

/* Chart container with fixed dimensions */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}