/**
 * MBTI人格乐园 Design System Tokens
 * Semantic design tokens based on brand identity
 */

:root {
    /* ========================================
       SEMANTIC COLOR TOKENS - LIGHT THEME
       ======================================== */

    /* Primary Colors */
    --color-primary: #6366f1;
    --color-primary-50: #e0e7ff;
    --color-primary-100: #c7d2fe;
    --color-primary-200: #a5b4fc;
    --color-primary-300: #818cf8;
    --color-primary-400: #6366f1;
    --color-primary-500: #4f46e5;
    --color-primary-600: #4338ca;
    --color-primary-700: #3730a3;
    --color-primary-800: #312e81;
    --color-primary-900: #1e1b4b;

    /* Secondary Colors */
    --color-secondary: #764ba2;
    --color-secondary-50: #f3e8ff;
    --color-secondary-100: #e9d5ff;
    --color-secondary-200: #d8b4fe;
    --color-secondary-300: #c084fc;
    --color-secondary-400: #a855f7;
    --color-secondary-500: #9333ea;
    --color-secondary-600: #7e22ce;
    --color-secondary-700: #6b21a8;
    --color-secondary-800: #581c87;
    --color-secondary-900: #4a044e;

    /* Neutral Colors */
    --color-neutral-50: #fafafa;
    --color-neutral-100: #f5f5f5;
    --color-neutral-200: #e5e7eb;
    --color-neutral-300: #d1d5db;
    --color-neutral-400: #9ca3af;
    --color-neutral-500: #6b7280;
    --color-neutral-600: #4b5563;
    --color-neutral-700: #374151;
    --color-neutral-800: #1f2937;
    --color-neutral-900: #111827;

    /* Semantic Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    --text-link: #6366f1;
    --text-link-hover: #4f46e5;

    /* Semantic Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-hover: #f0f1f3;
    --bg-active: #e0e7ff;
    --bg-disabled: #e5e7eb;

    /* Semantic Border Colors */
    --border-default: #e5e7eb;
    --border-hover: #d1d5db;
    --border-focus: #6366f1;
    --border-active: #4f46e5;
    --border-disabled: #f3f4f6;

    /* Status Colors */
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-success-dark: #065f46;

    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-warning-dark: #92400e;

    --color-error: #ef4444;
    --color-error-light: #fee2e2;
    --color-error-dark: #b91c1c;

    --color-info: #3b82f6;
    --color-info-light: #dbeafe;
    --color-info-dark: #1d4ed8;

    /* MBTI Type Colors */
    --mbti-nt-indigo: #6366f1;
    --mbti-nt-violet: #8b5cf6;
    --mbti-nt-red: #ef4444;
    --mbti-nt-amber: #f59e0b;

    --mbti-nf-emerald: #10b981;
    --mbti-nf-teal: #14b8a6;
    --mbti-nf-blue: #3b82f6;
    --mbti-nf-green: #22c55e;

    --mbti-sj-slate: #64748b;
    --mbti-sj-zinc: #94a3b8;
    --mbti-sj-orange: #d97706;
    --mbti-sj-yellow: #fbbf24;

    --mbti-sp-stone: #78716c;
    --mbti-sp-neutral: #d6d3d1;
    --mbti-sp-rose: #dc2626;
    --mbti-sp-pink: #fb7185;

    /* ========================================
       GRADIENTS
       ======================================== */
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --gradient-secondary: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);

    /* ========================================
       TYPOGRAPHY TOKENS
       ======================================== */

    /* Font Families */
    --font-family-base: 'Microsoft YaHei', 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
    --font-family-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

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

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

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2;

    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;

    /* ========================================
       SPACING TOKENS
       ======================================== */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* ========================================
       BORDER RADIUS TOKENS
       ======================================== */
    --radius-none: 0;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* ========================================
       SHADOW TOKENS
       ======================================== */
    --shadow-none: 0 0 0 0 transparent;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Colored Shadows */
    --shadow-primary: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
    --shadow-success: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
    --shadow-error: 0 4px 14px 0 rgba(239, 68, 68, 0.39);

    /* ========================================
       TRANSITION TOKENS
       ======================================== */
    --transition-none: 0s;
    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;

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

    /* ========================================
       Z-INDEX TOKENS
       ======================================== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* ========================================
       LAYOUT TOKENS
       ======================================== */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;

    /* ========================================
       COMPONENT SPECIFIC TOKENS
       ======================================== */

    /* Buttons */
    --btn-height-sm: 32px;
    --btn-height-md: 40px;
    --btn-height-lg: 48px;
    --btn-padding-x-sm: 12px;
    --btn-padding-x-md: 16px;
    --btn-padding-x-lg: 24px;

    /* Inputs */
    --input-height-sm: 32px;
    --input-height-md: 40px;
    --input-height-lg: 48px;
    --input-padding-x: 12px;

    /* Cards */
    --card-padding: 24px;
    --card-padding-sm: 16px;
    --card-padding-lg: 32px;

    /* Avatar */
    --avatar-size-xs: 24px;
    --avatar-size-sm: 32px;
    --avatar-size-md: 40px;
    --avatar-size-lg: 48px;
    --avatar-size-xl: 64px;

    /* Badge */
    --badge-font-size: 0.75rem;
    --badge-padding-x: 8px;
    --badge-padding-y: 2px;

    /* Chip */
    --chip-height: 28px;
    --chip-padding-x: 12px;
    --chip-font-size: 0.875rem;

    /* ========================================
       ANIMATION TOKENS
       ======================================== */
    --animation-bounce: bounce 1s infinite;
    --animation-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    --animation-spin: spin 1s linear infinite;
    --animation-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ========================================
   DARK THEME OVERRIDES
   ======================================== */

[data-theme="dark"] {
    /* Semantic Text Colors */
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;

    /* Semantic Background Colors */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-hover: #374151;
    --bg-active: #3730a3;
    --bg-disabled: #374151;

    /* Semantic Border Colors */
    --border-default: #374151;
    --border-hover: #4b5563;
    --border-focus: #818cf8;
    --border-active: #a5b4fc;
    --border-disabled: #4b5563;

    /* Neutral Colors */
    --color-neutral-50: #111827;
    --color-neutral-100: #1f2937;
    --color-neutral-200: #374151;
    --color-neutral-300: #4b5563;
    --color-neutral-400: #6b7280;
    --color-neutral-500: #9ca3af;
    --color-neutral-600: #d1d5db;
    --color-neutral-700: #e5e7eb;
    --color-neutral-800: #f3f4f6;
    --color-neutral-900: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

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

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}
