body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    margin: 0;
    padding: 10px;
    min-height: 100dvh;
    height: 100dvh;
    overflow-y: auto;
    box-sizing: border-box;
}

body {
    background: linear-gradient(120deg, #89f7fe 0%, #66a6ff 100%);
}

* {
    box-sizing: border-box;
}

html {
    height: 100dvh;
    overflow-y: auto;
}

.dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    
    height: 400px;
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: auto%;
    max-width: 600px; /* Set a reasonable maximum width for better responsiveness */
    margin-bottom: 20px;
}

.panel h2 {
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.location-title {
    font-size: 0.9em;
    color: #555;
    text-align: center;
    margin: 5px 0 10px 0;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.location-icon {
    font-size: 0.8em;
}

.weather-panel h2 {
    color: #27ae60;
    
}

.gauge-container {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;     /* Center vertically */
    margin: 20px auto;
    width: 100%;
    height: 200px;
}

#weather_chart {
    margin: 0 auto; /* Center if not already centered by flex */
    display: flex;  /* Ensure content inside is centered if needed */
    justify-content: center;
    align-items: center;
    width: 100% !important;
    min-width: 320px;
    height: auto !important;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.status-online {
    background-color: #27ae60;
}

.status-warning {
    background-color: #f39c12;
}

.status-critical {
    background-color: #e74c3c;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.last-updated {
    text-align: center;
    font-size: 0.75em;
    color: #666;
    margin-top: 8px;
    word-break: break-word;
}

/* Mobile-specific styles */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .panel {
        padding: 10px;
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .panel h2 {
        font-size: 1.1em;
        margin-bottom: 8px;
    }
    
    .status-indicator {
        width: 8px;
        height: 8px;
        margin-left: 6px;
    }
    
    .last-updated {
        font-size: 0.7em;
        margin-top: 5px;
    }
    
    #weather_chart {
        min-width: 280px;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .panel h2 {
        font-size: 1em;
    }
    
    #weather_chart {
        min-width: 260px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 8px;
    }
    
    .panel {
        max-width: 600px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .panel {
        /* Slightly larger touch targets */
        padding: 12px;
    }
}
