/**
 * Performance & Navigation Enhancements
 * Improves user experience during navigation to Flutter app
 */

/* Enhanced button hover effects for better feedback */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
}

/* Loading state for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth page transitions */
body {
    transition: opacity 0.3s ease-out;
}

body.navigating {
    opacity: 0.95;
}

/* Preload indicators */
.preloading {
    position: relative;
}

.preloading::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    animation: preloadProgress 2s ease-in-out infinite;
}

@keyframes preloadProgress {
    0%, 100% { 
        opacity: 0;
        transform: scaleX(0);
    }
    50% { 
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* Performance hints */
.performance-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.performance-hint.show {
    opacity: 1;
}

/* Accessibility improvements */
.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn::before,
    body {
        transition: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    @keyframes spin {
        to { transform: none; }
    }
}
