/* ===== UX IMPROVEMENTS - FOCO NA EXPERIÊNCIA DO USUÁRIO ===== */

/* ===== 1. SKELETON LOADING ===== */
.skeleton-loading {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

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

.raspinha-card.skeleton {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    height: 320px;
}

.skeleton-banner {
    height: 120px;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-description {
    height: 16px;
    width: 90%;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-price {
    height: 20px;
    width: 40%;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-button {
    height: 40px;
    width: 100%;
    border-radius: 10px;
}

/* ===== 2. MELHORIAS DE ACESSIBILIDADE ===== */
/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #05DB00;
    color: #000;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* ARIA Labels e Roles */
.raspinha-card[role="button"] {
    cursor: pointer;
}

.raspinha-card[role="button"]:focus {
    outline: 2px solid #05DB00;
    outline-offset: 2px;
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .raspinha-card {
        border: 2px solid #ffffff;
    }
    
    .play-btn {
        border: 2px solid #ffffff;
    }
}

/* ===== 3. MELHORIAS MOBILE ===== */
/* Touch Targets - Mínimo 44px */
.play-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px;
}

.category-badge {
    min-height: 32px;
    min-width: 32px;
    padding: 6px 12px;
}

/* Pull to Refresh Indicator */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #05DB00, #05DB00);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.pull-refresh-indicator.active {
    transform: scaleX(1);
}

/* ===== 4. MICRO-INTERAÇÕES AVANÇADAS ===== */
/* Hover Effects Melhorados */
.raspinha-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.raspinha-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 15px 30px rgba(5, 219, 0, 0.2);
}

/* Focus States Melhorados */
.raspinha-card:focus-within {
    outline: 2px solid #05DB00;
    outline-offset: 4px;
    box-shadow: 0 0 0 4px rgba(5, 219, 0, 0.2);
}

/* Active States */
.raspinha-card:active {
    transform: translateY(-4px) scale(0.98);
    transition: all 0.1s ease;
}

/* ===== 5. FEEDBACK VISUAL MELHORADO ===== */
/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #05DB00;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success States */
.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Error States */
.error-shake {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== 6. PROGRESSIVE ENHANCEMENT ===== */
/* Fallback para JavaScript desabilitado */
.no-js .raspinha-card {
    cursor: pointer;
}

.no-js .play-btn {
    background: #05DB00;
    color: #000;
    text-decoration: none;
    display: inline-block;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== 7. PERFORMANCE OPTIMIZATIONS ===== */
/* Will-change para animações */
.raspinha-card {
    will-change: transform, box-shadow;
}

.play-btn {
    will-change: transform, background-color;
}

/* Containment para melhor performance */
.raspadinhas-grid {
    contain: layout style paint;
}

/* ===== 8. SOCIAL PROOF ELEMENTOS ===== */




/* ===== 9. GAMIFICAÇÃO ===== */
/* Achievement Badges */
.achievement-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
    animation: achievementGlow 2s ease-in-out infinite;
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.5); }
    50% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.8); }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #05DB00, #05DB00);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== 10. RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Melhorar áreas de toque */
    .play-btn {
        min-height: 48px;
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .category-badge {
        min-height: 36px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    /* Otimizar espaçamento */
    .raspadinhas-grid {
        gap: 1rem;
    }
    
    .raspinha-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    /* Ajustes para telas muito pequenas */
    .play-btn {
        min-height: 52px;
        padding: 16px 20px;
        font-size: 1.1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-description {
        font-size: 0.8rem;
    }
}

/* ===== 11. DARK/LIGHT MODE SUPPORT ===== */
@media (prefers-color-scheme: light) {
    .raspinha-card {
        background: linear-gradient(145deg, #ffffff, #f8f9fa);
        border: 1px solid #e9ecef;
        color: #212529;
    }
    
    .card-title {
        color: #212529;
    }
    
    .card-description {
        color: #6c757d;
    }
    
    .play-btn {
        background: #05DB00;
        color: #ffffff;
    }
}

/* ===== 12. PRINT STYLES ===== */
@media print {
    .raspinha-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .play-btn,
    .category-badge {
        display: none;
    }
}
