/* ================================================================
   KITOTOOL — CSS VARIABLES (Premium Modern Design v2.1)
   Version: 2.1 | 2026-04-12
   Polished UI with stronger shadows, accent colors, premium feel
   ================================================================ */

/* ===== 1. COLORS — Light Mode ===== */
:root {
  /* Primary — Premium Indigo */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-primary-lighter: #f5f3ff;

  /* Accent — Cyan */
  --color-accent: #0891b2;
  --color-accent-hover: #0e7490;

  /* Secondary — Violet */
  --color-secondary: #7c3aed;
  --color-secondary-hover: #6d28d9;
  --color-secondary-light: #f5f3ff;

  /* Semantic Colors */
  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-success-dark: #065f46;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-warning-dark: #92400e;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-error-dark: #991b1b;
  --color-info: #2563eb;
  --color-info-light: #dbeafe;
  --color-info-dark: #1e40af;

  /* Neutrals — Rich Gray Scale */
  --color-bg: #f8fafc;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-bg-elevated: #f8fafc;
  --color-surface: #f8fafc;

  /* Borders — Visible but subtle */
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-border-strong: #94a3b8;

  /* Text */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;

  /* Surface / Overlay */
  --color-overlay: rgba(15, 23, 42, 0.5);
  --color-overlay-light: rgba(15, 23, 42, 0.03);

  /* ===== 2. SHADOWS — Premium Depth System ===== */
  /* Level 0 — Flat (no shadow) */
  --shadow-none: none;

  /* Level 1 — Border ring */
  --shadow-border: 0 0 0 1px var(--color-border);
  --shadow-border-hover: 0 0 0 1px var(--color-border-hover);
  --shadow-border-strong: 0 0 0 1px var(--color-border-strong);
  --shadow-border-primary: 0 0 0 1px var(--color-primary);

  /* Level 2 — Subtle card (light lift) */
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.06), 0 0 0 1px var(--color-border);

  /* Level 3 — Card with soft depth */
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -1px rgba(15, 23, 42, 0.04), 0 0 0 1px var(--color-border);

  /* Level 4 — Elevated (hover/active state) */
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px var(--color-border);

  /* Level 5 — Full elevation */
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 10px 10px -5px rgba(15, 23, 42, 0.04), 0 0 0 1px var(--color-border);

  /* Legacy shadows */
  --shadow-xs: var(--shadow-subtle);
  --shadow-sm: var(--shadow-card);
  --shadow-md: var(--shadow-lg);
  --shadow-lg: var(--shadow-lg);
  --shadow-xl: var(--shadow-xl);

  /* Glow variants */
  --shadow-glow: 0 0 0 1px var(--color-primary), 0 8px 24px -4px rgba(79, 70, 229, 0.25);
  --shadow-glow-sm: 0 0 0 1px var(--color-primary-light), 0 4px 12px -2px rgba(79, 70, 229, 0.15);
  --shadow-success: 0 0 0 1px var(--color-success), 0 4px 12px -2px rgba(5, 150, 105, 0.2);

  /* Focus ring */
  --shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.15);
  --shadow-focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary);

  /* ===== 3. TYPOGRAPHY ===== */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Monaco, 'Consolas', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.8125rem;   /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-lg: 1.0625rem;    /* 17px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* ===== 4. SPACING — 4px base ===== */
  --space-0: 0;
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* ===== 5. LAYOUT ===== */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-max: 100%;
  --container-gutter: var(--space-6);
  /* Backward-compatible aliases follow the responsive content container. */
  --container-xl: var(--container-max);
  --container-2xl: var(--container-max);
  --header-height: 64px;
  --sidebar-width: 300px;
  --max-content-width: 720px;

  /* ===== 6. TRANSITIONS & ANIMATIONS ===== */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ===== 7. Z-INDEX ===== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* ===== 8. BORDER RADIUS ===== */
  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;  /* 24px */
  --radius-full: 9999px;

  /* ===== 9. BREAKPOINTS ===== */
  --bp-xs: 400px;
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1200px;
  --bp-2xl: 1400px;

  /* ===== 10. COLOR SCHEME ===== */
  color-scheme: light;
}

/* Bootstrap-style content container widths. */
@media (min-width: 576px) {
  :root { --container-max: 640px; }
}

@media (min-width: 768px) {
  :root { --container-max: 720px; }
}

@media (min-width: 992px) {
  :root { --container-max: 960px; }
}

@media (min-width: 1200px) {
  :root { --container-max: 1140px; }
}

@media (min-width: 1400px) {
  :root { --container-max: 1320px; }
}

/* Responsive page gutters live with the token so repeated legacy imports
   cannot reset tool pages back to the desktop spacing. */
@media (max-width: 1024px) {
  :root { --container-gutter: var(--space-5); }
}

@media (max-width: 768px) {
  :root { --container-gutter: var(--space-4); }
}

@media (max-width: 400px) {
  :root { --container-gutter: var(--space-3); }
}

/* ===== 11. BODY ===== */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after {
  font-feature-settings: "kern" 1;
}
