/* ============================================
   UX ENHANCEMENTS - Mobile App Optimizations
   ============================================ */

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-radius: 50%;
    border-top-color: #FFD700;
    border-right-color: #FFA500;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-content {
    text-align: center;
    color: #FFD700;
}

.loading-content .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin-bottom: 15px;
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 25%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    padding: 20px;
    margin-bottom: 15px;
}

/* Enhanced Toast Notifications */
.toast {
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(10, 8, 5, 0.98) 100%);
    border-radius: 14px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(255, 215, 0, 0.2);
    border-left: 4px solid;
    border-image: linear-gradient(180deg, #FFD700, #FFA500) 1;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    animation: toastProgress 3s linear forwards, shimmer 2s linear infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast.success {
    border-left-color: #FFD700;
}

.toast.success::before {
    background: #FFD700;
}

.toast.error {
    border-left-color: #FFD700;
}

.toast.error::before {
    background: #FFD700;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

/* Pull to Refresh */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
}

.pull-to-refresh.active {
    transform: translateY(0);
}

.pull-to-refresh-icon {
    font-size: 24px;
    color: #FFD700;
    animation: spin 1s linear infinite;
}

/* Enhanced Button States */
button:not(:disabled) {
    position: relative;
    overflow: hidden;
}

button:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:not(:disabled):active::before {
    width: 300px;
    height: 300px;
}

/* Form Validation Feedback */
.input-group {
    position: relative;
}

.input-error {
    border-color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.1) !important;
    animation: shake 0.4s ease;
}

.input-success {
    border-color: #FFD700 !important;
    background: rgba(255, 215, 0, 0.1) !important;
}

.input-error-icon,
.input-success-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-error-icon {
    color: #FFD700;
}

.input-success-icon {
    color: #FFD700;
}

.input-group.error .input-error-icon,
.input-group.success .input-success-icon {
    opacity: 1;
}

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

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-hover:active {
    transform: scale(0.98);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.2);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.6;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state-description {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 20px;
}

/* Smooth Page Transitions */
.page-transition {
    animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Search */
.search-input:focus {
    transform: scale(1.02);
}

.search-results-count {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
    animation: fadeIn 0.3s ease;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressShimmer 2s infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

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

/* Badge Animations */
.badge-pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

/* Swipe Gesture Indicator */
.swipe-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    opacity: 0.5;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Enhanced List Items */
.list-item {
    position: relative;
}

.list-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.3), 
        transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.list-item:hover::after {
    opacity: 1;
}

/* Touch Feedback */
.touch-feedback {
    position: relative;
}

.touch-feedback:active {
    background: rgba(255, 215, 0, 0.1);
}

/* Input Icons Enhancement */
.input-icon {
    transition: transform 0.2s ease;
}

.input-group:focus-within .input-icon {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Button Ripple Effect */
button {
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::after {
    width: 300px;
    height: 300px;
}

/* Card Tap Feedback */
.card-hover,
.evento-preview-item,
.list-item {
    -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus Visible Enhancement */
*:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Already dark, but can add specific adjustments */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    button {
        border: 2px solid #FFD700;
    }
}

