/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== Light Theme (Default) ========== */
.theme-light {
    --bg-primary: #faf9f7;
    --bg-secondary: #f5f3f0;
    --bg-tertiary: #e8e4df;
    --bg-sidebar: #1c1c1c;
    --bg-sidebar-hover: #2a2a2a;
    --bg-sidebar-active: #d97706;
    --bg-card: #ffffff;
    --bg-input: #f0ede9;
    --bg-hover: #f7f5f2;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    --text-on-accent: #ffffff;

    --accent: #16a34a;
    --accent-hover: #15803d;
    --accent-light: #dcfce7;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;

    --border: #e0dbd5;
    --border-light: #ece8e3;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
}

/* ========== Dark Theme ========== */
.theme-dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #222222;
    --bg-tertiary: #333333;
    --bg-sidebar: #141414;
    --bg-sidebar-hover: #222222;
    --bg-sidebar-active: #d97706;
    --bg-card: #2a2a2a;
    --bg-input: #1a1a1a;
    --bg-hover: #2a2a2a;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --text-on-accent: #ffffff;

    --accent: #22c55e;
    --accent-hover: #4ade80;
    --accent-light: #14532d;
    --success: #22c55e;
    --success-light: #14532d;
    --warning: #f59e0b;
    --warning-light: #713f12;
    --danger: #ef4444;
    --danger-light: #7f1d1d;
    --info: #06b6d4;
    --info-light: #164e63;

    --border: #3a3a3a;
    --border-light: #2a2a2a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.4);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
}

body {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ========== Selection ========== */
::selection { background: var(--accent); color: var(--text-on-accent); }

/* ========== Transitions ========== */
.theme-light, .theme-dark {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
