/* ==========================================================================
   UTILZSTACK PREMIUM STYLESHEET
   ========================================================================== */

@layer reset, base, tokens, components, themes, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
  }

  input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
  }

  img, svg {
    display: block;
    max-width: 100%;
    height: auto;
  }
}

@layer tokens {
  :root {
    /* Font families */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Syne', var(--font-sans);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transition constants */
    --easing-premium: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.15s var(--easing-premium);
    --transition-medium: 0.3s var(--easing-premium);
    --transition-slow: 0.5s var(--easing-premium);
    
    /* Rounded corners */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-circle: 50%;

    /* Default Space Dark Theme values */
    --bg: #09090e;
    --bg-gradient: radial-gradient(circle at 50% -20%, #17122b 0%, #09090e 60%);
    --surface: rgba(18, 18, 26, 0.7);
    --surface-hover: rgba(26, 26, 38, 0.85);
    --surface-active: rgba(32, 32, 48, 0.95);
    --surface-secondary: rgba(10, 10, 15, 0.5);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --text: #f1eff7;
    --text-muted: #9491a3;
    --text-dark: #625f73;

    --accent: #8b5cf6;
    --accent-rgb: 139, 92, 246;
    --accent-secondary: #06b6d4;
    --accent-glow: rgba(139, 92, 246, 0.15);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    
    --glass-blur: 16px;
    --scrollbar-track: #09090e;
    --scrollbar-thumb: rgba(255, 255, 255, 0.12);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
    
    color-scheme: dark;
  }
}

@layer themes {
  /* Cyberpunk Theme */
  [data-theme="cyberpunk"] {
    --bg: #030303;
    --bg-gradient: radial-gradient(circle at 50% 0%, #0c1815 0%, #030303 70%);
    --surface: rgba(6, 12, 11, 0.85);
    --surface-hover: rgba(10, 22, 20, 0.95);
    --surface-active: rgba(14, 30, 28, 0.95);
    --surface-secondary: rgba(0, 0, 0, 0.8);
    --border: #0df2c933;
    --border-hover: #0df2c977;
    
    --text: #0df2c9;
    --text-muted: #6e9a90;
    --text-dark: #375952;
    
    --accent: #0df2c9;
    --accent-rgb: 13, 242, 201;
    --accent-secondary: #ff007f;
    --accent-glow: rgba(13, 242, 201, 0.2);
    
    --success: #0df2c9;
    --success-glow: rgba(13, 242, 201, 0.15);
    --error: #ff007f;
    --error-glow: rgba(255, 0, 127, 0.15);
    --warning: #ffbf00;
    --warning-glow: rgba(255, 191, 0, 0.1);
    
    --shadow-sm: 0 0 10px rgba(13, 242, 201, 0.1);
    --shadow-md: 0 0 20px rgba(13, 242, 201, 0.2);
    --shadow-lg: 0 0 40px rgba(13, 242, 201, 0.3);
    
    --glass-blur: 8px;
    --scrollbar-track: #030303;
    --scrollbar-thumb: #0df2c944;
    --scrollbar-thumb-hover: #0df2c988;
    
    color-scheme: dark;
  }

  /* Minimalist Light Theme */
  [data-theme="light"] {
    --bg: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 100%);
    --surface: rgba(255, 255, 255, 0.7);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --surface-active: rgba(241, 245, 249, 0.95);
    --surface-secondary: rgba(226, 232, 240, 0.4);
    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.16);
    
    --text: #0f172a;
    --text-muted: #475569;
    --text-dark: #94a3b8;
    
    --accent: #6366f1;
    --accent-rgb: 99, 102, 241;
    --accent-secondary: #0ea5e9;
    --accent-glow: rgba(99, 102, 241, 0.08);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.08);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.08);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.05);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
    
    --glass-blur: 24px;
    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: rgba(15, 23, 42, 0.15);
    --scrollbar-thumb-hover: rgba(15, 23, 42, 0.3);
    
    color-scheme: light;
  }
}

@layer base {
  body {
    font-family: var(--font-sans);
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    transition: background-color var(--transition-medium), color var(--transition-medium);
  }

  /* Typography */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }
  
  p {
    color: var(--text-muted);
  }

  /* Scrollbars */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
    border: 2px solid var(--scrollbar-track);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
  }

  /* Text Selection */
  ::selection {
    background: rgba(var(--accent-rgb), 0.3);
    color: var(--text);
  }

  /* High contrast outlines */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
  }
}

@layer components {
  /* ==========================================================================
     LAYOUT COMPONENTS
     ========================================================================== */
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
  }

  .container-wide {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
  }

  /* Header and Navigation */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 72px;
    display: flex;
    align-items: center;
    background: rgba(var(--accent-rgb), 0.02);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    transition: background-color var(--transition-medium), border-color var(--transition-medium);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.3);
  }

  .logo span {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
  }

  .nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--surface-secondary);
  }

  .nav-link.active {
    box-shadow: inset 0 0 0 1px var(--border);
  }

  .nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* Premium Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-medium);
    text-decoration: none;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.25);
  }

  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.35);
    filter: brightness(1.1);
  }

  .btn-primary:active {
    transform: translateY(0);
  }

  .btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
  }

  .btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
  }

  .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition-fast);
  }

  .btn-icon:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--accent);
  }

  .mobile-menu-btn {
    display: none;
  }

  /* Search Bar header button */
  .search-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    width: 240px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
  }

  .search-trigger:hover {
    border-color: var(--border-hover);
    background: var(--surface);
  }

  .search-kbd {
    margin-left: auto;
    font-size: 10px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
  }

  /* ==========================================================================
     HERO & DYNAMIC SECTIONS
     ========================================================================== */

  .hero {
    padding: 96px 0 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .hero-glow-1 {
    position: absolute;
    top: -200px;
    left: 20%;
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
  }

  .hero-glow-2 {
    position: absolute;
    top: -150px;
    right: 20%;
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 50px;
    padding: 6px 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.05);
  }

  .hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: var(--radius-circle);
    display: inline-block;
    box-shadow: 0 0 8px var(--accent);
    animation: badge-pulse 2s infinite;
  }

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

  .hero h1 {
    font-size: clamp(38px, 5vw, 68px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    text-wrap: balance;
  }

  .hero h1 span {
    background: linear-gradient(135deg, var(--text) 30%, var(--accent) 70%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    font-weight: 400;
    text-wrap: balance;
  }

  .hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
  }

  .hero-stat-card {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
  }

  .hero-stat-val {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .hero-stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
  }

  /* ==========================================================================
     TOOLS GRID SECTION
     ========================================================================== */

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
  }

  /* Tool Cards and Spotlight Effects */
  .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }

  .tool-card {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition-medium);
  }

  /* Glowing spotlight element */
  .tool-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
      250px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(var(--accent-rgb), 0.08),
      transparent 80%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
  }

  .tool-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }

  .tool-card:hover::before {
    opacity: 1;
  }

  .tool-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: var(--transition-fast);
  }

  .tool-card:hover .tool-icon-wrapper {
    background: var(--accent-glow);
    border-color: rgba(var(--accent-rgb), 0.3);
    color: var(--accent);
    transform: scale(1.05);
  }

  /* Custom tool icon colors */
  .tool-icon-wrapper.purple { color: #a78bfa; }
  .tool-icon-wrapper.green { color: #34d399; }
  .tool-icon-wrapper.cyan { color: #22d3ee; }
  .tool-icon-wrapper.amber { color: #fbbf24; }
  .tool-icon-wrapper.red { color: #f87171; }

  .tool-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
  }

  .tool-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
  }

  .tool-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .tool-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .badge-popular {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
  }

  .badge-new {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
  }

  .tool-action-arrow {
    color: var(--text-dark);
    font-size: 12px;
    transition: transform var(--transition-fast);
  }

  .tool-card:hover .tool-action-arrow {
    color: var(--accent);
    transform: translateX(4px);
  }

  /* ==========================================================================
     PAGE & SUB-PAGE SHELL
     ========================================================================== */

  .page {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }

  @starting-style {
    .page.active {
      opacity: 0;
      transform: translateY(12px);
    }
  }

  /* Sidebar Grid Layout */
  .page-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
    margin-top: 24px;
  }

  @media (max-width: 992px) {
    .page-with-sidebar {
      grid-template-columns: 1fr;
    }
    
    .sidebar {
      display: none;
    }
  }

  /* Sidebar Widgets */
  .sidebar-sticky {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .sidebar-card {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
  }

  .sidebar-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
  }

  .sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition-fast);
    background: var(--surface-secondary);
    border: 1px solid var(--border);
  }

  .sidebar-link:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateX(2px);
  }

  .sidebar-link-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
  }

  /* Breadcrumbs */
  .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
  }

  .breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
  }

  .breadcrumbs a:hover {
    color: var(--accent);
  }

  .breadcrumbs span {
    color: var(--text-dark);
  }

  /* Tool Header */
  .tool-header-block {
    margin-bottom: 24px;
  }

  .tool-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
  }

  .tool-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 800px;
  }

  /* ==========================================================================
     INTERACTIVE WORKSPACE
     ========================================================================== */

  /* Tool control bars */
  .workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
  }

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

  .workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }

  @media (max-width: 768px) {
    .workspace-grid {
      grid-template-columns: 1fr;
    }
  }

  /* Workspace Editor Panels */
  .editor-panel {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border);
  }

  .panel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .panel-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .panel-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--accent);
  }

  /* Custom input selections */
  .select-pill {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
  }

  .select-pill:hover {
    background: var(--surface);
    border-color: var(--border-hover);
  }

  /* Code Textarea/Display */
  .editor-textarea {
    width: 100%;
    min-height: 420px;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    resize: vertical;
    background: transparent;
    border: none;
    outline: none;
    tab-size: 2;
  }

  .editor-textarea::placeholder {
    color: var(--text-dark);
  }

  /* Output Display Area */
  .editor-output {
    min-height: 420px;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: text;
    background: transparent;
    color: var(--text);
    flex-grow: 1;
  }

  /* Status Bars */
  .panel-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--surface-secondary);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
  }

  .status-message {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
  }

  .status-success { color: var(--success); }
  .status-error { color: var(--error); }
  .status-warning { color: var(--warning); }

  /* Tree-View Nodes formatting */
  .tree-node {
    padding-left: 18px;
    position: relative;
  }
  
  .tree-node-toggle {
    cursor: pointer;
    user-select: none;
    color: var(--text-dark);
    font-weight: 700;
    transition: var(--transition-fast);
  }

  .tree-node-toggle:hover {
    color: var(--accent);
  }

  /* Syntax Highlighting */
  .json-key { color: var(--accent); font-weight: 600; }
  .json-string { color: var(--success); }
  .json-number { color: var(--warning); }
  .json-bool { color: var(--accent-secondary); }
  .json-null { color: var(--error); }

  /* ==========================================================================
     TABS & EXPLANATION DETAILS
     ========================================================================== */

  .tabs-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
  }

  .tab-headers {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
  }

  .tab-header-btn {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
  }

  .tab-header-btn:hover {
    color: var(--text);
  }

  .tab-header-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .tab-content-panel {
    display: none;
  }

  .tab-content-panel.active {
    display: block;
    animation: fade-in var(--transition-medium);
  }

  @keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .content-typography h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--text);
  }

  .content-typography h3 {
    font-size: 15px;
    margin: 20px 0 10px;
    color: var(--text);
  }

  .content-typography p {
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.7;
  }

  .content-typography ul, .content-typography ol {
    margin-left: 20px;
    margin-bottom: 16px;
  }

  .content-typography li {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
  }

  .content-typography code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--warning);
  }

  .content-typography pre {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    overflow-x: auto;
    margin: 16px 0;
    color: var(--text-muted);
  }

  /* Grid details */
  .grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
  }

  .feature-item-card {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
  }

  .feature-item-icon {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .feature-item-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
  }

  .feature-item-desc {
    font-size: 12px;
    color: var(--text-muted);
  }

  /* Steps component */
  .instructions-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
  }

  .step-block {
    display: flex;
    gap: 16px;
  }

  .step-badge {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-circle);
    background: var(--accent-glow);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .step-main {
    padding-top: 3px;
  }

  .step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }

  .step-desc {
    font-size: 13px;
    color: var(--text-muted);
  }

  /* FAQ Accordion list */
  .faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .faq-row {
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .faq-question {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text);
    user-select: none;
    transition: var(--transition-fast);
  }

  .faq-question:hover {
    color: var(--accent);
    background: var(--surface);
  }

  .faq-icon {
    font-size: 14px;
    color: var(--text-dark);
    transition: transform var(--transition-medium);
  }

  .faq-row.open .faq-icon {
    transform: rotate(45deg);
    color: var(--accent);
  }

  .faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    transition: max-height var(--transition-medium), padding var(--transition-medium);
  }

  .faq-row.open .faq-answer {
    padding: 0 20px 16px;
    max-height: 300px; /* Allow enough height to show answer */
  }

  /* ==========================================================================
     SPOTLIGHT MODAL & NOTIFICATIONS
     ========================================================================== */

  /* Spotlight Search Dialog */
  .spotlight-modal {
    margin: 10vh auto auto;
    width: 90%;
    max-width: 580px;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    overflow: hidden;
    
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.25s var(--easing-premium), transform 0.25s var(--easing-premium), display 0.25s allow-discrete, overlay 0.25s allow-discrete;
  }

  .spotlight-modal[open] {
    opacity: 1;
    transform: scale(1);
  }

  @starting-style {
    .spotlight-modal[open] {
      opacity: 0;
      transform: scale(0.95);
    }
  }

  .spotlight-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease-out, display 0.25s allow-discrete, overlay 0.25s allow-discrete;
  }

  .spotlight-modal[open]::backdrop {
    opacity: 1;
  }

  @starting-style {
    .spotlight-modal[open]::backdrop {
      opacity: 0;
    }
  }

  .spotlight-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-secondary);
  }

  .spotlight-input {
    flex-grow: 1;
    font-size: 15px;
    color: var(--text);
    outline: none;
  }

  .spotlight-input::placeholder {
    color: var(--text-dark);
  }

  .spotlight-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px 12px;
  }

  .spotlight-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: inherit;
  }

  .spotlight-item:hover, .spotlight-item.active {
    background: var(--surface-secondary);
  }

  .spotlight-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }

  .spotlight-item:hover .spotlight-item-icon {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.3);
  }

  .spotlight-item-meta {
    flex-grow: 1;
  }

  .spotlight-item-name {
    font-size: 13px;
    font-weight: 700;
  }

  .spotlight-item-desc {
    font-size: 11px;
    color: var(--text-muted);
  }

  .spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-secondary);
    font-size: 10px;
    color: var(--text-dark);
  }

  .spotlight-shortcut {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
  }

  /* Toasts */
  .toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
  }

  .toast {
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    
    transform: translateY(12px) scale(0.95);
    opacity: 0;
    transition: opacity 0.3s var(--easing-premium), transform 0.3s var(--easing-premium);
  }

  .toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .toast-icon {
    font-size: 16px;
  }

  .toast-success .toast-icon { color: var(--success); }
  .toast-error .toast-icon { color: var(--error); }
  .toast-info .toast-icon { color: var(--accent); }

  /* Mobile Navigation Drawer */
  .mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(var(--glass-blur));
    border-left: 1px solid var(--border);
    z-index: 1010;
    padding: 24px;
    display: none;
    flex-direction: column;
    gap: 24px;
    
    margin: 0 0 0 auto;
    height: 100vh;
    max-height: 100vh;
    border: none;
    
    transform: translateX(100%);
    transition: transform 0.3s var(--easing-premium), display 0.3s allow-discrete, overlay 0.3s allow-discrete;
  }

  .mobile-drawer[open] {
    display: flex;
    transform: translateX(0);
  }

  @starting-style {
    .mobile-drawer[open] {
      transform: translateX(100%);
    }
  }

  .mobile-drawer::backdrop {
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-out, display 0.3s allow-discrete, overlay 0.3s allow-discrete;
  }

  .mobile-drawer[open]::backdrop {
    opacity: 1;
  }

  @starting-style {
    .mobile-drawer[open]::backdrop {
      opacity: 0;
    }
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-drawer-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
  }

  .mobile-drawer-link:hover, .mobile-drawer-link.active {
    color: var(--text);
    background: var(--surface-secondary);
  }

  /* ==========================================================================
     BLOG / ABOUT / CONTACT PAGES
     ========================================================================== */

  /* Blog Cards */
  .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
  }

  .blog-card {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-medium);
    display: flex;
    flex-direction: column;
  }

  .blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
  }

  .blog-card-cover {
    height: 180px;
    position: relative;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
  }

  .blog-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
    opacity: 0.4;
  }

  .blog-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }

  .blog-card-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dark);
    margin-bottom: 8px;
  }

  .blog-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.3;
  }

  .blog-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
  }

  .blog-card-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .blog-card:hover .blog-card-more {
    text-decoration: underline;
  }

  /* Contact page form groups */
  .contact-form-card {
    max-width: 580px;
    margin-top: 32px;
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    transition: var(--transition-fast);
    outline: none;
  }

  .form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
  }

  .form-textarea {
    min-height: 140px;
    resize: vertical;
  }

  .form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
  }

  [data-theme="light"] .form-select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  }

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

  .site-footer {
    border-top: 1px solid var(--border);
    padding: 64px 0 40px;
    margin-top: 96px;
    background: rgba(var(--accent-rgb), 0.01);
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
  }

  @media (max-width: 768px) {
    .footer-grid {
      grid-template-columns: 1fr;
      gap: 32px;
    }
  }

  .footer-brand p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 16px;
    max-width: 320px;
    line-height: 1.6;
  }

  .footer-col-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
  }

  .footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .footer-link-item {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
  }

  .footer-link-item:hover {
    color: var(--text);
    transform: translateX(2px);
  }

  .footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
  }

  .footer-bottom p {
    font-size: 13px;
    color: var(--text-dark);
  }

  .footer-legal-links {
    display: flex;
    gap: 20px;
  }

  .footer-legal-link {
    font-size: 13px;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
  }

  .footer-legal-link:hover {
    color: var(--text-muted);
  }

  /* Mock Advertisement Container styling */
  .ad-panel-container {
    background: var(--surface-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }

  .ad-label-tag {
    position: absolute;
    top: 4px;
    left: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-dark);
    letter-spacing: 0.1em;
  }

  /* Responsive header controls */
  @media (max-width: 768px) {
    .nav-menu {
      display: none;
    }
    .search-trigger {
      display: none;
    }
    .mobile-menu-btn {
      display: flex;
    }
  }
}

@layer utilities {
  /* Text align */
  .text-center { text-align: center; }
  
  /* Flex utilities */
  .flex { display: flex; }
  .flex-col { flex-direction: column; }
  .align-center { align-items: center; }
  .justify-between { justify-content: space-between; }
  
  /* Spacers */
  .mt-1 { margin-top: 4px; }
  .mt-2 { margin-top: 8px; }
  .mt-4 { margin-top: 16px; }
  .mt-8 { margin-top: 32px; }
  
  /* Width */
  .w-100 { width: 100%; }

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