:root {
    --bg-dark: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-cyan: #22d3ee;
    --accent-orange: #fb923c;
    --accent-purple: #a78bfa;
    --danger: #ef4444;
    --success: #4ade80;

    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: -1;
}

/* Subtle animated blobs could go here for extra premium feel */

.content-wrapper {
    max-width: 600px;
    /* Mobile focused */
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 4px;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.timestamp {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.station-id {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--accent-cyan);
}

/* Tab Content */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.tab-content.active {
    display: flex;
    /* Changed from block to flex to maintain gap */
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Current Conditions */
.current-conditions {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.main-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.temp-big {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.condition-icon {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin-top: 8px;
    font-weight: 500;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
    width: 100%;
    padding: 0 10px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.hero-stat .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hero-stat .sub-value {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.secondary-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.metric-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.metric-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-item .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Range Selector */
.range-selector {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    gap: 8px;
}

.range-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 0;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.range-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Charts */
.charts-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

canvas {
    width: 100% !important;
    height: 250px !important;
}

/* Details */
.details-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

/* Forecast Container */
.forecast-container {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .forecast-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.forecast-card {
    background: rgba(255, 255, 255, 0.03);
    /* Slightly lighter than panel */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.forecast-card .day-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.forecast-card .date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.forecast-card .temps {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.forecast-card .temp-high {
    color: var(--accent-orange);
}

.forecast-card .temp-low {
    color: var(--accent-blue);
    opacity: 0.8;
}

.forecast-card .narrative {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.forecast-card .precip-chance {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-bottom: 40px;
}

/* Mobile Optimizations */
@media (max-width: 400px) {
    .temp-big {
        font-size: 4rem;
    }
}