:root {
    --bg-color: #0f172a;
    --bg-gradient-start: #1e293b;
    --text-color: #ffffff;
    --accent-color: #38bdf8;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-radius: 24px;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

.light-mode {
    --bg-color: #f8fafc;
    --bg-gradient-start: #e2e8f0;
    --text-color: #1e293b;
    --accent-color: #0284c7;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(203, 213, 225, 0.6);
    --shadow-color: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dynamic Gradient Background */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 10%, var(--bg-gradient-start), var(--bg-color));
    z-index: -1;
}

.background-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 40%);
    animation: pulseBg 10s infinite alternate;
}

@keyframes pulseBg {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(50px, 50px);
    }
}

/* Layout */
.dashboard {
    max-width: 600px;
    /* Mobile first focus */
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 30px var(--shadow-color);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 0, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    color: #4ade80;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Hero Section */
.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.temp-container {
    display: flex;
    align-items: flex-start;
    line-height: 1;
}

.temp-value {
    font-size: 6rem;
    font-weight: 800;
    background: linear-gradient(180deg, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.unit {
    font-size: 2rem;
    margin-top: 15px;
    font-weight: 600;
    color: #94a3b8;
}

.hero-details {
    display: flex;
    gap: 30px;
    margin-top: 10px;
    font-size: 1.1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 0.8rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-card h3 {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 400;
}

.main-stat {
    font-size: 2rem;
    font-weight: 600;
}

.main-stat small {
    font-size: 1rem;
    opacity: 0.6;
}

.sub-stat {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Triggers Grid */
.triggers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.trigger-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
}

.trigger-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.trigger-card .icon {
    font-size: 1.5rem;
}

.trigger-card span {
    font-size: 0.8rem;
    text-align: center;
}

/* Responsive */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .dashboard {
        max-width: 900px;
    }
}

/* Chart */
.chart-card {
    padding: 20px;
    margin-top: 10px;
}

.chart-card h3 {
    margin-bottom: 15px;
    opacity: 0.8;
}

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

/* Theme Toggle */
.glass-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Wind Detail */
.wind-detail-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.wind-compass {
    font-size: 1.5rem;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.wind-text-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.wind-cardinal {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
}


/* Fix CSS variable warning */
.temp-value {
    background-clip: text;
}

/* --- Rain Detail Styles --- */
.rain-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    /* Increased gap */
    margin-top: 5px;
    text-align: center;
}

.big-rain-grid .rain-item {
    padding: 20px 10px;
    /* Bigger padding */
}

.big-rain-grid .rain-value {
    font-size: 1.5rem;
    /* Bigger font */
}

.big-rain-grid .rain-label {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.rain-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rain-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 4px;
    line-height: 1.2;
}

.rain-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
}

.rain-unit {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Light Mode Overrides */
.light-mode .temp-value {
    background: linear-gradient(180deg, #1e293b, #64748b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.light-mode .status-badge {
    background: rgba(22, 163, 74, 0.15);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.light-mode .status-dot {
    background: #15803d;
}