/* ============================================
   UNIFIED DESIGN TOKENS
   Landing Page + Studio + History Unification
   Blue-to-Purple Gradient Theme
   ============================================ */

:root {
    /* =============================================
       BACKGROUNDS - Deep Space Palette
       Unified from Studio + History pages
       ============================================= */

    --pf-bg-void: #030712;              /* Deepest void */
    --pf-bg-canvas: #0a0f1f;            /* Canvas layer */
    --pf-bg-primary: #111827;           /* Primary surfaces */
    --pf-bg-secondary: #1f2937;         /* Secondary surfaces */
    --pf-bg-tertiary: #374151;          /* Tertiary elements */

    /* =============================================
       GLASS SYSTEM - Frosted Transparency
       ============================================= */

    --pf-glass-subtle: rgba(15, 23, 42, 0.4);
    --pf-glass-1: rgba(15, 23, 42, 0.6);
    --pf-glass-2: rgba(30, 41, 59, 0.7);
    --pf-glass-3: rgba(51, 65, 85, 0.75);
    --pf-glass-solid: rgba(15, 23, 42, 0.92);

    /* Glass Borders */
    --pf-glass-border-faint: rgba(148, 163, 184, 0.04);
    --pf-glass-border-subtle: rgba(148, 163, 184, 0.08);
    --pf-glass-border-default: rgba(148, 163, 184, 0.12);
    --pf-glass-border-emphasis: rgba(148, 163, 184, 0.2);
    --pf-glass-border-strong: rgba(148, 163, 184, 0.3);

    /* Glass Shine Effects */
    --pf-glass-shine-subtle: rgba(255, 255, 255, 0.02);
    --pf-glass-shine-default: rgba(255, 255, 255, 0.05);
    --pf-glass-shine-emphasis: rgba(255, 255, 255, 0.08);

    /* Backdrop Filters */
    --pf-backdrop-subtle: blur(8px) saturate(180%);
    --pf-backdrop-default: blur(16px) saturate(180%);
    --pf-backdrop-strong: blur(24px) saturate(180%);
    --pf-backdrop-intense: blur(40px) saturate(200%);

    /* =============================================
       TEXT HIERARCHY
       High contrast for readability
       ============================================= */

    --pf-text-primary: #f8fafc;         /* Headlines */
    --pf-text-secondary: #e2e8f0;       /* Body */
    --pf-text-tertiary: #cbd5e1;        /* Captions */
    --pf-text-muted: #94a3b8;           /* Placeholders */
    --pf-text-subtle: #64748b;          /* Disabled */

    /* =============================================
       ACCENT COLORS - Blue to Purple Gradient
       Primary theme unifying Studio + History
       ============================================= */

    /* Apple Blue (from Studio) */
    --pf-blue: #0a84ff;
    --pf-blue-hover: #3399ff;
    --pf-blue-active: #0070e0;
    --pf-blue-glow: rgba(10, 132, 255, 0.4);
    --pf-blue-subtle: rgba(10, 132, 255, 0.15);

    /* Violet Purple (from History) */
    --pf-violet: #8b5cf6;
    --pf-violet-hover: #a78bfa;
    --pf-violet-active: #7c3aed;
    --pf-violet-glow: rgba(139, 92, 246, 0.4);
    --pf-violet-subtle: rgba(139, 92, 246, 0.15);

    /* Pink Accent (tertiary) */
    --pf-pink: #ec4899;
    --pf-pink-glow: rgba(236, 72, 153, 0.4);

    /* Status Colors */
    --pf-success: #22c55e;
    --pf-success-subtle: rgba(34, 197, 94, 0.15);
    --pf-warning: #f59e0b;
    --pf-warning-subtle: rgba(245, 158, 11, 0.15);
    --pf-error: #ef4444;
    --pf-error-subtle: rgba(239, 68, 68, 0.15);
    --pf-info: #3b82f6;
    --pf-info-subtle: rgba(59, 130, 246, 0.15);

    /* =============================================
       GRADIENTS - Blue to Purple Theme
       ============================================= */

    /* Primary Gradient - Blue to Purple */
    --pf-gradient-primary: linear-gradient(135deg, #0a84ff 0%, #8b5cf6 100%);
    --pf-gradient-primary-hover: linear-gradient(135deg, #3399ff 0%, #a78bfa 100%);

    /* Text Gradients */
    --pf-gradient-text: linear-gradient(135deg, #0a84ff 0%, #8b5cf6 50%, #ec4899 100%);
    --pf-gradient-text-subtle: linear-gradient(135deg, #f8fafc 0%, #a78bfa 100%);

    /* Glow Gradients for Background */
    --pf-gradient-glow-blue: radial-gradient(ellipse at center, rgba(10, 132, 255, 0.3) 0%, transparent 70%);
    --pf-gradient-glow-violet: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    --pf-gradient-glow-combined: radial-gradient(ellipse at center, rgba(10, 132, 255, 0.2) 0%, rgba(139, 92, 246, 0.15) 50%, transparent 80%);

    /* Glass Gradients */
    --pf-gradient-glass-shine: linear-gradient(180deg, var(--pf-glass-shine-default) 0%, transparent 50%);
    --pf-gradient-glass-edge: linear-gradient(90deg, transparent 0%, var(--pf-glass-border-emphasis) 50%, transparent 100%);

    /* =============================================
       SHADOWS - Depth and Glow
       ============================================= */

    /* Standard Shadows */
    --pf-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --pf-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --pf-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.35);
    --pf-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
    --pf-shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.45);

    /* Glass Shadows with Inset Shine */
    --pf-shadow-glass:
        0 4px 6px -1px rgba(0, 0, 0, 0.25),
        0 2px 4px -2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 var(--pf-glass-shine-subtle);

    --pf-shadow-glass-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.35),
        0 4px 6px -4px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 var(--pf-glass-shine-default);

    --pf-shadow-glass-xl:
        0 20px 25px -5px rgba(0, 0, 0, 0.4),
        0 8px 10px -6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 var(--pf-glass-shine-emphasis);

    /* Glow Shadows - Blue to Purple */
    --pf-shadow-glow-blue:
        0 0 20px rgba(10, 132, 255, 0.3),
        0 0 40px rgba(10, 132, 255, 0.15);

    --pf-shadow-glow-violet:
        0 0 20px rgba(139, 92, 246, 0.3),
        0 0 40px rgba(139, 92, 246, 0.15);

    --pf-shadow-glow-combined:
        0 0 30px rgba(10, 132, 255, 0.25),
        0 0 60px rgba(139, 92, 246, 0.2);

    --pf-shadow-glow-intense:
        0 0 40px rgba(10, 132, 255, 0.35),
        0 0 80px rgba(139, 92, 246, 0.25),
        0 0 120px rgba(236, 72, 153, 0.1);

    /* Focus Ring */
    --pf-shadow-focus: 0 0 0 3px rgba(10, 132, 255, 0.3);

    /* =============================================
       SPACING - 8px Grid
       ============================================= */

    --pf-space-1: 0.25rem;   /* 4px */
    --pf-space-2: 0.5rem;    /* 8px */
    --pf-space-3: 0.75rem;   /* 12px */
    --pf-space-4: 1rem;      /* 16px */
    --pf-space-5: 1.25rem;   /* 20px */
    --pf-space-6: 1.5rem;    /* 24px */
    --pf-space-8: 2rem;      /* 32px */
    --pf-space-10: 2.5rem;   /* 40px */
    --pf-space-12: 3rem;     /* 48px */
    --pf-space-16: 4rem;     /* 64px */
    --pf-space-20: 5rem;     /* 80px */

    /* =============================================
       BORDER RADIUS
       ============================================= */

    --pf-radius-sm: 8px;
    --pf-radius-md: 12px;
    --pf-radius-lg: 16px;
    --pf-radius-xl: 20px;
    --pf-radius-2xl: 24px;
    --pf-radius-full: 9999px;

    /* =============================================
       ANIMATION TIMING
       Apple-inspired curves
       ============================================= */

    /* Durations */
    --pf-duration-instant: 50ms;
    --pf-duration-fast: 150ms;
    --pf-duration-base: 250ms;
    --pf-duration-slow: 400ms;
    --pf-duration-slower: 600ms;

    /* Easing Curves */
    --pf-ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --pf-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --pf-ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --pf-ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* =============================================
       Z-INDEX SCALE
       ============================================= */

    --pf-z-base: 1;
    --pf-z-dropdown: 100;
    --pf-z-sticky: 200;
    --pf-z-fixed: 300;
    --pf-z-modal-backdrop: 400;
    --pf-z-modal: 500;
    --pf-z-popover: 600;
    --pf-z-tooltip: 700;
}

/* =============================================
   KEYFRAME ANIMATIONS
   Reusable across components
   ============================================= */

/* Gradient Orb Float */
@keyframes pf-orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -20px) scale(1.05);
    }
    50% {
        transform: translate(-10px, 10px) scale(0.98);
    }
    75% {
        transform: translate(-20px, -10px) scale(1.02);
    }
}

/* Gradient Text Flow */
@keyframes pf-gradient-flow {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Fade In Up */
@keyframes pf-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Scale */
@keyframes pf-fade-in-scale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Glow */
@keyframes pf-pulse-glow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Shimmer Effect */
@keyframes pf-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* =============================================
   REDUCED MOTION SUPPORT
   ============================================= */

@media (prefers-reduced-motion: reduce) {
    :root {
        --pf-duration-instant: 0ms;
        --pf-duration-fast: 0ms;
        --pf-duration-base: 0ms;
        --pf-duration-slow: 0ms;
        --pf-duration-slower: 0ms;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
