/* MailNuts UI Theme Variables
   Based on Catppuccin color palette
   https://github.com/catppuccin/catppuccin
*/

/* Dark theme (Catppuccin Mocha) - default */
:root,
[data-theme="dark"] {
    /* Primary colors */
    --primary: #89b4fa;
    --primary-hover: #74c7ec;
    --primary-muted: rgba(137, 180, 250, 0.15);
    --secondary: #cba6f7;
    --secondary-hover: #b4befe;

    /* Background colors */
    --background: #1e1e2e;
    --surface: #181825;
    --surface-alt: #11111b;
    --overlay: rgba(17, 17, 27, 0.8);

    /* Text colors */
    --text: #cdd6f4;
    --text-secondary: #a6adc8;
    --text-muted: #6c7086;
    --text-inverted: #1e1e2e;

    /* Border colors */
    --border: #313244;
    --border-hover: #45475a;
    --border-focus: #89b4fa;

    /* Status colors */
    --success: #a6e3a1;
    --success-bg: rgba(166, 227, 161, 0.15);
    --warning: #fab387;
    --warning-bg: rgba(250, 179, 135, 0.15);
    --error: #f38ba8;
    --error-bg: rgba(243, 139, 168, 0.15);
    --info: #89dceb;
    --info-bg: rgba(137, 220, 235, 0.15);

    /* Chart colors */
    --chart-1: #89b4fa;
    --chart-2: #a6e3a1;
    --chart-3: #f38ba8;
    --chart-4: #fab387;
    --chart-5: #cba6f7;
    --chart-6: #89dceb;
    --chart-7: #f9e2af;
    --chart-8: #94e2d5;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --header-height: 56px;
    --content-max-width: 1400px;
}

/* Light theme (Catppuccin Latte) */
[data-theme="light"] {
    /* Primary colors */
    --primary: #1e66f5;
    --primary-hover: #04a5e5;
    --primary-muted: rgba(30, 102, 245, 0.1);
    --secondary: #8839ef;
    --secondary-hover: #7287fd;

    /* Background colors */
    --background: #eff1f5;
    --surface: #e6e9ef;
    --surface-alt: #dce0e8;
    --overlay: rgba(220, 224, 232, 0.9);

    /* Text colors */
    --text: #4c4f69;
    --text-secondary: #6c6f85;
    --text-muted: #9ca0b0;
    --text-inverted: #eff1f5;

    /* Border colors */
    --border: #ccd0da;
    --border-hover: #bcc0cc;
    --border-focus: #1e66f5;

    /* Status colors */
    --success: #40a02b;
    --success-bg: rgba(64, 160, 43, 0.1);
    --warning: #fe640b;
    --warning-bg: rgba(254, 100, 11, 0.1);
    --error: #d20f39;
    --error-bg: rgba(210, 15, 57, 0.1);
    --info: #04a5e5;
    --info-bg: rgba(4, 165, 229, 0.1);

    /* Chart colors */
    --chart-1: #1e66f5;
    --chart-2: #40a02b;
    --chart-3: #d20f39;
    --chart-4: #fe640b;
    --chart-5: #8839ef;
    --chart-6: #04a5e5;
    --chart-7: #df8e1d;
    --chart-8: #179299;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Global reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Scrollbar styling (WebKit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--primary-muted);
    color: var(--text);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Code */
code, pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

code {
    background: var(--surface-alt);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--surface-alt);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: transparent;
    padding: 0;
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.text-info {
    color: var(--info);
}
