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

:root {
    /* Eco-friendly green palette */
    --primary-color: #4CAF50;
    --secondary-color: #2E7D32;
    --accent-color: #66BB6A;
    --background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
    --card-background: rgba(255, 255, 255, 0.95);
    --text-primary: #1B5E20;
    --text-secondary: #558B2F;
    --border-color: #A5D6A7;
    --shadow: 0 4px 12px rgba(46, 125, 50, 0.15);
    --shadow-hover: 0 6px 20px rgba(46, 125, 50, 0.25);
    --leaf-green: #7CB342;
    --earth-brown: #795548;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(76, 175, 80, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(102, 187, 106, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

header {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 50%, #66BB6A 100%);
    color: white;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(46, 125, 50, 0.3);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "🌿";
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 3em;
    opacity: 0.2;
}

header::after {
    content: "🌱";
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 3em;
    opacity: 0.2;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 300;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.time-range-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.range-btn {
    padding: 12px 24px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.range-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.range-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

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

#lastUpdate {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.refresh-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.4s ease;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.refresh-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

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

.stat-card {
    background: var(--card-background);
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.4s ease;
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-unit {
    font-size: 0.9em;
    color: var(--text-secondary);
}

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

.chart-container {
    background: var(--card-background);
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.chart-container:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.chart-container h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.3em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

footer {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.9em;
    background: var(--card-background);
    border-radius: 16px;
    margin-top: 30px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

footer p {
    margin: 8px 0;
}

.tech-note {
    font-size: 0.85em;
    opacity: 0.8;
    color: var(--primary-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

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

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .time-range-selector {
        justify-content: center;
    }

    .status {
        flex-direction: column;
        text-align: center;
    }
}
