* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('https://images.unsplash.com/photo-1500937386664-56d1dfef3854?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #fff;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    background: linear-gradient(45deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    color: #e0e0e0;
    margin-top: 10px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.card h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    margin: 15px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.card:hover .value {
    transform: scale(1.05);
}

.unit {
    font-size: 1rem;
    color: #bbbbbb;
    margin-left: 5px;
}

.status {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: bold;
    margin-top: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status.detected {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status.clear {
    background: linear-gradient(45deg, #ff4757, #ff6b81);
    color: white;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    min-height: 350px;
}

.chart-card h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2196F3;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.map-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.map-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #FF9800;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

#map {
    height: 500px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #1a1a1a;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.leaflet-container {
    background: #2d2d2d !important;
}

.leaflet-popup-content {
    color: #333;
    font-size: 14px;
}

.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
}

.data-table {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.data-table h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #9C27B0;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 14px;
}

th, td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: #4CAF50;
    font-size: 1rem;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.status-icon {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    transition: transform 0.3s ease;
}

.status-available {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-unavailable {
    color: #ff4757;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

tr:hover .status-icon {
    transform: scale(1.2);
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.4rem;
    margin: 100px 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading small {
    display: block;
    margin-top: 15px;
    font-size: 1rem;
    opacity: 0.8;
    color: #bbbbbb;
}

.last-update {
    text-align: center;
    color: white;
    margin: 20px 0;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#update-time {
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

#no-gps-message {
    text-align: center;
    color: #ff6b6b;
    padding: 30px;
    font-size: 1.1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.card, .chart-card, .map-container, .data-table {
    animation: fadeIn 0.6s ease-out;
}

.value {
    animation: pulse 2s ease-in-out infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .value {
        font-size: 2rem;
    }
    
    #map {
        height: 300px;
    }
    
    .chart-card {
        padding: 15px;
        min-height: 250px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    .container {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .value {
        font-size: 1.8rem;
    }
    
    .status {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    #map {
        height: 250px;
    }
    
    .chart-card h3,
    .map-container h3,
    .data-table h3 {
        font-size: 1.2rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .card, .chart-card, .map-container, .data-table {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    #map {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid white;
    }
    
    .value {
        color: #000 !important;
        text-shadow: none !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card, .value, .status-icon {
        animation: none !important;
        transition: none !important;
    }
    
    .card::before {
        display: none;
    }
}

/* Controls section */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-weight: 600;
}

button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    display: none;
    animation: fadeIn 0.5s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
