* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: white;
    color: #4a7c23;
    border-bottom: 3px solid #4a7c23;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.alert {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1em;
    opacity: 0.9;
}

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

.chart-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.chart-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.chart-content {
    min-height: 150px;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.chart-bar-label {
    min-width: 100px;
    font-weight: 600;
    color: #555;
}

.chart-bar-fill {
    flex: 1;
    height: 30px;
    background: linear-gradient(90deg, #4a7c23, #6ba832);
    border-radius: 5px;
    position: relative;
    margin: 0 10px;
}

.chart-bar-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: bold;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.btn-primary {
    padding: 10px 20px;
    background: #4a7c23;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #3a6318;
}

/* Data Lists */
.data-list {
    display: grid;
    gap: 15px;
}

.event-card, .alert-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover, .alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.card-location {
    display: inline-block;
    padding: 5px 12px;
    background: #4a7c23;
    color: white;
    border-radius: 15px;
    font-size: 0.9em;
}

.card-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.card-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 5px;
}

.data-label {
    font-weight: 600;
    color: #555;
}

.data-value {
    color: #333;
}

.alert-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.alert-badge {
    padding: 6px 12px;
    background: #f5576c;
    color: white;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Footer */
footer {
    background: #f5f5f5;
    padding: 15px 30px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

.status-connected {
    color: #4a7c23;
    font-weight: bold;
}

.status-disconnected {
    color: #f5576c;
    font-weight: bold;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.2em;
}

.error {
    text-align: center;
    padding: 40px;
    color: #f5576c;
    font-size: 1.1em;
}

/* Weather Tab */
.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.weather-header h2 {
    color: #333;
    font-size: 1.8em;
    margin: 0;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.weather-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.weather-card .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.weather-card .card-title {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

.weather-card .card-subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    text-transform: capitalize;
}

.weather-main {
    text-align: center;
    margin: 20px 0;
}

.temperature-large {
    font-size: 4em;
    font-weight: bold;
    line-height: 1;
}

.feels-like {
    font-size: 1.1em;
    opacity: 0.9;
    margin-top: 5px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.weather-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.weather-label {
    font-weight: 600;
}

.weather-value {
    font-weight: bold;
}

.weather-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85em;
    opacity: 0.8;
}

.weather-card .alert-badges {
    margin-top: 15px;
}
