/* ==========================================================================
   CHRONOCASH - DESIGN SYSTEM & COLOR PALETTE
   ========================================================================== */

:root {
    /* Original Legacy ChronoCash Color Palette Mapped to Tokens */
    --legacy-green: #D4E09B;
    --legacy-green2: #CBDFBD;
    --legacy-white: #FCFBEE;
    --legacy-gray: #ACACAC;
    --legacy-brown1: #B4775D;
    --legacy-brown2: #A44A3F;
    --legacy-brown3: #C86060;
    --legacy-black: #1E1E1E;

    /* Enhanced Design Tokens - Light Theme */
    --bg-primary: #F9F8F1;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #F2F0E4;
    --bg-glass: rgba(255, 255, 255, 0.84);
    --bg-glass-border: rgba(212, 224, 155, 0.45);

    --text-primary: #1E1E1E;
    --text-secondary: #545B50;
    --text-muted: #848D80;
    --text-inverse: #FFFFFF;

    /* Core Palette Accents */
    --color-sage: #7B9A57;
    --color-sage-light: #EEF4E3;
    --color-matcha: #A8C890;
    
    --color-terracotta: #B4775D;
    --color-terracotta-light: #F9EFEA;
    --color-chestnut: #A44A3F;
    --color-coral: #C86060;
    --color-coral-light: #FDEEEE;

    /* Eisenhower Quadrant System Colors */
    --q1-urgent-important: #A44A3F;
    --q1-bg: #FDF1EF;
    --q2-nonurgent-important: #4A7C59;
    --q2-bg: #EEF6F0;
    --q3-urgent-unimportant: #B4775D;
    --q3-bg: #FAF2EE;
    --q4-nonurgent-unimportant: #7E8C94;
    --q4-bg: #F1F4F6;

    --border-subtle: #E6E4D7;
    --border-medium: #D1CFBF;

    /* Shadows & Elevation */
    --shadow-sm: 0 2px 8px rgba(30, 30, 30, 0.05);
    --shadow-md: 0 8px 24px rgba(30, 30, 30, 0.08);
    --shadow-lg: 0 16px 36px rgba(30, 30, 30, 0.12);

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', monospace;

    /* Radii & Motion */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --bg-primary: #131613;
    --bg-surface: #1C221D;
    --bg-surface-elevated: #252D27;
    --bg-glass: rgba(28, 34, 29, 0.9);
    --bg-glass-border: rgba(138, 166, 93, 0.25);

    --text-primary: #F4F6F2;
    --text-secondary: #A5B4A3;
    --text-muted: #6E7E6C;
    --text-inverse: #131613;

    --color-sage: #9DBF75;
    --color-sage-light: #1E2918;
    --color-matcha: #B9D8A2;

    --color-terracotta: #C88D74;
    --color-terracotta-light: #2D211C;
    --color-chestnut: #C06155;
    --color-coral: #DD7878;

    --q1-urgent-important: #E57373;
    --q1-bg: #2C1A19;
    --q2-nonurgent-important: #81C784;
    --q2-bg: #1B2B1E;
    --q3-urgent-unimportant: #FFB74D;
    --q3-bg: #2C2218;
    --q4-nonurgent-unimportant: #90A4AE;
    --q4-bg: #1F262A;

    --border-subtle: #2A332B;
    --border-medium: #3E4B40;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
}

/* Base Styles & Resets */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.25;
}

/* Button & Form Controls */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--color-sage);
    color: white;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(123, 154, 87, 0.35);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #6A8649;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 154, 87, 0.45);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--border-subtle);
    transform: translateY(-2px);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--border-subtle);
    transform: translateY(-1px);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
