/* Premium Design System Tokens */
:root {
    --fermi-blue: #3B7DBB;
    --fermi-navy: #2D1FB1;
    --fermi-orange: #F97316;
    --fermi-dark: #1E1E1E;
    --fermi-gray: #64748b;
    --fermi-bg: #F7F5F0;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

@layer base {
    * {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Exceptions for inputs and text areas */
    input, textarea, [contenteditable="true"] {
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
    }

    html {
        scroll-behavior: smooth;
    }
    
    body {
        background-color: var(--fermi-bg);
        color: var(--fermi-dark);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        overflow-x: hidden;
    }
}

@layer utilities {
    .glass {
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .glass-dark {
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .perspective-1000 {
        perspective: 1000px;
    }
    
    .bg-dot-pattern {
        background-color: var(--fermi-bg);
        background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
        background-size: 24px 24px;
    }

    .mesh-gradient {
        background-color: #3B7DBB;
        background-image: 
            radial-gradient(at 0% 0%, #2D1FB1 0, transparent 50%), 
            radial-gradient(at 100% 0%, #3B7DBB 0, transparent 50%), 
            radial-gradient(at 100% 100%, #1E1475 0, transparent 50%), 
            radial-gradient(at 0% 100%, #2D1FB1 0, transparent 50%);
    }

    /* Analyzer Animations */
    @keyframes orbit {
        from { transform: rotate(0deg) translateX(20px) rotate(0deg); }
        to   { transform: rotate(360deg) translateX(20px) rotate(-360deg); }
    }
    @keyframes pulse-soft {
        0%, 100% { transform: scale(1); opacity: 0.8; }
        50% { transform: scale(1.05); opacity: 1; }
    }
    .analyzer-orb {
        animation: orbit 3s linear infinite;
    }
    .analyzer-orb-delayed {
        animation: orbit 3s linear infinite -1.5s;
    }

    /* Premium Analyzing State */
    .analyzing-overlay {
        position: fixed;
        inset: 0;
        background: rgba(247, 245, 240, 0.8);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: all 0.5s ease;
    }

    .analyzer-container {
        position: relative;
        width: 120px;
        height: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .analyzer-core {
        width: 64px;
        height: 64px;
        background: linear-gradient(135deg, var(--fermi-navy), var(--fermi-blue));
        border-radius: 50%;
        box-shadow: 0 0 40px rgba(45, 31, 177, 0.3);
        animation: pulse-soft 2s ease-in-out infinite;
    }

    .analyzer-ring {
        position: absolute;
        inset: -10px;
        border: 2px solid rgba(45, 31, 177, 0.1);
        border-radius: 50%;
    }

    /* Premium Button Polish */
    .btn-premium {
        height: 54px;
        padding: 0 32px;
        border-radius: 27px;
        font-weight: 700;
        font-size: 16px;
        letter-spacing: -0.01em;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .btn-premium:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }

    .btn-premium:active {
        transform: translateY(0);
        scale: 0.98;
    }
}

/* Transitions */
* {
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scaling for images */
img {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Autofill fixes */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #f1f1f1 inset !important;
    -webkit-text-fill-color: #333 !important;
    background-color: transparent !important;
}

/* Focus outline overrides */
input:focus {
    outline: none;
}
