/* ============================================
   MOBILE SWIPE GESTURES & INTERACTIONS
   ============================================ */

/* ========================================
   SWIPE VISUAL FEEDBACK
   ======================================== */

.ap-answer.swipe-upvote,
.ap-q-cells.swipe-upvote {
    animation: swipeUpvote 0.6s ease;
}

@keyframes swipeUpvote {
    0% {
        transform: translateX(0);
        background: white;
    }
    30% {
        transform: translateX(20px);
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
    }
    100% {
        transform: translateX(0);
        background: white;
    }
}

.ap-answer.swipe-downvote,
.ap-q-cells.swipe-downvote {
    animation: swipeDownvote 0.6s ease;
}

@keyframes swipeDownvote {
    0% {
        transform: translateX(0);
        background: white;
    }
    30% {
        transform: translateX(-20px);
        background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1));
    }
    100% {
        transform: translateX(0);
        background: white;
    }
}

/* ========================================
   SWIPE INDICATORS
   ======================================== */

.mobile-swipe-indicators {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 9999;
}

.swipe-indicator {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.swipe-indicator.left {
    left: 1rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    transform: translateX(-100px);
}

.swipe-indicator.right {
    right: 1rem;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    transform: translateX(100px);
}

.swipe-indicator.show {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   PULL TO REFRESH
   ======================================== */

.pull-to-refresh-indicator {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem 2rem;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 9999;
    transition: top 0.3s ease;
}

.pull-to-refresh-indicator.active {
    top: 0;
}

.pull-to-refresh-indicator .spinner {
    width: 24px;
    height: 24px;
    margin: 0 auto 0.5rem;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8B5CF6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.pull-to-refresh-indicator p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #8B5CF6;
}

/* ========================================
   DOUBLE TAP HEART ANIMATION
   ======================================== */

.double-tap-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 4rem;
    z-index: 1000;
    pointer-events: none;
    animation: heartPop 1s ease;
}

@keyframes heartPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

/* ========================================
   MOBILE ACTION PROMPT
   ======================================== */

.mobile-action-prompt {
    position: fixed;
    bottom: -200px;
    left: 1rem;
    right: 1rem;
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-action-prompt.show {
    bottom: 2rem;
}

.mobile-action-prompt p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    text-align: center;
}

.prompt-actions {
    display: flex;
    gap: 0.75rem;
}

.prompt-actions button {
    flex: 1;
    padding: 0.875rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-yes {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
}

.btn-yes:active {
    transform: scale(0.95);
}

.btn-no {
    background: #F3F4F6;
    color: #4B5563;
}

.btn-no:active {
    transform: scale(0.95);
}

/* ========================================
   FLOATING FEEDBACK
   ======================================== */

.mobile-floating-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    padding: 1rem 2rem;
    border-radius: 999px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-floating-feedback.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ========================================
   TOUCH-FRIENDLY BUTTONS
   ======================================== */

@media (max-width: 768px) {
    /* Increase tap targets */
    .ap-btn-vote,
    .vote-up,
    .vote-down,
    .ap-btn-vote-up,
    .ap-btn-vote-down {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem !important;
    }

    /* Add more spacing between interactive elements */
    .ap-vote {
        gap: 1rem;
    }

    /* Make answer cards more touch-friendly */
    .ap-answer,
    .ap-q-cells {
        padding: 1.25rem;
        touch-action: pan-y; /* Allow vertical scrolling */
    }
}

/* ========================================
   HAPTIC FEEDBACK INDICATORS
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
    .haptic-pulse {
        animation: hapticPulse 0.3s ease;
    }
}

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

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .ap-answer.swipe-upvote,
    .ap-answer.swipe-downvote,
    .swipe-indicator,
    .double-tap-heart,
    .mobile-action-prompt,
    .mobile-floating-feedback {
        animation: none;
        transition: none;
    }

    .pull-to-refresh-indicator .spinner {
        animation: none;
        border: 3px solid #8B5CF6;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .swipe-indicator {
        border: 3px solid white;
    }

    .mobile-action-prompt {
        border: 2px solid #8B5CF6;
    }
}

