/* ============================================================================
   PLAYGROUND COMPLETE CSS REWRITE - THEME SYSTEM
   ============================================================================ */

/* ============================================================================
   CSS VARIABLES - THEME SYSTEM
   ============================================================================ */

/* DEFAULT THEME (Light) */
:root,
[data-theme="light"] {
  /* Colors */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  
  /* Text */
  --color-text-primary: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #ffffff;
  
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-navbar: linear-gradient(135deg, #f8fafc 0%, #eef2f5 100%);
  --bg-sidebar: #f8fafc;
  --bg-editor: #ffffff;
  --bg-terminal: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e0e7ff;
  --bg-loading: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-footer: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --footer-text-color: #ffffff;
  
  /* Borders */
  --border-color: #e2e8f0;
  --border-color-light: #f1f5f9;
  --border-color-hover: #cbd5e1;
  --border-radius: 8px;
  --border-radius-sm: 6px;
  --border-radius-lg: 12px;
  
  /* 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);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  
  /* Specific Elements */
  --navbar-height: 56px;
  --sidebar-bg: #f8fafc;
  --editor-placeholder-bg: #fafafa;
  --tab-bg: #f1f5f9;
  --tab-active-bg: #ffffff;
  --terminal-system-bg: #f8fafc;
  --terminal-output-bg: #ffffff;
}

/* DARK THEME */
[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-accent: #fbbf24;
  --color-success: #34d399;
  --color-danger: #f87171;
  --color-warning: #fbbf24;
  
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-tertiary: #94a3b8;
  --color-text-inverse: #1e293b;
  
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-elevated: #1e293b;
  --bg-navbar: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --bg-sidebar: #1e293b;
  --bg-editor: #0f172a;
  --bg-terminal: #0f172a;
  --bg-hover: #334155;
  --bg-active: #475569;
  --bg-loading: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  --bg-footer: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  --footer-text-color: #f1f5f9;
  
  --border-color: #334155;
  --border-color-light: #475569;
  --border-color-hover: #475569;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
  
  --sidebar-bg: #1e293b;
  --editor-placeholder-bg: #1e293b;
  --tab-bg: #334155;
  --tab-active-bg: #0f172a;
  --terminal-system-bg: #1e293b;
  --terminal-output-bg: #0f172a;
}

/* DRACULA THEME */
[data-theme="dracula"] {
  --color-primary: #bd93f9;
  --color-primary-hover: #d4b5ff;
  --color-accent: #f1fa8c;
  --color-success: #50fa7b;
  --color-danger: #ff5555;
  --color-warning: #ffb86c;
  
  --color-text-primary: #f8f8f2;
  --color-text-secondary: #8be9fd;
  --color-text-tertiary: #6272a4;
  --color-text-inverse: #282a36;
  
  --bg-primary: #282a36;
  --bg-secondary: #21222c;
  --bg-tertiary: #44475a;
  --bg-elevated: #282a36;
  --bg-navbar: linear-gradient(135deg, #282a36 0%, #21222c 100%);
  --bg-sidebar: #21222c;
  --bg-editor: #282a36;
  --bg-terminal: #282a36;
  --bg-hover: #44475a;
  --bg-active: #6272a4;
  --bg-loading: linear-gradient(135deg, #bd93f9 0%, #ff79c6 100%);
  --bg-footer: linear-gradient(135deg, #bd93f9 0%, #ff79c6 100%);
  --footer-text-color: #f8f8f2;
  
  --border-color: #44475a;
  --border-color-light: #6272a4;
  --border-color-hover: #6272a4;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #21222c;
  --editor-placeholder-bg: #282a36;
  --tab-bg: #44475a;
  --tab-active-bg: #282a36;
  --terminal-system-bg: #21222c;
  --terminal-output-bg: #282a36;
}

/* MONOKAI THEME */
[data-theme="monokai"] {
  --color-primary: #66d9ef;
  --color-primary-hover: #81dff2;
  --color-accent: #e6db74;
  --color-success: #a6e22e;
  --color-danger: #f92672;
  --color-warning: #fd971f;
  
  --color-text-primary: #f8f8f2;
  --color-text-secondary: #75715e;
  --color-text-tertiary: #49483e;
  --color-text-inverse: #272822;
  
  --bg-primary: #272822;
  --bg-secondary: #1e1f1c;
  --bg-tertiary: #3e3d32;
  --bg-elevated: #272822;
  --bg-navbar: linear-gradient(135deg, #272822 0%, #1e1f1c 100%);
  --bg-sidebar: #1e1f1c;
  --bg-editor: #272822;
  --bg-terminal: #272822;
  --bg-hover: #3e3d32;
  --bg-active: #49483e;
  --bg-loading: linear-gradient(135deg, #66d9ef 0%, #a6e22e 100%);
  --bg-footer: linear-gradient(135deg, #66d9ef 0%, #a6e22e 100%);
  --footer-text-color: #f8f8f2;
  
  --border-color: #3e3d32;
  --border-color-light: #49483e;
  --border-color-hover: #75715e;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.8);
  
  --sidebar-bg: #1e1f1c;
  --editor-placeholder-bg: #272822;
  --tab-bg: #3e3d32;
  --tab-active-bg: #272822;
  --terminal-system-bg: #1e1f1c;
  --terminal-output-bg: #272822;
}

/* SOLARIZED DARK THEME */
[data-theme="solarized-dark"] {
  --color-primary: #268bd2;
  --color-primary-hover: #2aa198;
  --color-accent: #b58900;
  --color-success: #859900;
  --color-danger: #dc322f;
  --color-warning: #cb4b16;
  
  --color-text-primary: #839496;
  --color-text-secondary: #586e75;
  --color-text-tertiary: #073642;
  --color-text-inverse: #002b36;
  
  --bg-primary: #002b36;
  --bg-secondary: #073642;
  --bg-tertiary: #586e75;
  --bg-elevated: #002b36;
  --bg-navbar: linear-gradient(135deg, #073642 0%, #002b36 100%);
  --bg-sidebar: #073642;
  --bg-editor: #002b36;
  --bg-terminal: #002b36;
  --bg-hover: #586e75;
  --bg-active: #657b83;
  --bg-loading: linear-gradient(135deg, #268bd2 0%, #2aa198 100%);
  --bg-footer: linear-gradient(135deg, #268bd2 0%, #2aa198 100%);
  --footer-text-color: #839496;
  
  --border-color: #073642;
  --border-color-light: #586e75;
  --border-color-hover: #657b83;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #073642;
  --editor-placeholder-bg: #002b36;
  --tab-bg: #586e75;
  --tab-active-bg: #002b36;
  --terminal-system-bg: #073642;
  --terminal-output-bg: #002b36;
}

/* SOLARIZED LIGHT THEME */
[data-theme="solarized-light"] {
  --color-primary: #268bd2;
  --color-primary-hover: #2aa198;
  --color-accent: #b58900;
  --color-success: #859900;
  --color-danger: #dc322f;
  --color-warning: #cb4b16;
  
  --color-text-primary: #073642;
  --color-text-secondary: #586e75;
  --color-text-tertiary: #93a1a1;
  --color-text-inverse: #fdf6e3;
  
  --bg-primary: #fdf6e3;
  --bg-secondary: #eee8d5;
  --bg-tertiary: #e4dcc8;
  --bg-elevated: #fdf6e3;
  --bg-navbar: linear-gradient(135deg, #fdf6e3 0%, #eee8d5 100%);
  --bg-sidebar: #eee8d5;
  --bg-editor: #fdf6e3;
  --bg-terminal: #fdf6e3;
  --bg-hover: #e4dcc8;
  --bg-active: #d6cfb8;
  --bg-loading: linear-gradient(135deg, #268bd2 0%, #2aa198 100%);
  --bg-footer: linear-gradient(135deg, #268bd2 0%, #2aa198 100%);
  --footer-text-color: #fdf6e3;
  
  --border-color: #d3c5a5;
  --border-color-light: #e4dcc8;
  --border-color-hover: #93a1a1;
  
  --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);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  
  --sidebar-bg: #eee8d5;
  --editor-placeholder-bg: #fdf6e3;
  --tab-bg: #e4dcc8;
  --tab-active-bg: #fdf6e3;
  --terminal-system-bg: #eee8d5;
  --terminal-output-bg: #fdf6e3;
}

/* GITHUB DARK THEME */
[data-theme="github-dark"] {
  --color-primary: #58a6ff;
  --color-primary-hover: #79c0ff;
  --color-accent: #f0883e;
  --color-success: #3fb950;
  --color-danger: #f85149;
  --color-warning: #d29922;
  
  --color-text-primary: #c9d1d9;
  --color-text-secondary: #8b949e;
  --color-text-tertiary: #6e7681;
  --color-text-inverse: #0d1117;
  
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-elevated: #161b22;
  --bg-navbar: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
  --bg-sidebar: #161b22;
  --bg-editor: #0d1117;
  --bg-terminal: #0d1117;
  --bg-hover: #21262d;
  --bg-active: #30363d;
  --bg-loading: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%);
  --bg-footer: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%);
  --footer-text-color: #c9d1d9;
  
  --border-color: #30363d;
  --border-color-light: #21262d;
  --border-color-hover: #6e7681;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #161b22;
  --editor-placeholder-bg: #0d1117;
  --tab-bg: #21262d;
  --tab-active-bg: #0d1117;
  --terminal-system-bg: #161b22;
  --terminal-output-bg: #0d1117;
}

/* ONE DARK THEME */
[data-theme="one-dark"] {
  --color-primary: #61afef;
  --color-primary-hover: #84c0f4;
  --color-accent: #d19a66;
  --color-success: #98c379;
  --color-danger: #e06c75;
  --color-warning: #e5c07b;
  
  --color-text-primary: #abb2bf;
  --color-text-secondary: #5c6370;
  --color-text-tertiary: #3e4451;
  --color-text-inverse: #282c34;
  
  --bg-primary: #282c34;
  --bg-secondary: #21252b;
  --bg-tertiary: #2c313c;
  --bg-elevated: #282c34;
  --bg-navbar: linear-gradient(135deg, #282c34 0%, #21252b 100%);
  --bg-sidebar: #21252b;
  --bg-editor: #282c34;
  --bg-terminal: #282c34;
  --bg-hover: #2c313c;
  --bg-active: #3e4451;
  --bg-loading: linear-gradient(135deg, #61afef 0%, #98c379 100%);
  --bg-footer: linear-gradient(135deg, #61afef 0%, #98c379 100%);
  --footer-text-color: #abb2bf;
  
  --border-color: #181a1f;
  --border-color-light: #2c313c;
  --border-color-hover: #3e4451;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #21252b;
  --editor-placeholder-bg: #282c34;
  --tab-bg: #2c313c;
  --tab-active-bg: #282c34;
  --terminal-system-bg: #21252b;
  --terminal-output-bg: #282c34;
}

/* NORD THEME */
[data-theme="nord"] {
  --color-primary: #88c0d0;
  --color-primary-hover: #8fbcbb;
  --color-accent: #ebcb8b;
  --color-success: #a3be8c;
  --color-danger: #bf616a;
  --color-warning: #d08770;
  
  --color-text-primary: #d8dee9;
  --color-text-secondary: #4c566a;
  --color-text-tertiary: #3b4252;
  --color-text-inverse: #2e3440;
  
  --bg-primary: #2e3440;
  --bg-secondary: #3b4252;
  --bg-tertiary: #434c5e;
  --bg-elevated: #2e3440;
  --bg-navbar: linear-gradient(135deg, #3b4252 0%, #2e3440 100%);
  --bg-sidebar: #3b4252;
  --bg-editor: #2e3440;
  --bg-terminal: #2e3440;
  --bg-hover: #434c5e;
  --bg-active: #4c566a;
  --bg-loading: linear-gradient(135deg, #88c0d0 0%, #a3be8c 100%);
  --bg-footer: linear-gradient(135deg, #88c0d0 0%, #a3be8c 100%);
  --footer-text-color: #d8dee9;
  
  --border-color: #434c5e;
  --border-color-light: #4c566a;
  --border-color-hover: #4c566a;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #3b4252;
  --editor-placeholder-bg: #2e3440;
  --tab-bg: #434c5e;
  --tab-active-bg: #2e3440;
  --terminal-system-bg: #3b4252;
  --terminal-output-bg: #2e3440;
}

/* MATERIAL THEME */
[data-theme="material"] {
  --color-primary: #82aaff;
  --color-primary-hover: #a3c7ff;
  --color-accent: #ffcb6b;
  --color-success: #c3e88d;
  --color-danger: #f07178;
  --color-warning: #f78c6c;
  
  --color-text-primary: #eeffff;
  --color-text-secondary: #616e88;
  --color-text-tertiary: #37474f;
  --color-text-inverse: #263238;
  
  --bg-primary: #263238;
  --bg-secondary: #1e272e;
  --bg-tertiary: #37474f;
  --bg-elevated: #263238;
  --bg-navbar: linear-gradient(135deg, #263238 0%, #1e272e 100%);
  --bg-sidebar: #1e272e;
  --bg-editor: #263238;
  --bg-terminal: #263238;
  --bg-hover: #37474f;
  --bg-active: #546e7a;
  --bg-loading: linear-gradient(135deg, #82aaff 0%, #c3e88d 100%);
  --bg-footer: linear-gradient(135deg, #82aaff 0%, #c3e88d 100%);
  --footer-text-color: #eeffff;
  
  --border-color: #37474f;
  --border-color-light: #546e7a;
  --border-color-hover: #546e7a;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.8);
  
  --sidebar-bg: #1e272e;
  --editor-placeholder-bg: #263238;
  --tab-bg: #37474f;
  --tab-active-bg: #263238;
  --terminal-system-bg: #1e272e;
  --terminal-output-bg: #263238;
}

/* HIGH CONTRAST THEME */
[data-theme="high-contrast"] {
  --color-primary: #00ffff;
  --color-primary-hover: #00cccc;
  --color-accent: #ffff00;
  --color-success: #00ff00;
  --color-danger: #ff0000;
  --color-warning: #ffaa00;
  
  --color-text-primary: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-tertiary: #999999;
  --color-text-inverse: #000000;
  
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #000000;
  --bg-navbar: linear-gradient(135deg, #0a0a0a 0%, #000000 100%);
  --bg-sidebar: #0a0a0a;
  --bg-editor: #000000;
  --bg-terminal: #000000;
  --bg-hover: #1a1a1a;
  --bg-active: #333333;
  --bg-loading: linear-gradient(135deg, #00ffff 0%, #00ff00 100%);
  --bg-footer: linear-gradient(135deg, #00ffff 0%, #00ff00 100%);
  --footer-text-color: #000000;
  
  --border-color: #ffffff;
  --border-color-light: #cccccc;
  --border-color-hover: #ffffff;
  
  --shadow-sm: 0 0 2px rgba(255, 255, 255, 0.5);
  --shadow-md: 0 0 6px rgba(255, 255, 255, 0.6);
  --shadow-lg: 0 0 15px rgba(255, 255, 255, 0.7);
  --shadow-xl: 0 0 25px rgba(255, 255, 255, 0.8);
  
  --sidebar-bg: #0a0a0a;
  --editor-placeholder-bg: #000000;
  --tab-bg: #1a1a1a;
  --tab-active-bg: #000000;
  --terminal-system-bg: #0a0a0a;
  --terminal-output-bg: #000000;
}

/* GITHUB LIGHT THEME */
[data-theme="github-light"] {
  --color-primary: #0969da;
  --color-primary-hover: #0550ae;
  --color-accent: #bf8700;
  --color-success: #1a7f37;
  --color-danger: #cf222e;
  --color-warning: #9a6700;
  
  --color-text-primary: #24292f;
  --color-text-secondary: #57606a;
  --color-text-tertiary: #8c959f;
  --color-text-inverse: #ffffff;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eaeef2;
  --bg-elevated: #ffffff;
  --bg-navbar: linear-gradient(135deg, #f6f8fa 0%, #eaeef2 100%);
  --bg-sidebar: #f6f8fa;
  --bg-editor: #ffffff;
  --bg-terminal: #ffffff;
  --bg-hover: #eaeef2;
  --bg-active: #ddf4ff;
  --bg-loading: linear-gradient(135deg, #0969da 0%, #1a7f37 100%);
  --bg-footer: linear-gradient(135deg, #0969da 0%, #1a7f37 100%);
  --footer-text-color: #ffffff;
  
  --border-color: #d0d7de;
  --border-color-light: #eaeef2;
  --border-color-hover: #8c959f;
  
  --shadow-sm: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow-md: 0 3px 6px rgba(140, 149, 159, 0.15);
  --shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.2);
  --shadow-xl: 0 12px 28px rgba(140, 149, 159, 0.3);
  
  --sidebar-bg: #f6f8fa;
  --editor-placeholder-bg: #ffffff;
  --tab-bg: #eaeef2;
  --tab-active-bg: #ffffff;
  --terminal-system-bg: #f6f8fa;
  --terminal-output-bg: #ffffff;
}

/* CATPPUCCIN THEME (Mocha) */
[data-theme="catppuccin"] {
  --color-primary: #cba6f7;
  --color-primary-hover: #b4befe;
  --color-accent: #f9e2af;
  --color-success: #a6e3a1;
  --color-danger: #f38ba8;
  --color-warning: #fab387;
  
  --color-text-primary: #cdd6f4;
  --color-text-secondary: #a6adc8;
  --color-text-tertiary: #6c7086;
  --color-text-inverse: #1e1e2e;
  
  --bg-primary: #1e1e2e;
  --bg-secondary: #181825;
  --bg-tertiary: #313244;
  --bg-elevated: #1e1e2e;
  --bg-navbar: linear-gradient(135deg, #181825 0%, #1e1e2e 100%);
  --bg-sidebar: #181825;
  --bg-editor: #1e1e2e;
  --bg-terminal: #1e1e2e;
  --bg-hover: #313244;
  --bg-active: #45475a;
  --bg-loading: linear-gradient(135deg, #cba6f7 0%, #f38ba8 100%);
  --bg-footer: linear-gradient(135deg, #cba6f7 0%, #f38ba8 100%);
  --footer-text-color: #1e1e2e;
  
  --border-color: #313244;
  --border-color-light: #45475a;
  --border-color-hover: #6c7086;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #181825;
  --editor-placeholder-bg: #1e1e2e;
  --tab-bg: #313244;
  --tab-active-bg: #1e1e2e;
  --terminal-system-bg: #181825;
  --terminal-output-bg: #1e1e2e;
}

/* TOKYO NIGHT THEME */
[data-theme="tokyo-night"] {
  --color-primary: #7aa2f7;
  --color-primary-hover: #89b4fa;
  --color-accent: #e0af68;
  --color-success: #9ece6a;
  --color-danger: #f7768e;
  --color-warning: #ff9e64;
  
  --color-text-primary: #c0caf5;
  --color-text-secondary: #9aa5ce;
  --color-text-tertiary: #565f89;
  --color-text-inverse: #1a1b26;
  
  --bg-primary: #1a1b26;
  --bg-secondary: #16161e;
  --bg-tertiary: #24283b;
  --bg-elevated: #1a1b26;
  --bg-navbar: linear-gradient(135deg, #16161e 0%, #1a1b26 100%);
  --bg-sidebar: #16161e;
  --bg-editor: #1a1b26;
  --bg-terminal: #1a1b26;
  --bg-hover: #24283b;
  --bg-active: #414868;
  --bg-loading: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
  --bg-footer: linear-gradient(135deg, #7aa2f7 0%, #bb9af7 100%);
  --footer-text-color: #c0caf5;
  
  --border-color: #24283b;
  --border-color-light: #414868;
  --border-color-hover: #565f89;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #16161e;
  --editor-placeholder-bg: #1a1b26;
  --tab-bg: #24283b;
  --tab-active-bg: #1a1b26;
  --terminal-system-bg: #16161e;
  --terminal-output-bg: #1a1b26;
}

/* AYU DARK THEME */
[data-theme="ayu-dark"] {
  --color-primary: #e6b450;
  --color-primary-hover: #ffb454;
  --color-accent: #ff8f40;
  --color-success: #7fd962;
  --color-danger: #d95757;
  --color-warning: #ffb454;
  
  --color-text-primary: #bfbdb6;
  --color-text-secondary: #73b8ff;
  --color-text-tertiary: #565b66;
  --color-text-inverse: #0b0e14;
  
  --bg-primary: #0b0e14;
  --bg-secondary: #0d1017;
  --bg-tertiary: #131721;
  --bg-elevated: #0b0e14;
  --bg-navbar: linear-gradient(135deg, #0d1017 0%, #0b0e14 100%);
  --bg-sidebar: #0d1017;
  --bg-editor: #0b0e14;
  --bg-terminal: #0b0e14;
  --bg-hover: #131721;
  --bg-active: #1d222c;
  --bg-loading: linear-gradient(135deg, #e6b450 0%, #ff8f40 100%);
  --bg-footer: linear-gradient(135deg, #e6b450 0%, #ff8f40 100%);
  --footer-text-color: #0b0e14;
  
  --border-color: #131721;
  --border-color-light: #1d222c;
  --border-color-hover: #565b66;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.8);
  
  --sidebar-bg: #0d1017;
  --editor-placeholder-bg: #0b0e14;
  --tab-bg: #131721;
  --tab-active-bg: #0b0e14;
  --terminal-system-bg: #0d1017;
  --terminal-output-bg: #0b0e14;
}

/* SYNTHWAVE '84 THEME */
[data-theme="synthwave"] {
  --color-primary: #ff7edb;
  --color-primary-hover: #fede5d;
  --color-accent: #fede5d;
  --color-success: #72f1b8;
  --color-danger: #fe4450;
  --color-warning: #f97e72;
  
  --color-text-primary: #f4eee4;
  --color-text-secondary: #b6b1b1;
  --color-text-tertiary: #848bbd;
  --color-text-inverse: #2b213a;
  
  --bg-primary: #2b213a;
  --bg-secondary: #241b2f;
  --bg-tertiary: #34294f;
  --bg-elevated: #2b213a;
  --bg-navbar: linear-gradient(135deg, #241b2f 0%, #2b213a 100%);
  --bg-sidebar: #241b2f;
  --bg-editor: #2b213a;
  --bg-terminal: #2b213a;
  --bg-hover: #34294f;
  --bg-active: #463465;
  --bg-loading: linear-gradient(135deg, #ff7edb 0%, #fede5d 100%);
  --bg-footer: linear-gradient(135deg, #ff7edb 0%, #fede5d 100%);
  --footer-text-color: #2b213a;
  
  --border-color: #34294f;
  --border-color-light: #463465;
  --border-color-hover: #848bbd;
  
  --shadow-sm: 0 0 10px rgba(255, 126, 219, 0.3);
  --shadow-md: 0 0 20px rgba(255, 126, 219, 0.4);
  --shadow-lg: 0 0 30px rgba(255, 126, 219, 0.5);
  --shadow-xl: 0 0 40px rgba(255, 126, 219, 0.6);
  
  --sidebar-bg: #241b2f;
  --editor-placeholder-bg: #2b213a;
  --tab-bg: #34294f;
  --tab-active-bg: #2b213a;
  --terminal-system-bg: #241b2f;
  --terminal-output-bg: #2b213a;
}

/* GRUVBOX DARK THEME */
[data-theme="gruvbox"] {
  --color-primary: #fabd2f;
  --color-primary-hover: #fe8019;
  --color-accent: #fe8019;
  --color-success: #b8bb26;
  --color-danger: #fb4934;
  --color-warning: #fe8019;
  
  --color-text-primary: #ebdbb2;
  --color-text-secondary: #a89984;
  --color-text-tertiary: #665c54;
  --color-text-inverse: #282828;
  
  --bg-primary: #282828;
  --bg-secondary: #1d2021;
  --bg-tertiary: #3c3836;
  --bg-elevated: #282828;
  --bg-navbar: linear-gradient(135deg, #1d2021 0%, #282828 100%);
  --bg-sidebar: #1d2021;
  --bg-editor: #282828;
  --bg-terminal: #282828;
  --bg-hover: #3c3836;
  --bg-active: #504945;
  --bg-loading: linear-gradient(135deg, #fabd2f 0%, #fe8019 100%);
  --bg-footer: linear-gradient(135deg, #fabd2f 0%, #fe8019 100%);
  --footer-text-color: #282828;
  
  --border-color: #3c3836;
  --border-color-light: #504945;
  --border-color-hover: #665c54;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #1d2021;
  --editor-placeholder-bg: #282828;
  --tab-bg: #3c3836;
  --tab-active-bg: #282828;
  --terminal-system-bg: #1d2021;
  --terminal-output-bg: #282828;
}

/* COBALT2 THEME */
[data-theme="cobalt2"] {
  --color-primary: #ffc600;
  --color-primary-hover: #ff9d00;
  --color-accent: #ff628c;
  --color-success: #3ad900;
  --color-danger: #ff628c;
  --color-warning: #ff9d00;
  
  --color-text-primary: #e1efff;
  --color-text-secondary: #9effff;
  --color-text-tertiary: #0088ff;
  --color-text-inverse: #193549;
  
  --bg-primary: #193549;
  --bg-secondary: #122738;
  --bg-tertiary: #15414e;
  --bg-elevated: #193549;
  --bg-navbar: linear-gradient(135deg, #122738 0%, #193549 100%);
  --bg-sidebar: #122738;
  --bg-editor: #193549;
  --bg-terminal: #193549;
  --bg-hover: #15414e;
  --bg-active: #1f4662;
  --bg-loading: linear-gradient(135deg, #ffc600 0%, #ff9d00 100%);
  --bg-footer: linear-gradient(135deg, #ffc600 0%, #ff9d00 100%);
  --footer-text-color: #193549;
  
  --border-color: #15414e;
  --border-color-light: #1f4662;
  --border-color-hover: #0088ff;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  
  --sidebar-bg: #122738;
  --editor-placeholder-bg: #193549;
  --tab-bg: #15414e;
  --tab-active-bg: #193549;
  --terminal-system-bg: #122738;
  --terminal-output-bg: #193549;
}

/* RESET & DEFAULTS */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-primary);
  /* Background only applied when loading is complete - critical CSS handles loading state */
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Apply theme background only when loading is hidden */
body:not(:has(#loadingOverlay:not(.hidden))) {
  background: var(--bg-secondary);
}

/* Fallback for browsers that don't support :has() */
body.theme-ready {
  background: var(--bg-secondary) !important;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
}

/* ============================================================================
   LOADING SCREEN STYLES
   ============================================================================ */

html, body { 
  margin: 0; 
  padding: 0;
  min-height: 100vh;
}

/* Loading overlay - covers everything during load */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease;
}

#loadingOverlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Hide main content initially until loaded */
.playground-container,
.playground-footer {
  opacity: 0;
  visibility: hidden;
}

/* Show main content when loaded */
.playground-container.loaded, 
.playground-footer.loaded { 
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

/* Loading content styling */
.loading-content { 
  text-align: center; 
}

/* Profile container with animated rings */
.loading-profile-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 32px;
}

.loading-profile-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4), 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 2;
  animation: loadingProfilePulse 3s ease-in-out infinite;
}

.loading-rings {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 2px solid rgba(59, 130, 246, 0.4);
  border-radius: 50%;
  animation: loadingRingPulse 2s ease-out infinite;
}

.ring-1 { width: 140px; height: 140px; margin: -70px 0 0 -70px; border-color: rgba(59, 130, 246, 0.5); }
.ring-2 { width: 170px; height: 170px; margin: -85px 0 0 -85px; animation-delay: 0.3s; border-color: rgba(99, 102, 241, 0.4); }
.ring-3 { width: 200px; height: 200px; margin: -100px 0 0 -100px; animation-delay: 0.6s; border-color: rgba(139, 92, 246, 0.3); }

.loading-title {
  margin: 0 0 16px 0;
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  letter-spacing: -1px;
  animation: loadingTitleFloat 3s ease-in-out infinite;
}

.loading-text {
  margin: 0 0 32px 0;
  font-size: 16px;
  font-weight: 500;
  color: rgba(203, 213, 225, 0.9);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Progress wrapper - contains bar and percentage */
.loading-progress-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0 auto 32px;
  width: 100%;
  max-width: 400px;
}

/* Progress bar container - minimal wrapper */
.loading-progress-container {
  width: 100%;
}

.loading-bar {
  width: 100%;
  height: 14px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 50px;
  overflow: hidden;
  position: relative;
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    #60a5fa 0%, 
    #818cf8 25%,
    #a78bfa 50%,
    #c084fc 75%,
    #e879f9 100%);
  border-radius: 50px;
  position: relative;
  box-shadow: 
    0 0 25px rgba(96, 165, 250, 0.8),
    0 0 50px rgba(168, 139, 250, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: loadingBarPulse 2s ease-in-out infinite;
}

/* Shimmer effect on progress bar */
.loading-bar-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  animation: loadingShimmer 2s infinite;
}

/* Percentage display - centered below bar */
.loading-percentage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.loading-percentage {
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -2px;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
  animation: loadingPercentageGlow 2s ease-in-out infinite;
}

.loading-percentage-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.6);
  letter-spacing: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Author section styling */
.loading-author-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loading-powered {
  margin: 0;
  font-size: 12px;
  color: rgba(100, 116, 139, 0.8);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.loading-author-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 14px 28px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.8) 100%);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(59, 130, 246, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.loading-author-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.loading-author-link:hover::before {
  left: 100%;
}

.loading-author-link:hover {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.95) 0%, rgba(71, 85, 105, 0.9) 100%);
  border-color: rgba(59, 130, 246, 0.7);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(59, 130, 246, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.loading-author-name {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.5px;
}

.loading-author-website {
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.5px;
}

/* Loading animations */
@keyframes loadingProfilePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes loadingRingPulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1.2); opacity: 0; }
}

@keyframes loadingTitleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

@keyframes loadingBarPulse {
  0%, 100% { 
    box-shadow: 
      0 0 20px rgba(59, 130, 246, 0.6),
      0 0 40px rgba(139, 92, 246, 0.4),
      inset 0 1px 1px rgba(255, 255, 255, 0.3);
  }
  50% { 
    box-shadow: 
      0 0 30px rgba(59, 130, 246, 0.8),
      0 0 60px rgba(139, 92, 246, 0.6),
      inset 0 1px 1px rgba(255, 255, 255, 0.4);
  }
}

@keyframes loadingShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes loadingPercentageGlow {
  0%, 100% { 
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
  }
  50% { 
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6));
  }
}


/* ============================================================================
   MAIN CONTAINER - Flexbox Column Layout
   ============================================================================ */

.playground-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */

.playground-navbar {
  flex-shrink: 0;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.playground-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: none;
  padding: 0 16px;
  margin: 0;
}

.navbar-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  transition: all 0.3s ease;
  background: transparent;
  animation: logoPulse 3s ease-in-out infinite;
}

.navbar-logo-link:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.15);
  animation: none;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.3));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
  }
}

.playground-nav-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.nav-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-back-link:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
  border-color: var(--border-color);
}

/* Language Toggle Button */
.lang-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  color: var(--color-text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.lang-toggle-btn:hover {
  border-color: var(--color-primary);
  background: var(--bg-hover);
}

.lang-flag {
  font-size: 16px;
}

.lang-code {
  font-size: 12px;
  font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  color: var(--color-text-primary);
  font-size: 16px;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--color-primary);
  background: var(--bg-hover);
  color: var(--color-primary);
  transform: rotate(15deg);
}



/* ============================================================================
   MAIN CONTENT ROW - Horizontal Layout
   ============================================================================ */

.playground-main-row {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
  gap: 0;
}

/* ============================================================================
   SIDEBAR - Main Container
   ============================================================================ */

.playground-sidebar {
  display: flex;
  flex-direction: column;
  width: 260px;
  min-width: 200px;
  max-width: 400px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow: hidden;
}

/* ============================================================================
   PROJECT SWITCHER - Compact Header
   ============================================================================ */

.sidebar-project-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.project-switcher {
  position: relative;
}

.project-switcher-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-switcher-current:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.project-switcher.open .project-switcher-current {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.project-switcher-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.project-switcher-name {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-switcher-arrow {
  font-size: 10px;
  color: var(--color-text-secondary);
  transition: transform 0.2s ease;
}

.project-switcher.open .project-switcher-arrow {
  transform: rotate(180deg);
}

/* Project Dropdown */
.project-switcher-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  max-height: 320px;
  overflow: hidden;
  flex-direction: column;
}

.project-switcher.open .project-switcher-dropdown {
  display: flex;
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color-light);
}

.dropdown-search i {
  color: var(--color-text-tertiary);
  font-size: 12px;
}

.dropdown-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--color-text-primary);
  background: transparent;
}

.dropdown-search input::placeholder {
  color: var(--color-text-tertiary);
}

.dropdown-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.dropdown-list::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 2px;
}

.dropdown-project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-project-item:hover {
  background: var(--bg-hover);
}

.dropdown-project-item.active {
  background: var(--bg-active);
  color: var(--color-primary);
}

.dropdown-project-item .project-icon {
  font-size: 16px;
}

.dropdown-project-item .project-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-project-item .project-meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

.dropdown-project-item .project-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dropdown-project-item:hover .project-actions {
  opacity: 1;
}

.project-action-btn {
  padding: 4px 6px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: all 0.15s ease;
  font-size: 11px;
}

.project-action-btn:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
}

.project-action-btn.project-action-delete {
  color: var(--color-danger);
}

.project-action-btn.project-action-delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.dropdown-project-item .project-delete {
  opacity: 0;
  padding: 4px 6px;
  border: none;
  background: none;
  color: var(--color-danger);
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: all 0.15s ease;
}

.dropdown-project-item:hover .project-delete {
  opacity: 1;
}

.dropdown-project-item .project-delete:hover {
  background: #fef2f2;
}

.dropdown-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
  display: none;
}

.dropdown-empty.show {
  display: block;
}

/* ============================================================================
   FILE TREE SECTION
   ============================================================================ */

.sidebar-files-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

.file-tree-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 8px;
}

.file-tree-container::-webkit-scrollbar {
  width: 4px;
}

.file-tree-container::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 2px;
}

#fileTree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.file-tree-item:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

.file-tree-item.active {
  background: var(--bg-active);
  color: var(--color-primary);
  font-weight: 500;
}

.file-tree-item .file-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.file-tree-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree-item .file-delete {
  opacity: 0;
  padding: 2px 6px;
  border: none;
  background: none;
  color: var(--color-danger);
  cursor: pointer;
  font-size: 11px;
  border-radius: var(--border-radius-sm);
  transition: all 0.15s ease;
}

.file-tree-item:hover .file-delete {
  opacity: 1;
}

.file-tree-item .file-delete:hover {
  background: #fef2f2;
}

/* Folder Tree Styles */
.file-tree-folder {
  margin: 0;
}

.folder-header {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.folder-header:hover {
  background: var(--bg-secondary);
}

.folder-header .folder-arrow {
  font-size: 10px;
  width: 12px;
  color: var(--color-text-tertiary);
  transition: transform 0.15s ease;
}

.folder-header.folder-selected {
  background: #fef3c7;
  color: #92400e;
}

/* Folder action buttons */
.folder-actions {
  display: none;
  gap: 2px;
  margin-left: auto;
}

.folder-header:hover .folder-actions {
  display: flex;
}

.folder-action-btn {
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-size: 11px;
  border-radius: var(--border-radius-sm);
  transition: all 0.15s ease;
}

.folder-action-btn:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
}

.folder-action-btn .fa-folder-plus:hover {
  color: var(--color-warning);
}

.folder-contents {
  overflow: hidden;
  transition: all 0.2s ease;
}

.folder-contents.collapsed {
  display: none;
}

.empty-state-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  text-align: center;
  color: var(--color-text-tertiary);
}

.empty-state-compact .empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-state-compact p {
  margin: 0;
  font-size: 13px;
}

/* ============================================================================
   SIDEBAR FOOTER & ACTIONS
   ============================================================================ */

.sidebar-actions-row {
  display: flex;
  gap: 8px;
}

.action-btn-compact {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-compact:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

.action-btn-compact.action-btn-accent {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
  border-color: #d97706;
  color: white;
}

.action-btn-compact.action-btn-accent:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: white;
}

.action-btn-compact.action-btn-full {
  flex: none;
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  border-color: var(--color-primary-hover);
  color: white;
}

.action-btn-compact.action-btn-full:hover {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, #1d4ed8 100%);
}

.action-btn-compact i {
  font-size: 12px;
}

/* ============================================================================
   TEMPLATES GRID
   ============================================================================ */

.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.template-card:hover {
  background: var(--bg-active);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.template-card .template-icon {
  font-size: 28px;
}

.template-card .template-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-primary);
}

.template-card .template-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.template-card .template-badge.badge-beginner {
  background: #dcfce7;
  color: #16a34a;
}

.template-card .template-badge.badge-popular {
  background: #fef3c7;
  color: #d97706;
}

.template-card .template-badge.badge-security {
  background: #fee2e2;
  color: #dc2626;
}

.template-card .template-badge.badge-advanced {
  background: #e0e7ff;
  color: #4f46e5;
}

/* ============================================================================
   SIDEBAR SECTIONS (Legacy support)
   ============================================================================ */

.sidebar-section {
  display: flex;
  flex-direction: column;
  padding: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar-separator {
  height: 1px;
  background: var(--border-color);
  margin: 0 12px;
  flex-shrink: 0;
}

/* ============================================================================
   SIDEBAR SECTION HEADER
   ============================================================================ */

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sidebar-section-header .header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-section-header .header-actions .btn-icon-small {
  color: var(--color-text-secondary);
}

.sidebar-section-header .header-actions .btn-icon-small:hover {
  color: var(--color-primary);
}

.sidebar-section-header .header-actions .btn-icon-small.spinning i {
  animation: spin 1s linear infinite;
}

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

.sidebar-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* PROJECT FILTER - Now inside dropdown */
#projectsFilter {
  width: 100%;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--color-text-primary);
  background: transparent;
  box-sizing: border-box;
}

#projectsFilter::placeholder {
  color: var(--color-text-tertiary);
}

/* PROJECTS AND TEMPLATES LISTS - Scrolling Containers */
#projectsList {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#projectsList::-webkit-scrollbar {
  width: 4px;
}

#projectsList::-webkit-scrollbar-track {
  background: transparent;
}

#projectsList::-webkit-scrollbar-thumb {
  background: var(--border-color-hover);
  border-radius: 2px;
}

#projectsList::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

/* PROJECT ITEMS */
.project-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin: 6px 0;
  border-radius: var(--border-radius);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-item:hover {
  background: var(--bg-active);
  border-color: var(--color-primary);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.project-item.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: white;
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.project-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.project-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.project-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
}

.project-item.active .project-item-name {
  color: white;
}

.project-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-item:hover .project-item-actions {
  opacity: 1;
}

.project-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-text-secondary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
}

.project-item:hover .project-item-btn {
  background: rgba(59, 130, 246, 0.2);
  color: var(--color-primary-hover);
}

.project-item.active .project-item-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.project-item-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  transform: scale(1.1);
}

.project-item.active .project-item-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.project-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-secondary);
  padding: 0 4px;
}

.project-item.active .project-item-meta {
  color: rgba(255, 255, 255, 0.85);
}

.file-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.05);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.project-item.active .file-count {
  background: rgba(255, 255, 255, 0.2);
}

/* PROJECT FILES TREE */
.project-files {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.project-item.expanded .project-files {
  display: flex;
}

.project-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-left: 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(0, 0, 0, 0.03);
  color: #475569;
  border: 1px solid transparent;
}

.project-file:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #2563eb;
}

.project-file-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.project-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TEMPLATE ITEMS */
.template-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-item:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.template-item-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.template-item-info {
  flex: 1;
  min-width: 0;
}

.template-item-name {
  display: block;
  font-weight: 700;
  font-size: 12px;
  color: var(--color-text-primary);
  margin-bottom: 3px;
}

.template-item-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.template-item-badge.badge-beginner {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #0369a1;
}

.template-item-badge.badge-popular {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
  color: #92400e;
}

.template-item-badge.badge-security {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
  color: #991b1b;
}

.template-item-badge.badge-advanced {
  background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
  color: #6b21a8;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 20px 12px;
  color: var(--color-text-tertiary);
  font-size: 12px;
}

.empty-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

.empty-state p {
  margin: 4px 0;
  line-height: 1.4;
}

.empty-hint {
  font-size: 11px;
  color: var(--border-color-hover);
}

/* COLLAPSE TOGGLE */
.project-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
}

.project-toggle:hover {
  color: var(--color-primary-hover);
  transform: scale(1.2);
}

.project-toggle.expanded::before {
  content: '▼';
}

.project-toggle:not(.expanded)::before {
  content: '▶';
}

/* Sidebar Footer Styling */
.sidebar-footer {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-navbar);
  box-shadow: var(--shadow-sm);
}

.sidebar-footer .action-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: white;
  border: none;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
}

.sidebar-footer .action-btn:hover {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, #1d4ed8 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sidebar-footer .action-btn:disabled {
  background: var(--border-color-hover);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* File Tree Styling */
.project-files {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.project-item.expanded .project-files {
  display: flex;
}

.project-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-left: 12px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(0, 0, 0, 0.03);
  color: var(--color-text-secondary);
  border: 1px solid transparent;
}

.project-file:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
}

.project-file.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
  font-weight: 600;
}

.project-file-icon {
  font-size: 11px;
  flex-shrink: 0;
}

.project-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================================
   VERTICAL DIVIDER (Sidebar/Editor)
   ============================================================================ */

.playground-divider-vertical {
  width: 4px;
  height: 100%;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  transition: background 0.15s ease;
  position: relative;
}

.playground-divider-vertical:hover {
  background: var(--color-primary);
}

.playground-divider-vertical::after {
  content: '';
  position: absolute;
  left: 1.5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-color);
}

/* ============================================================================
   EDITOR AREA
   ============================================================================ */

.playground-editor-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: var(--bg-editor);
  min-width: 300px;
  border-right: 1px solid var(--border-color);
}

/* Breadcrumb Bar */
.editor-breadcrumb-bar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  flex-shrink: 0;
  overflow: hidden;
}

.editor-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--color-text-tertiary);
}

.breadcrumb-item.active {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* Tabs Bar */
.editor-tabs-bar {
  display: flex;
  height: 36px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  align-items: stretch;
}

.editor-tabs-bar::-webkit-scrollbar {
  height: 6px;
}

.editor-tabs-bar::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.editor-tabs-bar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

#editorTabs {
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--tab-bg);
  color: var(--color-text-secondary);
  border: none;
  border-right: 1px solid var(--border-color);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-width: 90px;
  max-width: 200px;
  flex: 1;
  position: relative;
}

.editor-tab:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

.editor-tab.active {
  background: var(--tab-active-bg);
  color: var(--color-text-primary);
  border-bottom: 2px solid var(--color-primary);
}

.editor-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
}

.tab-icon {
  font-size: 13px;
}

.tab-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-close {
  opacity: 0.6;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.editor-tab:hover .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: var(--bg-hover);
}

.editor-tabs-actions {
  display: flex;
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
  gap: 4px;
}

/* Monaco Editor Container */
/* Monaco Editor Container */
#editorContainer {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  background: var(--bg-editor);
  position: relative;
}

/* Ensure Monaco widgets (autocomplete, hover) appear above everything */
.monaco-editor .suggest-widget,
.monaco-editor .parameter-hints-widget,
.monaco-editor .editor-hover {
  z-index: 100000 !important;
}

.editor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  background: var(--bg-editor);
}

.placeholder-content {
  text-align: center;
  color: var(--color-text-secondary);
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.placeholder-content h3 {
  font-size: 15px;
  margin: 8px 0;
  color: var(--color-text-primary);
  font-weight: 600;
}

.placeholder-content p {
  font-size: 12px;
  margin: 4px 0;
  color: var(--color-text-tertiary);
}

/* Action Bar */
.editor-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 12px;
}

.action-bar-left,
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-tertiary);
  color: var(--color-text-secondary);
}

.action-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

.action-btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.action-btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 13px;
}

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.save-icon {
  font-size: 12px;
}

/* ============================================================================
   HORIZONTAL DIVIDER (Editor/Terminal)
   ============================================================================ */

.playground-divider-horizontal {
  height: 4px;
  width: 100%;
  flex-shrink: 0;
  background: transparent;
  cursor: row-resize;
  transition: background 0.15s ease;
  position: relative;
}

.playground-divider-horizontal:hover {
  background: var(--color-primary);
}

.playground-divider-horizontal::before {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

/* ============================================================================
   OUTPUT AREA (Terminal/Preview)
   ============================================================================ */

.playground-output-area {
  display: flex;
  flex-direction: column;
  height: 250px;
  min-height: 80px;
  max-height: 600px;
  flex-shrink: 0;
  background: var(--bg-terminal);
  border-top: 1px solid var(--border-color);
  overflow: hidden;
}

/* Output Tabs */
.output-tabs-bar {
  display: flex;
  height: 36px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 0;
}

.output-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
}

.output-tab:hover {
  color: var(--color-text-primary);
  background: var(--bg-hover);
}

.output-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
}

/* Output Panels */
.output-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.output-panel.active {
  display: flex;
}

/* Terminal Panel */
.terminal-toolbar {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 8px;
}

.terminal-toolbar-label {
  flex: 1;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.save-icon {
  color: var(--color-success);
}

.playground-nav-title i {
  color: var(--color-primary);
}

.breadcrumb-item {
  color: var(--color-text-tertiary);
}

#closeAllTabs {
  opacity: 0.5;
}

#closeAllTabs:hover {
  opacity: 1;
}

.terminal-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
}

#terminalOutput {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  background: var(--bg-terminal);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

#terminalOutput::-webkit-scrollbar {
  width: 8px;
}

#terminalOutput::-webkit-scrollbar-track {
  background: var(--bg-terminal);
}

#terminalOutput::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.terminal-line {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 1px 0;
}

.terminal-line.success {
  color: var(--color-success);
}

.terminal-line.error {
  color: var(--color-danger);
}

.terminal-line.warning {
  color: var(--color-warning);
}

.terminal-line.system {
  color: var(--color-primary);
}

.terminal-prompt {
  color: var(--color-primary);
  margin-right: 6px;
}

/* Terminal Split Sections */
.terminal-container {
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: hidden;
}

.terminal-section {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.terminal-section-header:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

.terminal-section-header .toggle-icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.terminal-section.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.terminal-section.collapsed .terminal-section-content {
  display: none;
}

.system-badge {
  background: var(--bg-tertiary);
  color: var(--color-primary);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  min-width: 18px;
  text-align: center;
}

/* System Log Section */
.system-section {
  flex-shrink: 0;
  width: 280px;
  min-width: 200px;
  border-right: 1px solid var(--border-color);
  background: var(--terminal-system-bg);
}

.system-section.collapsed {
  width: auto;
  min-width: auto;
}

.system-section .terminal-section-content {
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.5;
  overflow-y: auto;
  flex: 1;
}

.system-section .terminal-line {
  opacity: 0.85;
  font-size: 11px;
}

/* Output Section (main) */
.output-section {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.output-section .output-header {
  cursor: default;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--color-success);
}

.output-section .output-header:hover {
  background: var(--bg-secondary);
}

.output-section .output-content {
  flex: 1;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  overflow-y: auto;
  background: var(--terminal-output-bg);
}

/* Scrollbar for sections */
.terminal-section-content::-webkit-scrollbar {
  width: 6px;
}

.terminal-section-content::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-section-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.terminal-section-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-color-hover);
}

/* Vertical stack on narrow screens */
@media (max-width: 900px) {
  .terminal-container {
    flex-direction: column;
  }
  
  .system-section {
    width: 100%;
    max-height: 120px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .system-section .terminal-section-content {
    max-height: 80px;
  }
}

/* Preview Panel */
.preview-toolbar {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
  flex-shrink: 0;
}

.preview-url {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--color-text-primary);
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  transition: all 0.2s ease;
}

.preview-url:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.preview-url::placeholder {
  color: var(--color-text-tertiary);
}

.preview-frame-container {
  position: relative;
  flex: 1;
  overflow: hidden;
}

#previewFrame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg-primary);
}

.preview-placeholder,
#previewPlaceholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: var(--bg-terminal);
  text-align: center;
  z-index: 1;
}

.preview-placeholder.hidden,
#previewPlaceholder.hidden {
  display: none;
}

.preview-placeholder .placeholder-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.preview-placeholder h3 {
  font-size: 13px;
  margin: 0 0 6px 0;
  color: var(--color-text-primary);
}

.preview-placeholder p {
  font-size: 11px;
  margin: 0;
  color: var(--color-text-secondary);
}

/* ============================================================================
   UTILITY BUTTONS
   ============================================================================ */

.btn-icon-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: all 0.15s ease;
  font-size: 13px;
}

.btn-icon-small:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-container.active {
  display: flex;
}

.modal-box {
  background: var(--bg-elevated);
  border-radius: var(--border-radius);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

.modal-box h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--color-text-primary);
  font-weight: 700;
}

.modal-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  transition: all 0.15s ease;
}

.modal-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Modal Content Styles */
.modal-content-box {
  background: var(--bg-elevated);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

.modal-content-box.modal-wide {
  max-width: 500px;
}

.modal-header {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header i {
  font-size: 16px;
}

.modal-header.modal-danger {
  color: var(--color-danger);
}

.modal-description {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.modal-path-indicator {
  margin: 0 0 16px 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  font-family: monospace;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  box-sizing: border-box;
  margin-bottom: 16px;
  background: var(--bg-primary);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.modal-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-actions-top {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.modal-message {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.action-btn-danger {
  background: var(--color-danger) !important;
  color: white !important;
}

.action-btn-danger:hover {
  background: #dc2626 !important;
  opacity: 0.9;
}

/* ============================================================================
   CONTEXT MENU & DROPDOWNS
   ============================================================================ */

.context-menu {
  display: none;
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 2000;
  min-width: 150px;
}

.context-menu.active {
  display: block;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.1s ease;
  font-size: 12px;
}

.context-menu-item:hover {
  background: var(--bg-hover);
  color: var(--color-primary-hover);
}

.context-menu-separator {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ============================================================================
   SCROLLBARS - Custom styling
   ============================================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .playground-sidebar {
    display: none;
  }

  .playground-divider-vertical {
    display: none;
  }

  .playground-editor-area {
    flex: 1;
  }

  .playground-output-area {
    height: 180px;
  }
}

/* ============================================================================
   MODAL STYLES & VISIBILITY
   ============================================================================ */

#newProjectModal,
#newFileModal,
#newFolderModal,
#deleteModal,
#templatesModal,
#renameProjectModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#newProjectBackdrop,
#newFileBackdrop,
#newFolderBackdrop,
#deleteBackdrop,
#templatesBackdrop,
#renameProjectBackdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

#newProjectModal,
#newFileModal,
#newFolderModal,
#deleteModal,
#templatesModal,
#renameProjectModal {
  display: none !important;
}

#newProjectModal.visible,
#newFileModal.visible,
#newFolderModal.visible,
#deleteModal.visible,
#templatesModal.visible,
#renameProjectModal.visible {
  display: flex !important;
}

#newProjectBackdrop,
#newFileBackdrop,
#newFolderBackdrop,
#deleteBackdrop,
#templatesBackdrop,
#renameProjectBackdrop {
  display: none !important;
}

#newProjectBackdrop.visible,
#newFileBackdrop.visible,
#newFolderBackdrop.visible,
#deleteBackdrop.visible,
#templatesBackdrop.visible,
#renameProjectBackdrop.visible {
  display: block !important;
}

/* Spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-width: 280px;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before {
  background: linear-gradient(180deg, var(--color-success), var(--color-success));
}

.toast-error::before {
  background: linear-gradient(180deg, var(--color-danger), var(--color-danger));
}

.toast-info::before {
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary));
}

.toast-warning::before {
  background: linear-gradient(180deg, var(--color-warning), var(--color-warning));
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

.toast-info .toast-icon {
  background: rgba(59, 130, 246, 0.2);
  color: var(--color-primary);
}

.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.toast-message {
  flex: 1;
  line-height: 1.4;
  color: var(--color-text-primary);
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

/* Progress bar for auto-dismiss */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  animation: toastProgress 4s linear forwards;
}

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

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

@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Responsive toasts */
@media (max-width: 480px) {
  #toastContainer {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================================================
   FANCY LOADING SCREEN
   ============================================================================ */

.loading-fancy {
  background: var(--bg-loading);
  z-index: 9999;
}

.loading-content {
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.loading-logo-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
}

.loading-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  animation: bounce 2s ease-in-out infinite;
}

.loading-rings {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: ringPulse 2s ease-out infinite;
}

.ring-1 {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  animation-delay: 0s;
}

.ring-2 {
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  animation-delay: 0.3s;
}

.ring-3 {
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  animation-delay: 0.6s;
}

.loading-title {
  margin: 0 0 16px 0;
  font-size: 28px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.loading-text {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  animation: fadeInUp 0.6s ease 0.3s both;
}

.loading-bar {
  width: 280px;
  height: 4px;
  margin: 0 auto 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffffff, #a8d8ff);
  border-radius: 2px;
  animation: loadingProgress 2s ease-in-out infinite;
}

.loading-powered {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  animation: fadeInUp 0.6s ease 0.5s both;
}

.loading-author {
  font-weight: 700;
  color: white;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes bounce {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

@keyframes ringPulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loadingProgress {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.playground-footer {
  flex-shrink: 0;
  background: linear-gradient(to right, var(--bg-secondary), var(--bg-tertiary));
  padding: 12px 0;
  border-top: 2px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.playground-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  animation: footerShimmer 3s infinite;
}

@keyframes footerShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.footer-tip:hover {
  border-color: var(--color-primary);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.footer-tip > i {
  color: var(--color-primary);
  font-size: 1.1rem;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.shortcuts-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shortcuts-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-divider {
  color: var(--border-color);
  font-weight: bold;
}

.key-separator {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  margin: 0 2px;
}

.shortcut-desc {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  margin-left: 4px;
}

.footer-tip kbd {
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  min-width: 24px;
  text-align: center;
}

.footer-tip kbd:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.footer-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.footer-credits {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.footer-credits::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.footer-credits:hover::before {
  left: 100%;
}

.footer-credits:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.credits-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.credits-heart {
  color: #ef4444;
  font-size: 0.9rem;
  animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  10%, 30% { transform: scale(1.2); }
  20%, 40% { transform: scale(1); }
}

.credits-author {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.credits-author::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.credits-author:hover::before {
  width: 300px;
  height: 300px;
}

.author-name {
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.credits-icon {
  color: white;
  font-size: 0.7rem;
  opacity: 0.8;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.credits-author:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.credits-author:hover .credits-icon {
  opacity: 1;
  transform: translateX(2px) translateY(-2px);
}

.footer-right {
  text-align: right;
}

.footer-tech {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.footer-tech i {
  color: #f59e0b;
}

@media (max-width: 900px) {
  .shortcuts-group {
    display: none;
  }
  
  .shortcuts-label {
    display: none;
  }
  
  .footer-tip {
    padding: 6px 10px;
  }
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .footer-left,
  .footer-right {
    display: none;
  }
  
  .footer-center {
    width: 100%;
  }
}

/* ============================================================================
   THEME PICKER MODAL
   ============================================================================ */

.theme-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.theme-picker-modal.active {
  display: flex;
}

.theme-picker-content {
  background: var(--bg-elevated);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  max-width: 680px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

.theme-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.theme-picker-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.theme-picker-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 20px;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.theme-picker-close:hover {
  background: var(--bg-hover);
  color: var(--color-text-primary);
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.theme-card {
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary);
}

.theme-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.theme-card-preview {
  height: 60px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 10px;
  display: flex;
  overflow: hidden;
}

.theme-preview-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.theme-preview-bar {
  flex: 1;
}

.theme-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
}

.theme-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.theme-card.active .theme-card-check {
  display: flex;
}

/* ============================================================================
   TOAST ANIMATIONS
   ============================================================================ */

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

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ============================================================================
   SHORTCUTS MODAL
   ============================================================================ */

.shortcuts-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

.shortcuts-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.shortcuts-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.shortcuts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
  color: white;
}

.shortcuts-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shortcuts-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.shortcuts-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.shortcuts-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 50vh;
}

.shortcuts-section {
  margin-bottom: 20px;
}

.shortcuts-section:last-child {
  margin-bottom: 0;
}

.shortcuts-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.shortcut-row:hover {
  border-color: var(--color-primary);
  background: var(--bg-primary);
}

.shortcut-row:last-child {
  margin-bottom: 0;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-keys kbd {
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-bottom-width: 3px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-width: 28px;
  text-align: center;
}

.shortcut-action {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.shortcuts-modal-footer {
  padding: 16px 24px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
}

.shortcuts-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.shortcuts-tip i {
  color: #f59e0b;
}

.shortcuts-tip kbd {
  padding: 2px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'SF Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
}

