/* App-specific styles for enhanced mobile experience */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--fill-secondary);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fill-primary);
}

/* Enhanced touch interactions */
.card,
.btn-primary,
.btn-secondary,
.card-button,
.theme-toggle {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Improved button press states */
.btn-primary:active,
.card-button:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary:active,
.theme-toggle:active {
    transform: translateY(0) scale(0.95);
}

/* Enhanced card interactions */
.card:active {
    transform: translateY(-2px) scale(0.99);
}

/* Card header interactions */
.card-header:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.card-header:active {
    background-color: var(--fill-quaternary);
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading {
    position: relative;
    color: transparent !important;
}

/* Pulse animation for hero elements */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.hero-icon:hover {
    animation: pulse 2s ease-in-out infinite;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced focus states for accessibility */
.card:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Toggle button animations */
.toggle-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn:active {
    transform: scale(0.9);
}

/* FAQ section enhancements */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Footer enhancements */
.footer-button:active {
    transform: scale(0.98);
}

/* Improved typography for better readability */
.card-title {
    font-feature-settings: 'kern' 1, 'liga' 1;
}

.hero-title {
    font-feature-settings: 'kern' 1, 'liga' 1, 'swsh' 1;
}

/* Enhanced shadows for depth */
.card:hover {
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .card:hover {
        box-shadow: 
            0 8px 25px rgba(0, 0, 0, 0.3),
            0 4px 10px rgba(0, 0, 0, 0.2);
    }
}

/* Optimized animations for better performance */
.fade-in-up {
    will-change: transform, opacity;
}

.card,
.btn-primary,
.btn-secondary,
.card-button {
    will-change: transform;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 1px solid var(--text-primary);
    }
    
    .btn-primary,
    .card-button {
        border: 2px solid white;
    }
    
    .btn-secondary {
        border: 2px solid var(--text-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .card:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .card-button:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .header,
    .theme-toggle,
    .cta-buttons {
        display: none;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    body {
        background: white;
        color: black;
    }
}