/* Mobile Controls - Pull-to-Refresh Indicator */

#pullToRefreshIndicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0, 188, 212, 0.9) 0%, rgba(0, 188, 212, 0.7) 100%);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-60px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

#pullToRefreshIndicator.ready {
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.9) 0%, rgba(76, 175, 80, 0.7) 100%);
}

#pullToRefreshIndicator.refreshing {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.pull-indicator-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.pull-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#pullToRefreshIndicator.refreshing .pull-spinner {
    animation: spin 0.6s linear infinite;
}

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

.pull-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Mobile navigation buttons styling */
#backBtn, #refreshBtn {
    position: relative;
}

#backBtn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

#backBtn:active::after,
#refreshBtn:active::after {
    opacity: 1;
}

/* Mobile-only styles */
@media (max-width: 768px) {
    /* Add extra padding to top of body to account for pull indicator */
    body.pulling {
        padding-top: 60px;
    }

    /* Make back/refresh buttons more prominent on mobile */
    #backBtn, #refreshBtn {
        background: rgba(0, 188, 212, 0.1);
        border-color: rgba(0, 188, 212, 0.3);
    }

    #backBtn:active, #refreshBtn:active {
        background: rgba(0, 188, 212, 0.3);
        transform: scale(0.95);
    }

    /* Visual feedback for swipe gesture */
    .swipe-hint {
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 80px;
        background: linear-gradient(90deg, rgba(0, 188, 212, 0.3) 0%, transparent 100%);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 9999;
    }

    body.swiping .swipe-hint {
        opacity: 1;
    }
}

/* Desktop - hide mobile controls */
@media (min-width: 769px) {
    #pullToRefreshIndicator {
        display: none !important;
    }
}
