/* ============================================================
   FreshTracker — themes
   Layout lives in styles.css; only colour tokens live here.
   Pattern borrowed from GraspV3 (day/night, [data-theme]).
   ============================================================ */

:root,
[data-theme="day"] {
    --color-bg:             #f6f8fa;
    --color-surface:        #ffffff;
    --color-surface-2:      #f0f2f5;
    --color-border:         #d0d7de;
    --color-border-soft:    #e8ecf0;
    --color-text:           #1f2328;
    --color-muted:          #656d76;

    --color-primary:        #0969da;
    --color-primary-hover:  #0550ae;
    --color-primary-bg:     rgba(9, 105, 218, 0.08);

    --color-success:        #1a7f37;
    --color-success-bg:     rgba(26, 127, 55, 0.10);
    --color-warning:        #9a6700;
    --color-warning-bg:     rgba(154, 103, 0, 0.12);
    --color-danger:         #cf222e;
    --color-danger-hover:   #a40e26;
    --color-danger-bg:      rgba(207, 34, 46, 0.08);

    --color-overlay:        rgba(0, 0, 0, 0.35);
    --color-shadow:         0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.08);
    --color-toast-text:     #ffffff;
}

[data-theme="night"] {
    --color-bg:             #0d1117;
    --color-surface:        #161b22;
    --color-surface-2:      #1c2129;
    --color-border:         #30363d;
    --color-border-soft:    #21262d;
    --color-text:           #e6edf3;
    --color-muted:          #8b949e;

    --color-primary:        #58a6ff;
    --color-primary-hover:  #79c0ff;
    --color-primary-bg:     rgba(88, 166, 255, 0.12);

    --color-success:        #3fb950;
    --color-success-bg:     rgba(63, 185, 80, 0.12);
    --color-warning:        #d2991d;
    --color-warning-bg:     rgba(210, 153, 29, 0.14);
    --color-danger:         #f85149;
    --color-danger-hover:   #ff6b63;
    --color-danger-bg:      rgba(248, 81, 73, 0.12);

    --color-overlay:        rgba(0, 0, 0, 0.60);
    --color-shadow:         0 1px 2px rgba(0, 0, 0, 0.30), 0 10px 28px rgba(0, 0, 0, 0.45);
    --color-toast-text:     #0d1117;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Sun in day mode, moon in night mode. */
[data-theme="day"] .icon-moon,
[data-theme="night"] .icon-sun {
    display: none;
}

::selection {
    background: var(--color-primary-bg);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
