/**
 * Premium Polish v1.0
 * 
 * Additional styling for a premium, professional experience.
 * Works in all modern browsers without PWA requirement.
 */

/* ==================== Premium Typography ==================== */

/* Professional sans-serif stack */
.font-premium {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv11' 1, 'ss01' 1;
}

/* Improved readability */
.text-readable {
    line-height: 1.7;
    letter-spacing: -0.01em;
}

/* Display text */
.text-display {
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* Monospace for code/numbers */
.font-mono-premium {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, monospace;
    font-feature-settings: 'liga' 0;
}

/* ==================== Premium Colors ==================== */

:root {
    /* Brand colors - professional, not flashy */
    --premium-primary: #3B82F6;
    --premium-primary-dark: #2563EB;
    --premium-primary-light: #60A5FA;
    
    /* Accent */
    --premium-accent: #8B5CF6;
    --premium-accent-light: #A78BFA;
    
    /* Success/Error - muted versions */
    --premium-success: #10B981;
    --premium-error: #EF4444;
    --premium-warning: #F59E0B;
    
    /* Neutral palette */
    --premium-bg-dark: #0F172A;
    --premium-bg-card: #1E293B;
    --premium-border: #334155;
    --premium-border-light: #475569;
    
    /* Text hierarchy */
    --premium-text: #F1F5F9;
    --premium-text-muted: #94A3B8;
    --premium-text-subtle: #64748B;
}

/* ==================== Premium Surfaces ==================== */

/* Glass morphism - subtle */
.glass-premium {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Premium card */
.card-premium {
    background: var(--premium-bg-card);
    border: 1px solid var(--premium-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.card-premium:hover {
    border-color: var(--premium-border-light);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

/* Elevated surface */
.surface-elevated {
    background: linear-gradient(
        180deg,
        rgba(30, 41, 59, 1) 0%,
        rgba(15, 23, 42, 1) 100%
    );
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ==================== Premium Buttons ==================== */

.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.btn-premium:focus-visible {
    outline: 2px solid var(--premium-primary);
    outline-offset: 2px;
}

.btn-premium-primary {
    background: var(--premium-primary);
    color: white;
}

.btn-premium-primary:hover {
    background: var(--premium-primary-dark);
    transform: translateY(-1px);
}

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

.btn-premium-secondary {
    background: transparent;
    color: var(--premium-text);
    border: 1px solid var(--premium-border);
}

.btn-premium-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--premium-border-light);
}

/* Ghost button */
.btn-premium-ghost {
    background: transparent;
    color: var(--premium-text-muted);
    padding: 8px 12px;
}

.btn-premium-ghost:hover {
    color: var(--premium-text);
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== Premium Inputs ==================== */

.input-premium {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--premium-border);
    border-radius: 10px;
    color: var(--premium-text);
    font-size: 15px;
    transition: all 0.15s ease;
}

.input-premium:hover {
    border-color: var(--premium-border-light);
}

.input-premium:focus {
    outline: none;
    border-color: var(--premium-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-premium::placeholder {
    color: var(--premium-text-subtle);
}

/* ==================== Premium Scrollbar ==================== */

/* Webkit browsers */
.scrollbar-premium::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollbar-premium::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-premium::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 4px;
}

.scrollbar-premium::-webkit-scrollbar-thumb:hover {
    background: var(--premium-border-light);
}

/* Firefox */
.scrollbar-premium {
    scrollbar-width: thin;
    scrollbar-color: var(--premium-border) transparent;
}

/* ==================== Premium Animations ==================== */

/* Subtle fade in */
@keyframes premium-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-premium-in {
    animation: premium-fade-in 0.2s ease-out;
}

/* Pulse for attention */
@keyframes premium-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-premium-pulse {
    animation: premium-pulse 2s ease-in-out infinite;
}

/* Subtle scale */
@keyframes premium-scale {
    0% {
        transform: scale(0.98);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-premium-scale {
    animation: premium-scale 0.15s ease-out;
}

/* ==================== Mobile Optimizations ==================== */

@media (max-width: 768px) {
    /* Larger touch targets */
    .btn-premium {
        min-height: 48px;
        padding: 14px 20px;
    }
    
    .input-premium {
        min-height: 48px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Better spacing */
    .card-premium {
        border-radius: 16px;
        padding: 16px;
    }
    
    /* Smoother scrolling */
    .scroll-container {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
}

/* ==================== iOS Specific ==================== */

@supports (-webkit-touch-callout: none) {
    /* Safe area padding */
    .safe-area-bottom {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .safe-area-top {
        padding-top: max(16px, env(safe-area-inset-top));
    }
    
    /* Prevent elastic scroll */
    body {
        overscroll-behavior: none;
    }
    
    /* Better input styling */
    input, textarea, select {
        -webkit-appearance: none;
        appearance: none;
    }
}

/* ==================== Android Specific ==================== */

@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    /* Higher contrast for AMOLED */
    .card-premium {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Smoother touch feedback */
    button, a {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }
}

/* ==================== Reduced Motion ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== Focus States ==================== */

/* Keyboard focus only */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--premium-primary);
    outline-offset: 2px;
}

/* ==================== Loading States ==================== */

.skeleton-premium {
    background: linear-gradient(
        90deg,
        var(--premium-border) 0%,
        var(--premium-border-light) 50%,
        var(--premium-border) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== Utility Classes ==================== */

/* Transitions */
.transition-premium {
    transition: all 0.15s ease;
}

.transition-fast {
    transition: all 0.1s ease;
}

.transition-slow {
    transition: all 0.3s ease;
}

/* Shadows */
.shadow-premium-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.shadow-premium {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.shadow-premium-lg {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* Borders */
.border-premium {
    border: 1px solid var(--premium-border);
}

.border-premium-light {
    border: 1px solid var(--premium-border-light);
}

/* Rounded corners */
.rounded-premium {
    border-radius: 12px;
}

.rounded-premium-lg {
    border-radius: 16px;
}

.rounded-premium-full {
    border-radius: 9999px;
}

