@import 'tailwindcss';
@import 'tw-animate-css';
@import './styles/markdown-terminal.css';
@import './styles/react-syntax-highlighter-terminal.css';
@import './styles/tiptap-editor.css';
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');

@custom-variant dark (&:is(.dark *));

@theme inline {
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --color-background: var(--terminal-bg);
  --color-foreground: var(--terminal-fg);
  --color-card: var(--terminal-bg);
  --color-card-foreground: var(--terminal-fg);
  --color-popover: var(--terminal-bg);
  --color-popover-foreground: var(--terminal-fg);
  --color-primary: var(--terminal-accent);
  --color-primary-foreground: var(--terminal-bg);
  --color-secondary: var(--terminal-bg-alt);
  --color-secondary-foreground: var(--terminal-fg);
  --color-muted: var(--terminal-bg-alt);
  --color-muted-foreground: var(--terminal-fg-dim);
  --color-accent: var(--terminal-accent);
  --color-accent-foreground: var(--terminal-bg);
  --color-destructive: var(--terminal-error);
  --color-border: var(--terminal-border);
  --color-input: var(--terminal-border);
  --color-ring: var(--terminal-accent);
  --color-chart-1: var(--terminal-accent);
  --color-chart-2: var(--terminal-accent-alt);
  --color-chart-3: var(--terminal-success);
  --color-chart-4: var(--terminal-warning);
  --color-chart-5: var(--terminal-error);
  --color-sidebar: var(--terminal-bg);
  --color-sidebar-foreground: var(--terminal-fg);
  --color-sidebar-primary: var(--terminal-accent);
  --color-sidebar-primary-foreground: var(--terminal-bg);
  --color-sidebar-accent: var(--terminal-bg-alt);
  --color-sidebar-accent-foreground: var(--terminal-fg);
  --color-sidebar-border: var(--terminal-border);
  --color-sidebar-ring: var(--terminal-accent);
}

/* Solarized Dark - Default theme */
:root,
[data-theme='solarized-dark'] {
  --terminal-bg: #002b36;
  --terminal-bg-alt: #073642;
  --terminal-fg: #839496;
  --terminal-fg-dim: #586e75;
  --terminal-accent: #268bd2;
  --terminal-accent-dim: rgba(38, 139, 210, 0.3);
  --terminal-accent-alt: #2aa198;
  --terminal-border: #586e75;
  --terminal-success: #859900;
  --terminal-warning: #b58900;
  --terminal-error: #dc322f;
  --terminal-selection: #2aa19899;

  /* Standard colors (30-37, 40-47) - Official Solarized values */
  --terminal-color-0: #073642; /* Black (base02) */
  --terminal-color-1: #dc322f; /* Red */
  --terminal-color-2: #859900; /* Green */
  --terminal-color-3: #b58900; /* Yellow */
  --terminal-color-4: #268bd2; /* Blue */
  --terminal-color-5: #d33682; /* Magenta */
  --terminal-color-6: #2aa198; /* Cyan */
  --terminal-color-7: #eee8d5; /* White (base2) */

  /* Bright colors (90-97, 100-107) - Official Solarized values */
  --terminal-color-8: #002b36; /* Bright Black (base03) */
  --terminal-color-9: #cb4b16; /* Bright Red (orange) */
  --terminal-color-10: #586e75; /* Bright Green (base01) */
  --terminal-color-11: #657b83; /* Bright Yellow (base00) */
  --terminal-color-12: #839496; /* Bright Blue (base0) */
  --terminal-color-13: #6c71c4; /* Bright Magenta (violet) */
  --terminal-color-14: #93a1a1; /* Bright Cyan (base1) */
  --terminal-color-15: #fdf6e3; /* Bright White (base3) */
}

/* Solarized Light */
[data-theme='solarized-light'] {
  --terminal-bg: #fdf6e3;
  --terminal-bg-alt: #eee8d5;
  --terminal-fg: #657b83;
  --terminal-fg-dim: #93a1a1;
  --terminal-accent: #268bd2;
  --terminal-accent-dim: rgba(38, 139, 210, 0.3);
  --terminal-accent-alt: #2aa198;
  --terminal-border: #93a1a1;
  --terminal-success: #859900;
  --terminal-warning: #b58900;
  --terminal-error: #dc322f;
  --terminal-selection: #eee8d5;

  /* Standard colors - Official Solarized values (inverted for light theme) */
  --terminal-color-0: #eee8d5; /* Black (base2) */
  --terminal-color-1: #dc322f; /* Red */
  --terminal-color-2: #859900; /* Green */
  --terminal-color-3: #b58900; /* Yellow */
  --terminal-color-4: #268bd2; /* Blue */
  --terminal-color-5: #d33682; /* Magenta */
  --terminal-color-6: #2aa198; /* Cyan */
  --terminal-color-7: #073642; /* White (base02) */

  /* Bright colors - Official Solarized values */
  --terminal-color-8: #fdf6e3; /* Bright Black (base3) */
  --terminal-color-9: #cb4b16; /* Bright Red (orange) */
  --terminal-color-10: #93a1a1; /* Bright Green (base1) */
  --terminal-color-11: #839496; /* Bright Yellow (base0) */
  --terminal-color-12: #657b83; /* Bright Blue (base00) */
  --terminal-color-13: #6c71c4; /* Bright Magenta (violet) */
  --terminal-color-14: #586e75; /* Bright Cyan (base01) */
  --terminal-color-15: #002b36; /* Bright White (base03) */
}

/* Cappuccino - Warm coffee theme */
[data-theme='cappuccino'] {
  --terminal-bg: #2f1b14;
  --terminal-bg-alt: #3d261a;
  --terminal-fg: #d4b895;
  --terminal-fg-dim: #a0896b;
  --terminal-accent: #f4a261;
  --terminal-accent-dim: rgba(244, 162, 97, 0.3);
  --terminal-accent-alt: #e76f51;
  --terminal-border: #a0896b;
  --terminal-success: #7b9171;
  --terminal-warning: #e9c46a;
  --terminal-error: #e63946;
  --terminal-selection: #f4a2614d;

  /* Standard colors - Warm coffee-inspired palette */
  --terminal-color-0: #2f1b14; /* Black (bg) */
  --terminal-color-1: #e63946; /* Red */
  --terminal-color-2: #7b9171; /* Green */
  --terminal-color-3: #e9c46a; /* Yellow */
  --terminal-color-4: #2a9d8f; /* Blue */
  --terminal-color-5: #e76f51; /* Magenta/Orange */
  --terminal-color-6: #264653; /* Cyan */
  --terminal-color-7: #d4b895; /* White (fg) */

  /* Bright colors - Lightened versions */
  --terminal-color-8: #3d261a; /* Bright Black */
  --terminal-color-9: #ff6b79; /* Bright Red */
  --terminal-color-10: #93ab89; /* Bright Green */
  --terminal-color-11: #f4d798; /* Bright Yellow */
  --terminal-color-12: #5ab7a9; /* Bright Blue */
  --terminal-color-13: #f4a261; /* Bright Magenta */
  --terminal-color-14: #3a5a6a; /* Bright Cyan */
  --terminal-color-15: #f5e6d3; /* Bright White */
}

/* Catppuccin Mocha - Popular pastel theme */
[data-theme='catppuccin'] {
  --terminal-bg: #1e1e2e;
  --terminal-bg-alt: #313244;
  --terminal-fg: #cdd6f4;
  --terminal-fg-dim: #9399b2;
  --terminal-accent: #cba6f7;
  --terminal-accent-dim: rgba(203, 166, 247, 0.3);
  --terminal-accent-alt: #f5c2e7;
  --terminal-border: #6c7086;
  --terminal-success: #a6e3a1;
  --terminal-warning: #f9e2af;
  --terminal-error: #f38ba8;
  --terminal-selection: #9399b240;

  /* Standard colors - Official Catppuccin Mocha values */
  --terminal-color-0: #45475a; /* Black (surface1) */
  --terminal-color-1: #f38ba8; /* Red */
  --terminal-color-2: #a6e3a1; /* Green */
  --terminal-color-3: #f9e2af; /* Yellow */
  --terminal-color-4: #89b4fa; /* Blue */
  --terminal-color-5: #f5c2e7; /* Magenta (pink) */
  --terminal-color-6: #94e2d5; /* Cyan (teal) */
  --terminal-color-7: #bac2de; /* White (subtext1) */

  /* Bright colors - Official Catppuccin Mocha values */
  --terminal-color-8: #585b70; /* Bright Black (surface2) */
  --terminal-color-9: #eba0ac; /* Bright Red (maroon) */
  --terminal-color-10: #a6e3a1; /* Bright Green */
  --terminal-color-11: #fab387; /* Bright Yellow (peach) */
  --terminal-color-12: #89dceb; /* Bright Blue (sky) */
  --terminal-color-13: #cba6f7; /* Bright Magenta (mauve) */
  --terminal-color-14: #89dceb; /* Bright Cyan (sky) */
  --terminal-color-15: #cdd6f4; /* Bright White (text) */
}

/* High Contrast - Sharp white on black */
[data-theme='high-contrast'] {
  --terminal-bg: #000000;
  --terminal-bg-alt: #1a1a1a;
  --terminal-fg: #ffffff;
  --terminal-fg-dim: #cccccc;
  --terminal-accent: #00ff00;
  --terminal-accent-dim: rgba(0, 255, 0, 0.3);
  --terminal-accent-alt: #00cccc;
  --terminal-border: #666666;
  --terminal-success: #00ff00;
  --terminal-warning: #ffff00;
  --terminal-error: #ff0000;
  --terminal-selection: #ffffff;

  /* Standard colors - Maximum contrast */
  --terminal-color-0: #000000; /* Black */
  --terminal-color-1: #ff0000; /* Red */
  --terminal-color-2: #00ff00; /* Green */
  --terminal-color-3: #ffff00; /* Yellow */
  --terminal-color-4: #0000ff; /* Blue */
  --terminal-color-5: #ff00ff; /* Magenta */
  --terminal-color-6: #00ffff; /* Cyan */
  --terminal-color-7: #c0c0c0; /* White (silver) */

  /* Bright colors - Pure bright variants */
  --terminal-color-8: #808080; /* Bright Black (gray) */
  --terminal-color-9: #ff6060; /* Bright Red */
  --terminal-color-10: #60ff60; /* Bright Green */
  --terminal-color-11: #ffff60; /* Bright Yellow */
  --terminal-color-12: #6060ff; /* Bright Blue */
  --terminal-color-13: #ff60ff; /* Bright Magenta */
  --terminal-color-14: #60ffff; /* Bright Cyan */
  --terminal-color-15: #ffffff; /* Bright White */
}

/* Framer Dark - Inspired by Framer's dark theme */
[data-theme='framer-dark'] {
  --terminal-bg: #181818;
  --terminal-bg-alt: #2f3439;
  --terminal-fg: #eeeeee;
  --terminal-fg-dim: #999999;
  --terminal-accent: #fd5799;
  --terminal-accent-dim: rgba(253, 87, 153, 0.3);
  --terminal-accent-alt: #20bcfc;
  --terminal-border: #333333;
  --terminal-success: #32ccdc;
  --terminal-warning: #fecb6e;
  --terminal-error: #fd886b;
  --terminal-selection: #fd579933;

  /* Standard colors - Modern design-tool inspired */
  --terminal-color-0: #181818; /* Black */
  --terminal-color-1: #fd886b; /* Red */
  --terminal-color-2: #32ccdc; /* Green/Teal */
  --terminal-color-3: #fecb6e; /* Yellow */
  --terminal-color-4: #20bcfc; /* Blue */
  --terminal-color-5: #fd5799; /* Magenta */
  --terminal-color-6: #00b8d4; /* Cyan */
  --terminal-color-7: #999999; /* White */

  /* Bright colors - Vibrant variants */
  --terminal-color-8: #2f3439; /* Bright Black */
  --terminal-color-9: #ff9580; /* Bright Red */
  --terminal-color-10: #6edde5; /* Bright Green */
  --terminal-color-11: #ffd98e; /* Bright Yellow */
  --terminal-color-12: #60d0ff; /* Bright Blue */
  --terminal-color-13: #ff7ab8; /* Bright Magenta */
  --terminal-color-14: #4dd0e1; /* Bright Cyan */
  --terminal-color-15: #eeeeee; /* Bright White */
}

/* Framer Light - Light counterpart to Framer Dark */
[data-theme='framer-light'] {
  --terminal-bg: #ffffff;
  --terminal-bg-alt: #f8f9fa;
  --terminal-fg: #333333;
  --terminal-fg-dim: #666666;
  --terminal-accent: #0066cc;
  --terminal-accent-dim: rgba(0, 102, 204, 0.3);
  --terminal-accent-alt: #006bb3;
  --terminal-border: #e0e0e0;
  --terminal-success: #22a06b;
  --terminal-warning: #cc7722;
  --terminal-error: #dc3545;
  --terminal-selection: #0066cc26;

  /* Standard colors - Clean professional palette */
  --terminal-color-0: #f8f9fa; /* Black (light bg) */
  --terminal-color-1: #dc3545; /* Red */
  --terminal-color-2: #22a06b; /* Green */
  --terminal-color-3: #cc7722; /* Yellow/Orange */
  --terminal-color-4: #0066cc; /* Blue */
  --terminal-color-5: #7b61ff; /* Magenta/Purple */
  --terminal-color-6: #006bb3; /* Cyan */
  --terminal-color-7: #333333; /* White (dark text) */

  /* Bright colors - Muted variants */
  --terminal-color-8: #e0e0e0; /* Bright Black */
  --terminal-color-9: #e74856; /* Bright Red */
  --terminal-color-10: #3db88b; /* Bright Green */
  --terminal-color-11: #e6a045; /* Bright Yellow */
  --terminal-color-12: #3399ff; /* Bright Blue */
  --terminal-color-13: #9b81ff; /* Bright Magenta */
  --terminal-color-14: #0099ff; /* Bright Cyan */
  --terminal-color-15: #000000; /* Bright White (pure black) */
}

/* Gruvbox Dark - Material palette, medium contrast */
[data-theme='gruvbox-dark'] {
  --terminal-bg: #282828;
  --terminal-bg-alt: #32302f;
  --terminal-fg: #d4be98;
  --terminal-fg-dim: #928374;
  --terminal-accent: #a9b665;
  --terminal-accent-dim: rgba(169, 182, 101, 0.3);
  --terminal-accent-alt: #89b482;
  --terminal-border: #504945;
  --terminal-success: #a9b665;
  --terminal-warning: #d8a657;
  --terminal-error: #ea6962;
  --terminal-selection: #504945;

  /* Standard colors - Official Gruvbox dark values */
  --terminal-color-0: #282828; /* Black (bg0) */
  --terminal-color-1: #cc241d; /* Red */
  --terminal-color-2: #98971a; /* Green */
  --terminal-color-3: #d79921; /* Yellow */
  --terminal-color-4: #458588; /* Blue */
  --terminal-color-5: #b16286; /* Magenta/Purple */
  --terminal-color-6: #689d6a; /* Cyan/Aqua */
  --terminal-color-7: #a89984; /* White (fg4) */

  /* Bright colors - Official Gruvbox bright values */
  --terminal-color-8: #928374; /* Bright Black (gray) */
  --terminal-color-9: #fb4934; /* Bright Red */
  --terminal-color-10: #b8bb26; /* Bright Green */
  --terminal-color-11: #fabd2f; /* Bright Yellow */
  --terminal-color-12: #83a598; /* Bright Blue */
  --terminal-color-13: #d3869b; /* Bright Magenta */
  --terminal-color-14: #8ec07c; /* Bright Cyan */
  --terminal-color-15: #ebdbb2; /* Bright White (fg1) */
}

/* Gruvbox Light - Material palette, medium contrast */
[data-theme='gruvbox-light'] {
  --terminal-bg: #fbf1c7;
  --terminal-bg-alt: #f2e5bc;
  --terminal-fg: #654735;
  --terminal-fg-dim: #928374;
  --terminal-accent: #6c782e;
  --terminal-accent-dim: rgba(108, 120, 46, 0.3);
  --terminal-accent-alt: #4c7a5d;
  --terminal-border: #d5c4a1;
  --terminal-success: #6c782e;
  --terminal-warning: #b47109;
  --terminal-error: #c14a4a;
  --terminal-selection: #d5c4a1;

  /* Standard colors - Official Gruvbox light values */
  --terminal-color-0: #fbf1c7; /* Black (bg0) */
  --terminal-color-1: #cc241d; /* Red */
  --terminal-color-2: #98971a; /* Green */
  --terminal-color-3: #d79921; /* Yellow */
  --terminal-color-4: #458588; /* Blue */
  --terminal-color-5: #b16286; /* Magenta/Purple */
  --terminal-color-6: #689d6a; /* Cyan/Aqua */
  --terminal-color-7: #7c6f64; /* White (fg4) */

  /* Bright colors - Official Gruvbox bright values */
  --terminal-color-8: #928374; /* Bright Black (gray) */
  --terminal-color-9: #9d0006; /* Bright Red (darkened) */
  --terminal-color-10: #79740e; /* Bright Green (darkened) */
  --terminal-color-11: #b57614; /* Bright Yellow (darkened) */
  --terminal-color-12: #076678; /* Bright Blue (darkened) */
  --terminal-color-13: #8f3f71; /* Bright Magenta (darkened) */
  --terminal-color-14: #427b58; /* Bright Cyan (darkened) */
  --terminal-color-15: #3c3836; /* Bright White (fg1) */
}

/* Monokai - Classic dark theme */
[data-theme='monokai'] {
  --terminal-bg: #272822;
  --terminal-bg-alt: #3e3d32;
  --terminal-fg: #f8f8f2;
  --terminal-fg-dim: #75715e;
  --terminal-accent: #66d9ef;
  --terminal-accent-dim: rgba(102, 217, 239, 0.3);
  --terminal-accent-alt: #a6e22e;
  --terminal-border: #75715e;
  --terminal-success: #a6e22e;
  --terminal-warning: #e6db74;
  --terminal-error: #f92672;
  --terminal-selection: #49483e;

  /* Standard colors - Classic Monokai palette */
  --terminal-color-0: #272822; /* Black */
  --terminal-color-1: #f92672; /* Red (pink) */
  --terminal-color-2: #a6e22e; /* Green */
  --terminal-color-3: #e6db74; /* Yellow */
  --terminal-color-4: #66d9ef; /* Blue */
  --terminal-color-5: #ae81ff; /* Magenta/Purple */
  --terminal-color-6: #66d9ef; /* Cyan */
  --terminal-color-7: #f8f8f2; /* White */

  /* Bright colors - Intensified versions */
  --terminal-color-8: #75715e; /* Bright Black (comment) */
  --terminal-color-9: #fd5ff0; /* Bright Red/Pink */
  --terminal-color-10: #b3e774; /* Bright Green */
  --terminal-color-11: #feed6c; /* Bright Yellow */
  --terminal-color-12: #81e7fc; /* Bright Blue */
  --terminal-color-13: #c2a1ff; /* Bright Magenta */
  --terminal-color-14: #81e7fc; /* Bright Cyan */
  --terminal-color-15: #fcfcfa; /* Bright White */
}

/* Launch theme */
[data-theme='launch'] {
  --terminal-bg: #f6f6ef;
  --terminal-bg-alt: #ffffff;
  --terminal-fg: #000000;
  --terminal-fg-dim: #828282;
  --terminal-accent: #ff6600;
  --terminal-accent-dim: rgba(255, 102, 0, 0.3);
  --terminal-accent-alt: #458cc9;
  --terminal-border: #828282;
  --terminal-success: #458cc9;
  --terminal-warning: #ff6600;
  --terminal-error: #cc5200;
  --terminal-selection: #ff66001a;

  /* Standard colors - HN/minimalist palette */
  --terminal-color-0: #f6f6ef; /* Black (bg) */
  --terminal-color-1: #cc5200; /* Red */
  --terminal-color-2: #458cc9; /* Green/Blue */
  --terminal-color-3: #ff6600; /* Yellow/Orange */
  --terminal-color-4: #458cc9; /* Blue */
  --terminal-color-5: #828282; /* Magenta (gray) */
  --terminal-color-6: #5a9fd4; /* Cyan */
  --terminal-color-7: #000000; /* White (text) */

  /* Bright colors - Duplicate for minimalist theme */
  --terminal-color-8: #e0e0d7; /* Bright Black */
  --terminal-color-9: #ff6600; /* Bright Red */
  --terminal-color-10: #6ba3d0; /* Bright Green */
  --terminal-color-11: #ff8833; /* Bright Yellow */
  --terminal-color-12: #6ba3d0; /* Bright Blue */
  --terminal-color-13: #999999; /* Bright Magenta */
  --terminal-color-14: #7fb8e1; /* Bright Cyan */
  --terminal-color-15: #333333; /* Bright White */
}

/* Rosé Pine - Soho vibes */
[data-theme='rose-pine'] {
  --terminal-bg: #191724;
  --terminal-bg-alt: #1f1d2e;
  --terminal-fg: #e0def4;
  --terminal-fg-dim: #908caa;
  --terminal-accent: #c4a7e7;
  --terminal-accent-dim: rgba(196, 167, 231, 0.3);
  --terminal-accent-alt: #ebbcba;
  --terminal-border: #6e6a86;
  --terminal-success: #9ccfd8;
  --terminal-warning: #f6c177;
  --terminal-error: #eb6f92;
  --terminal-selection: #6e6a8633;

  /* Standard colors - Official Rosé Pine values */
  --terminal-color-0: #191724; /* Black (base) */
  --terminal-color-1: #eb6f92; /* Red (love) */
  --terminal-color-2: #9ccfd8; /* Green (foam) */
  --terminal-color-3: #f6c177; /* Yellow (gold) */
  --terminal-color-4: #3e8fb0; /* Blue (pine) */
  --terminal-color-5: #c4a7e7; /* Magenta (iris) */
  --terminal-color-6: #ebbcba; /* Cyan (rose) */
  --terminal-color-7: #e0def4; /* White (text) */

  /* Bright colors - Official Rosé Pine values */
  --terminal-color-8: #26233a; /* Bright Black (overlay) */
  --terminal-color-9: #eb6f92; /* Bright Red (love) */
  --terminal-color-10: #9ccfd8; /* Bright Green (foam) */
  --terminal-color-11: #f6c177; /* Bright Yellow (gold) */
  --terminal-color-12: #31748f; /* Bright Blue (pine dark) */
  --terminal-color-13: #c4a7e7; /* Bright Magenta (iris) */
  --terminal-color-14: #ebbcba; /* Bright Cyan (rose) */
  --terminal-color-15: #e0def4; /* Bright White (text) */
}

/* Rosé Pine Dawn - Light theme with warm tones */
[data-theme='rose-pine-dawn'] {
  --terminal-bg: #faf4ed;
  --terminal-bg-alt: #fffaf3;
  --terminal-fg: #575279;
  --terminal-fg-dim: #797593;
  --terminal-accent: #907aa9;
  --terminal-accent-dim: rgba(144, 122, 169, 0.3);
  --terminal-accent-alt: #d7827e;
  --terminal-border: #cecacd;
  --terminal-success: #56949f;
  --terminal-warning: #ea9d34;
  --terminal-error: #b4637a;
  --terminal-selection: #6e6a8614;

  /* Standard colors - Official Rosé Pine Dawn values */
  --terminal-color-0: #faf4ed; /* Black (base) */
  --terminal-color-1: #b4637a; /* Red (love) */
  --terminal-color-2: #56949f; /* Green (foam) */
  --terminal-color-3: #ea9d34; /* Yellow (gold) */
  --terminal-color-4: #286983; /* Blue (pine) */
  --terminal-color-5: #907aa9; /* Magenta (iris) */
  --terminal-color-6: #d7827e; /* Cyan (rose) */
  --terminal-color-7: #575279; /* White (text) */

  /* Bright colors - Official Rosé Pine Dawn values */
  --terminal-color-8: #f2e9e1; /* Bright Black (surface) */
  --terminal-color-9: #b4637a; /* Bright Red (love) */
  --terminal-color-10: #56949f; /* Bright Green (foam) */
  --terminal-color-11: #ea9d34; /* Bright Yellow (gold) */
  --terminal-color-12: #286983; /* Bright Blue (pine) */
  --terminal-color-13: #907aa9; /* Bright Magenta (iris) */
  --terminal-color-14: #d7827e; /* Bright Cyan (rose) */
  --terminal-color-15: #575279; /* Bright White (text) */
}

/* Rosé Pine Moon - Softer dark theme */
[data-theme='rose-pine-moon'] {
  --terminal-bg: #232136;
  --terminal-bg-alt: #2a273f;
  --terminal-fg: #e0def4;
  --terminal-fg-dim: #908caa;
  --terminal-accent: #c4a7e7;
  --terminal-accent-dim: rgba(196, 167, 231, 0.3);
  --terminal-accent-alt: #ebbcba;
  --terminal-border: #6e6a86;
  --terminal-success: #9ccfd8;
  --terminal-warning: #f6c177;
  --terminal-error: #eb6f92;
  --terminal-selection: #817c9c26;

  /* Standard colors - Official Rosé Pine Moon values */
  --terminal-color-0: #232136; /* Black (base) */
  --terminal-color-1: #eb6f92; /* Red (love) */
  --terminal-color-2: #9ccfd8; /* Green (foam) */
  --terminal-color-3: #f6c177; /* Yellow (gold) */
  --terminal-color-4: #3e8fb0; /* Blue (pine) */
  --terminal-color-5: #c4a7e7; /* Magenta (iris) */
  --terminal-color-6: #ebbcba; /* Cyan (rose) */
  --terminal-color-7: #e0def4; /* White (text) */

  /* Bright colors - Official Rosé Pine Moon values */
  --terminal-color-8: #393552; /* Bright Black (overlay) */
  --terminal-color-9: #eb6f92; /* Bright Red (love) */
  --terminal-color-10: #9ccfd8; /* Bright Green (foam) */
  --terminal-color-11: #f6c177; /* Bright Yellow (gold) */
  --terminal-color-12: #3e8fb0; /* Bright Blue (pine) */
  --terminal-color-13: #c4a7e7; /* Bright Magenta (iris) */
  --terminal-color-14: #ebbcba; /* Bright Cyan (rose) */
  --terminal-color-15: #e0def4; /* Bright White (text) */
}

/* Tokyo Night - Classic dark theme */
[data-theme='tokyo-night'] {
  /* Core background/foreground colors */
  --terminal-bg: #1a1b26; /* Night background */
  --terminal-bg-alt: #16161e; /* Dark background */
  --terminal-fg: #c0caf5; /* Primary foreground */
  --terminal-fg-dim: #a9b1d6; /* Dimmed foreground */

  /* Accent and UI colors */
  --terminal-accent: #7aa2f7; /* Blue accent */
  --terminal-accent-dim: #3d59a1; /* Dimmed blue */
  --terminal-accent-alt: #bb9af7; /* Magenta accent */
  --terminal-border: #3b4261; /* Border color */

  /* Status colors */
  --terminal-success: #9ece6a; /* Green */
  --terminal-warning: #e0af68; /* Yellow */
  --terminal-error: #f7768e; /* Red */
  --terminal-selection: #515c7e4d;

  /* Terminal ANSI colors */
  --terminal-color-0: #15161e; /* Black */
  --terminal-color-1: #f7768e; /* Red */
  --terminal-color-2: #9ece6a; /* Green */
  --terminal-color-3: #e0af68; /* Yellow */
  --terminal-color-4: #7aa2f7; /* Blue */
  --terminal-color-5: #bb9af7; /* Magenta */
  --terminal-color-6: #7dcfff; /* Cyan */
  --terminal-color-7: #a9b1d6; /* White */
  --terminal-color-8: #414868; /* Bright Black */
  --terminal-color-9: #ff899d; /* Bright Red */
  --terminal-color-10: #9fe044; /* Bright Green */
  --terminal-color-11: #faba4a; /* Bright Yellow */
  --terminal-color-12: #8db0ff; /* Bright Blue */
  --terminal-color-13: #c7a9ff; /* Bright Magenta */
  --terminal-color-14: #a4daff; /* Bright Cyan */
  --terminal-color-15: #c0caf5; /* Bright White */
}

/* Tokyo Night Storm - Lighter variant */
[data-theme='tokyo-night-storm'] {
  /* Core background/foreground colors */
  --terminal-bg: #24283b; /* Storm background */
  --terminal-bg-alt: #1f2335; /* Dark background */
  --terminal-fg: #c0caf5; /* Primary foreground */
  --terminal-fg-dim: #a9b1d6; /* Dimmed foreground */

  /* Accent and UI colors */
  --terminal-accent: #7aa2f7; /* Blue accent */
  --terminal-accent-dim: #3d59a1; /* Dimmed blue */
  --terminal-accent-alt: #bb9af7; /* Magenta accent */
  --terminal-border: #3b4261; /* Border color */

  /* Status colors */
  --terminal-success: #9ece6a; /* Green */
  --terminal-warning: #e0af68; /* Yellow */
  --terminal-error: #f7768e; /* Red */
  --terminal-selection: #6f7bb640;

  /* Terminal ANSI colors */
  --terminal-color-0: #1d202f; /* Black */
  --terminal-color-1: #f7768e; /* Red */
  --terminal-color-2: #9ece6a; /* Green */
  --terminal-color-3: #e0af68; /* Yellow */
  --terminal-color-4: #7aa2f7; /* Blue */
  --terminal-color-5: #bb9af7; /* Magenta */
  --terminal-color-6: #7dcfff; /* Cyan */
  --terminal-color-7: #a9b1d6; /* White */
  --terminal-color-8: #414868; /* Bright Black */
  --terminal-color-9: #ff899d; /* Bright Red */
  --terminal-color-10: #9fe044; /* Bright Green */
  --terminal-color-11: #faba4a; /* Bright Yellow */
  --terminal-color-12: #8db0ff; /* Bright Blue */
  --terminal-color-13: #c7a9ff; /* Bright Magenta */
  --terminal-color-14: #a4daff; /* Bright Cyan */
  --terminal-color-15: #c0caf5; /* Bright White */
}

/* Bubblegum - Pink-themed light mode */
[data-theme='bubblegum'] {
  /* Core background/foreground colors */
  --terminal-bg: #f9f9f9; /* Light background */
  --terminal-bg-alt: #eaf5fa; /* Alternative light blue */
  --terminal-fg: #000000; /* Black foreground */
  --terminal-fg-dim: #666666; /* Dimmed text */

  /* Accent and UI colors */
  --terminal-accent: #fa4fb8; /* Pink accent */
  --terminal-accent-dim: #e048a6; /* Dimmed pink */
  --terminal-accent-alt: #f8a8d9; /* Light pink */
  --terminal-border: #dcf2ff; /* Light blue border */

  /* Status colors */
  --terminal-success: #00c853; /* Green success (approve) */
  --terminal-warning: #2196f3; /* Blue for needs_approval/opus */
  --terminal-error: #d50000; /* Red error (deny) */
  --terminal-selection: #fa4fb81a;

  /* Terminal ANSI colors - Same as dark for consistency */
  --terminal-color-0: #000000; /* Black */
  --terminal-color-1: #cd3131; /* Red */
  --terminal-color-2: #0dbc79; /* Green */
  --terminal-color-3: #e5e510; /* Yellow */
  --terminal-color-4: #2472c8; /* Blue */
  --terminal-color-5: #bc3fbc; /* Magenta */
  --terminal-color-6: #11a8cd; /* Cyan */
  --terminal-color-7: #e5e5e5; /* White */
  --terminal-color-8: #666666; /* Bright Black */
  --terminal-color-9: #f14c4c; /* Bright Red */
  --terminal-color-10: #23d18b; /* Bright Green */
  --terminal-color-11: #f5f543; /* Bright Yellow */
  --terminal-color-12: #3b8eea; /* Bright Blue */
  --terminal-color-13: #d670d6; /* Bright Magenta */
  --terminal-color-14: #29b8db; /* Bright Cyan */
  --terminal-color-15: #e5e5e5; /* Bright White */
}

/* L33t - Classic hacker terminal theme */
[data-theme='l33t'] {
  /* Core background/foreground colors */
  --terminal-bg: #070e0a; /* Dark green background */
  --terminal-bg-alt: #0c1712; /* Slightly lighter dark green */
  --terminal-fg: #00ff41; /* Bright phosphor green */
  --terminal-fg-dim: #ffffff; /* White for labels/secondary text */

  /* Accent and UI colors */
  --terminal-accent: #00ff41; /* Bright phosphor green - main accent */
  --terminal-accent-dim: #a0a0a0; /* Gray for inline code/secondary */
  --terminal-accent-alt: #008822; /* Dark forest green - alternative */
  --terminal-border: #00ff41; /* Green border */

  /* Status colors */
  --terminal-success: #00ff41; /* Bright green success */
  --terminal-warning: #ffaa00; /* Amber warning */
  --terminal-error: #ff4444; /* Red error */
  --terminal-selection: #00ff4133;

  /* Terminal ANSI colors - Mix of green, white, and grays */
  --terminal-color-0: #0a1510; /* Black (dark green) */
  --terminal-color-1: #ff4444; /* Red */
  --terminal-color-2: #00ff41; /* Green */
  --terminal-color-3: #ffff00; /* Yellow */
  --terminal-color-4: #4a90e2; /* Blue */
  --terminal-color-5: #b8b8b8; /* Magenta (gray for code) */
  --terminal-color-6: #00ffaa; /* Cyan */
  --terminal-color-7: #d0d0d0; /* White (light gray) */
  --terminal-color-8: #606060; /* Bright Black (medium gray) */
  --terminal-color-9: #ff6666; /* Bright Red */
  --terminal-color-10: #40ff60; /* Bright Green */
  --terminal-color-11: #ffff66; /* Bright Yellow */
  --terminal-color-12: #6bb6ff; /* Bright Blue */
  --terminal-color-13: #e0e0e0; /* Bright Magenta (light gray for code) */
  --terminal-color-14: #66ffcc; /* Bright Cyan */
  --terminal-color-15: #ffffff; /* Bright White */
}

/* Vesper - Official theme colors */
[data-theme='vesper'] {
  /* Core background/foreground colors */
  --terminal-bg: #101010; /* Black background */
  --terminal-bg-alt: #505050; /* Darker variant (using bright black) */
  --terminal-fg: #ffffff; /* White foreground */
  --terminal-fg-dim: #a0a0a0; /* Dimmed text (using blue as gray) */

  /* Accent and UI colors */
  --terminal-accent: #ffc799; /* Yellow accent */
  --terminal-accent-dim: rgba(255, 199, 153, 0.3); /* Dimmed yellow */
  --terminal-accent-alt: #99ffe4; /* Cyan accent alternative */
  --terminal-border: #505050; /* Border using bright black */

  /* Status colors */
  --terminal-success: #99ffe4; /* Green/Cyan */
  --terminal-warning: #ffc799; /* Yellow */
  --terminal-error: #ff8080; /* Red */
  --terminal-selection: #ffc79933;

  /* Terminal ANSI colors - Official Vesper palette */
  --terminal-color-0: #101010; /* Black */
  --terminal-color-1: #ff8080; /* Red */
  --terminal-color-2: #99ffe4; /* Green */
  --terminal-color-3: #ffc799; /* Yellow */
  --terminal-color-4: #a0a0a0; /* Blue (gray) */
  --terminal-color-5: #ff7300; /* Magenta (orange) */
  --terminal-color-6: #99ffe4; /* Cyan */
  --terminal-color-7: #ffffff; /* White */
  --terminal-color-8: #505050; /* Bright Black */
  --terminal-color-9: #ff8080; /* Bright Red */
  --terminal-color-10: #99ffe4; /* Bright Green */
  --terminal-color-11: #ffcfa8; /* Bright Yellow */
  --terminal-color-12: #a0a0a0; /* Bright Blue (gray) */
  --terminal-color-13: #ff8080; /* Bright Magenta (red) */
  --terminal-color-14: #99ffe4; /* Bright Cyan */
  --terminal-color-15: #ffffff; /* Bright White */
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }

  body {
    @apply bg-background text-foreground;
    font-family: 'IBM Plex Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
  }

  /* Global text selection styling */
  ::selection {
    background-color: var(--terminal-selection);
    color: var(--terminal-fg);
  }

  /* Terminal styling for all elements */
  input,
  textarea,
  select,
  button {
    font-family: inherit;
  }

  /* Pulsing animation for incomplete events */
  @keyframes pulse-warning {
    0%,
    100% {
      opacity: 1;
      color: var(--terminal-warning);
    }
    50% {
      opacity: 0.5;
      color: var(--terminal-warning);
    }
  }

  .pulse-warning {
    animation: pulse-warning 2s ease-in-out infinite;
  }

  .animate-pulse-warning {
    animation: pulse-warning 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* Pulsing animation for yolo mode */
  @keyframes pulse-error {
    0%,
    100% {
      opacity: 1;
      color: var(--terminal-error);
    }
    50% {
      opacity: 0.5;
      color: var(--terminal-error);
    }
  }

  .animate-pulse-error {
    animation: pulse-error 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* Custom spinner animations */
  @keyframes spin-reverse {
    from {
      transform: rotate(360deg);
    }
    to {
      transform: rotate(0deg);
    }
  }

  @keyframes spin-slow {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }

  @keyframes morph {
    0%,
    100% {
      border-radius: 50%;
      transform: scale(1) rotate(0deg);
    }
    25% {
      border-radius: 40%;
      transform: scale(1.15) rotate(90deg);
    }
    50% {
      border-radius: 30%;
      transform: scale(0.85) rotate(180deg);
    }
    75% {
      border-radius: 45%;
      transform: scale(1.1) rotate(270deg);
    }
  }

  @keyframes wave {
    0%,
    100% {
      transform: translateX(-100%) translateY(-100%) rotate(0deg);
    }
    25% {
      transform: translateX(0%) translateY(-100%) rotate(90deg);
    }
    50% {
      transform: translateX(0%) translateY(0%) rotate(180deg);
    }
    75% {
      transform: translateX(-100%) translateY(0%) rotate(270deg);
    }
  }

  @keyframes pulse-bright {
    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.8;
      transform: scale(1.2);
    }
  }

  @keyframes fade-pulse {
    0%,
    100% {
      opacity: 0.8;
    }
    50% {
      opacity: 0.4;
    }
  }

  @keyframes glitch {
    0%,
    90%,
    100% {
      clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
      transform: translate(0);
    }
    93% {
      clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
      transform: translate(-2px, 2px);
    }
    96% {
      clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
      transform: translate(2px, -2px);
    }
  }

  @keyframes slide-in-up {
    0% {
      visibility: visible;
      transform: translate3d(0, 100%, 0);
    }
    100% {
      transform: translate3d(0, 0, 0);
    }
  }

  @keyframes slide-out-down {
    0% {
      visibility: visible;
      transform: translate3d(0, 0, 0);
    }
    100% {
      transform: translate3d(0, 100%, 0);
    }
  }

  .animate-slide-in-up {
    animation: slide-in-up 1s ease-in-out 0.25s 1;
  }

  .animate-slide-out-down {
    animation: slide-out-down 1s ease-in-out 0.25s 1;
  }

  .animate-spin-reverse {
    animation: spin-reverse 3s linear infinite;
  }

  .animate-spin-slow {
    animation: spin-slow 8s linear infinite;
  }

  .animate-morph {
    animation: morph 4s ease-in-out infinite;
  }

  .animate-wave {
    animation: wave 6s ease-in-out infinite;
  }

  .animate-pulse-bright {
    animation: pulse-bright 1.5s ease-in-out infinite;
  }

  .animate-fade-pulse {
    animation: fade-pulse 2s ease-in-out infinite;
  }

  .animate-glitch {
    animation: glitch 5s linear infinite;
  }

  /* Gradient utilities for conic and radial gradients */
  .bg-gradient-conic {
    background: conic-gradient(var(--tw-gradient-stops));
  }

  .bg-gradient-radial {
    background: radial-gradient(circle, var(--tw-gradient-stops));
  }

  /* Animation delays */
  .delay-75 {
    animation-delay: 75ms;
  }

  .delay-150 {
    animation-delay: 150ms;
  }

  .delay-300 {
    animation-delay: 300ms;
  }

  /* Bouncing animations for bars spinner */
  @keyframes bounce-slow {
    0%,
    100% {
      transform: scaleY(1);
    }
    50% {
      transform: scaleY(1.5);
    }
  }

  @keyframes bounce-medium {
    0%,
    100% {
      transform: scaleY(1);
    }
    50% {
      transform: scaleY(1.8);
    }
  }

  @keyframes bounce-fast {
    0%,
    100% {
      transform: scaleY(1);
    }
    50% {
      transform: scaleY(2);
    }
  }

  .animate-bounce-slow {
    animation: bounce-slow 1.4s ease-in-out infinite;
  }

  .animate-bounce-medium {
    animation: bounce-medium 1s ease-in-out infinite;
  }

  .animate-bounce-fast {
    animation: bounce-fast 0.8s ease-in-out infinite;
  }
}
