/**
 * Grand Tools Hub - CSS Design System Variables
 * Premium, consistent design tokens for all tools
 */

:root {
    /* ===================
       PRIMARY COLORS
       =================== */
    --gth-primary: #2563eb;
    --gth-primary-hover: #1d4ed8;
    --gth-primary-light: #dbeafe;
    --gth-primary-subtle: #eff6ff;

    /* ===================
       SECONDARY COLORS
       =================== */
    --gth-secondary: #64748b;
    --gth-secondary-hover: #475569;

    /* ===================
       SEMANTIC COLORS
       =================== */
    --gth-success: #10b981;
    --gth-success-light: #d1fae5;
    --gth-warning: #f59e0b;
    --gth-warning-light: #fef3c7;
    --gth-error: #ef4444;
    --gth-error-light: #fee2e2;
    --gth-info: #3b82f6;
    --gth-info-light: #dbeafe;

    /* ===================
       NEUTRAL PALETTE
       =================== */
    --gth-gray-50: #f8fafc;
    --gth-gray-100: #f1f5f9;
    --gth-gray-200: #e2e8f0;
    --gth-gray-300: #cbd5e1;
    --gth-gray-400: #94a3b8;
    --gth-gray-500: #64748b;
    --gth-gray-600: #475569;
    --gth-gray-700: #334155;
    --gth-gray-800: #1e293b;
    --gth-gray-900: #0f172a;

    /* ===================
       BACKGROUNDS & SURFACES
       =================== */
    --gth-bg-page: #f8fafc;
    --gth-bg-card: #ffffff;
    --gth-bg-input: #ffffff;
    --gth-bg-result: #f0f9ff;
    --gth-bg-code: #f1f5f9;

    /* ===================
       TEXT COLORS
       =================== */
    --gth-text-primary: #1e293b;
    --gth-text-secondary: #64748b;
    --gth-text-muted: #94a3b8;
    --gth-text-inverse: #ffffff;

    /* ===================
       BORDERS
       =================== */
    --gth-border-color: #e2e8f0;
    --gth-border-color-hover: #cbd5e1;
    --gth-border-color-focus: #2563eb;

    /* ===================
       TYPOGRAPHY
       =================== */
    --gth-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gth-font-mono: "SF Mono", Monaco, Inconsolata, "Roboto Mono", "Source Code Pro", monospace;

    /* Font Sizes */
    --gth-text-xs: 0.75rem;
    --gth-text-sm: 0.875rem;
    --gth-text-base: 1rem;
    --gth-text-lg: 1.125rem;
    --gth-text-xl: 1.25rem;
    --gth-text-2xl: 1.5rem;
    --gth-text-3xl: 1.875rem;
    --gth-text-4xl: 2.25rem;

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

    /* Line Heights */
    --gth-leading-tight: 1.25;
    --gth-leading-normal: 1.5;
    --gth-leading-relaxed: 1.625;

    /* ===================
       SPACING (8px base)
       =================== */
    --gth-space-1: 0.25rem;
    --gth-space-2: 0.5rem;
    --gth-space-3: 0.75rem;
    --gth-space-4: 1rem;
    --gth-space-5: 1.25rem;
    --gth-space-6: 1.5rem;
    --gth-space-8: 2rem;
    --gth-space-10: 2.5rem;
    --gth-space-12: 3rem;
    --gth-space-16: 4rem;

    /* ===================
       BORDER RADIUS
       =================== */
    --gth-radius-sm: 4px;
    --gth-radius-md: 8px;
    --gth-radius-lg: 12px;
    --gth-radius-xl: 16px;
    --gth-radius-full: 9999px;

    /* ===================
       SHADOWS
       =================== */
    --gth-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --gth-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --gth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --gth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gth-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Focus Ring */
    --gth-ring: 0 0 0 3px rgba(37, 99, 235, 0.2);
    --gth-ring-error: 0 0 0 3px rgba(239, 68, 68, 0.2);

    /* ===================
       TRANSITIONS
       =================== */
    --gth-duration-fast: 100ms;
    --gth-duration-normal: 150ms;
    --gth-duration-slow: 300ms;
    --gth-duration-slower: 500ms;

    --gth-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
    --gth-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --gth-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --gth-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* ===================
       BREAKPOINTS (reference)
       =================== */
    --gth-breakpoint-sm: 640px;
    --gth-breakpoint-md: 768px;
    --gth-breakpoint-lg: 1024px;
    --gth-breakpoint-xl: 1280px;
}

/* ===================
   DARK MODE
   =================== */
.gth-theme-dark,
.gth-tool[data-theme="dark"] {
    --gth-bg-page: #0f172a;
    --gth-bg-card: #1e293b;
    --gth-bg-input: #334155;
    --gth-bg-result: #1e3a5f;
    --gth-bg-code: #334155;

    --gth-text-primary: #f1f5f9;
    --gth-text-secondary: #94a3b8;
    --gth-text-muted: #64748b;

    --gth-border-color: #334155;
    --gth-border-color-hover: #475569;

    --gth-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --gth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    .gth-tool:not([data-theme="light"]) {
        --gth-bg-page: #0f172a;
        --gth-bg-card: #1e293b;
        --gth-bg-input: #334155;
        --gth-bg-result: #1e3a5f;
        --gth-bg-code: #334155;

        --gth-text-primary: #f1f5f9;
        --gth-text-secondary: #94a3b8;
        --gth-text-muted: #64748b;

        --gth-border-color: #334155;
        --gth-border-color-hover: #475569;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    :root {
        --gth-duration-fast: 0ms;
        --gth-duration-normal: 0ms;
        --gth-duration-slow: 0ms;
        --gth-duration-slower: 0ms;
    }
}
