/* ============================================
   4 KOREAN SEASONS — SEMANTIC DESIGN TOKENS
   High-contrast (WCAG AA+), lightweight, zero backdrop-filter lag
   ============================================ */

:root,
[data-theme="spring"] {
    --bg-page: #fdf8fa;
    --bg-card: #ffffff;
    --bg-subtle: #f9f1f4;
    --bg-hover: #f4e6ec;
    --border: #eedce3;
    --border-strong: #dfbccc;

    --text-primary: #261b21;
    --text-secondary: #5a4650;
    --text-muted: #76606b;

    --accent: #c93b6b;
    --accent-hover: #b02e5a;
    --accent-soft: #fdecf2;
    --accent-soft-text: #9d244e;
    --accent-on: #ffffff;

    --income: #0d7a4b;
    --income-bg: #ebfaf2;
    --income-border: #b7ebd0;

    --expense: #c42b4b;
    --expense-bg: #fff0f3;
    --expense-border: #fbc9d4;

    --balance: #5946b2;
    --balance-bg: #f2f0fc;
    --balance-border: #d8d1f7;

    --today-ring: #c93b6b;
    --focus-ring: #9d244e;

    --shadow-xs: 0 1px 2px rgba(38, 27, 33, 0.05);
    --shadow-sm: 0 2px 8px rgba(38, 27, 33, 0.06);
    --shadow-md: 0 10px 28px rgba(38, 27, 33, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* === ☀️ MÙA HÈ (여름) — Ocean Breeze === */
[data-theme="summer"] {
    --bg-page: #f3f9fc;
    --bg-card: #ffffff;
    --bg-subtle: #eaf4fa;
    --bg-hover: #dcecf6;
    --border: #d1e5f0;
    --border-strong: #a7cfe4;

    --text-primary: #102636;
    --text-secondary: #39576b;
    --text-muted: #527084;

    --accent: #0277b5;
    --accent-hover: #016094;
    --accent-soft: #e3f4fc;
    --accent-soft-text: #015b8c;
    --accent-on: #ffffff;

    --income: #0b7a53;
    --income-bg: #e7f8f0;
    --income-border: #b0e8ce;

    --expense: #c62e3e;
    --expense-bg: #fff0f1;
    --expense-border: #f9c8cd;

    --balance: #0277b5;
    --balance-bg: #e7f4fb;
    --balance-border: #b5dcf0;

    --today-ring: #0277b5;
    --focus-ring: #015585;

    --shadow-xs: 0 1px 2px rgba(16, 38, 54, 0.05);
    --shadow-sm: 0 2px 8px rgba(16, 38, 54, 0.06);
    --shadow-md: 0 10px 28px rgba(16, 38, 54, 0.12);
}

/* === 🍁 MÙA THU (가을) — Warm Maple === */
[data-theme="autumn"] {
    --bg-page: #fcf8f2;
    --bg-card: #ffffff;
    --bg-subtle: #f7efe4;
    --bg-hover: #efe3d2;
    --border: #eadbcc;
    --border-strong: #d7bfa6;

    --text-primary: #2c1e18;
    --text-secondary: #5c4539;
    --text-muted: #755c4f;

    --accent: #c24b24;
    --accent-hover: #a53c1a;
    --accent-soft: #fdefe8;
    --accent-soft-text: #993414;
    --accent-on: #ffffff;

    --income: #137850;
    --income-bg: #eaf7f0;
    --income-border: #b5e4cc;

    --expense: #be2b34;
    --expense-bg: #fff0f0;
    --expense-border: #f7c7ca;

    --balance: #8a561e;
    --balance-bg: #fbf3e6;
    --balance-border: #ebd4b0;

    --today-ring: #c24b24;
    --focus-ring: #963414;

    --shadow-xs: 0 1px 2px rgba(44, 30, 24, 0.05);
    --shadow-sm: 0 2px 8px rgba(44, 30, 24, 0.06);
    --shadow-md: 0 10px 28px rgba(44, 30, 24, 0.12);
}

/* === ❄️ MÙA ĐÔNG (겨울) — Crisp Glacier === */
[data-theme="winter"] {
    --bg-page: #f2f7fc;
    --bg-card: #ffffff;
    --bg-subtle: #e9f2fa;
    --bg-hover: #ddeaf7;
    --border: #d2e2f2;
    --border-strong: #adc9e6;

    --text-primary: #142538;
    --text-secondary: #3f5872;
    --text-muted: #58718c;

    --accent: #2266b8;
    --accent-hover: #1a5296;
    --accent-soft: #e6f0fc;
    --accent-soft-text: #184e91;
    --accent-on: #ffffff;

    --income: #0f7a53;
    --income-bg: #e8f8f1;
    --income-border: #b2e6cf;

    --expense: #c4304b;
    --expense-bg: #fff0f3;
    --expense-border: #f8c8d2;

    --balance: #3b58a8;
    --balance-bg: #ecf0fb;
    --balance-border: #c4d0f2;

    --today-ring: #2266b8;
    --focus-ring: #174c8c;

    --shadow-xs: 0 1px 2px rgba(20, 37, 56, 0.05);
    --shadow-sm: 0 2px 8px rgba(20, 37, 56, 0.06);
    --shadow-md: 0 10px 28px rgba(20, 37, 56, 0.12);
}

/* Theme preview swatches in Settings */
.swatch-spring { background: #fdecf2; color: #c93b6b; }
.swatch-summer { background: #e3f4fc; color: #0277b5; }
.swatch-autumn { background: #fdefe8; color: #c24b24; }
.swatch-winter { background: #e6f0fc; color: #2266b8; }

/* ============================================
   OPTIONAL ULTRA-LIGHTWEIGHT SEASONAL AMBIENT
   Fixed pool (max 8 nodes), zero JS timers, GPU transform only
   ============================================ */
.season-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    overflow: hidden;
    contain: strict;
}

body.modal-open .season-particles,
body.tab-hidden .season-particles {
    display: none;
}

.season-particle {
    position: absolute;
    top: -24px;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    animation-name: gentleFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.season-particle.is-petal {
    width: 10px;
    height: 10px;
    border-radius: 50% 0 50% 0;
    background: #f497b6;
}

.season-particle.is-snow {
    color: #7ab3e6;
    font-size: 14px;
}

.season-particle.is-leaf {
    font-size: 14px;
}

.season-particle.is-spark {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f5b82e;
}

@keyframes gentleFall {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.45;
    }
    85% {
        opacity: 0.35;
    }
    100% {
        transform: translate3d(24px, 105vh, 0) rotate(220deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .season-particles {
        display: none !important;
    }
}
