/* Mobile Pull-to-Refresh and Gesture Enhancements */

/* Pull to refresh indicator */
.pull-to-refresh {
    position: relative;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

.pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.pull-to-refresh-indicator.visible {
    transform: translateY(60px);
}

.pull-to-refresh-indicator.loading {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.pull-to-refresh-indicator .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced mobile gestures */
@media (max-width: 768px) {
    /* Improved scrolling for business cards */
    #admin-businesses-mobile {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scroll-behavior: smooth;
    }
    
    /* Enhanced touch targets */
    .admin-business-card {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    }
    
    .business-actions .btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent text selection on touch */
    .admin-business-card * {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection for specific elements */
    .business-detail-item .value {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Improve visual feedback for touch */
    .admin-business-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .business-actions .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Enhanced scrollbar styling for mobile */
    #admin-businesses-mobile::-webkit-scrollbar {
        width: 3px;
    }
    
    #admin-businesses-mobile::-webkit-scrollbar-track {
        background: transparent;
    }
    
    #admin-businesses-mobile::-webkit-scrollbar-thumb {
        background: rgba(102, 126, 234, 0.3);
        border-radius: 3px;
    }
    
    #admin-businesses-mobile::-webkit-scrollbar-thumb:hover {
        background: rgba(102, 126, 234, 0.5);
    }
}

/* Mobile navigation enhancements */
@media (max-width: 768px) {
    .admin-section-header {
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        z-index: 100;
        padding: 15px 0;
        border-bottom: 1px solid #e0e4e7;
    }
    
    .business-filters {
        position: sticky;
        top: 60px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        z-index: 99;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* Swipe actions for business cards */
@media (max-width: 768px) {
    .admin-business-card {
        position: relative;
        overflow: hidden;
    }
    
    .admin-business-card.swiped-left {
        transform: translateX(-80px);
        transition: transform 0.3s ease;
    }
    
    .admin-business-card.swiped-right {
        transform: translateX(80px);
        transition: transform 0.3s ease;
    }
    
    .swipe-action-left,
    .swipe-action-right {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .swipe-action-left {
        left: -80px;
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    }
    
    .swipe-action-right {
        right: -80px;
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    }
    
    .admin-business-card.swiped-left .swipe-action-left,
    .admin-business-card.swiped-right .swipe-action-right {
        opacity: 1;
    }
}

/* Loading skeleton for business cards */
.business-card-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-skeleton 1.5s infinite;
    border-radius: 12px;
    height: 200px;
    margin-bottom: 16px;
}

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

/* Enhanced empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    color: #667eea;
    display: block;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* Dark mode adjustments for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .admin-section-header {
        background: rgba(45, 55, 72, 0.95);
        border-bottom-color: #4a5568;
    }
    
    .business-filters {
        background: rgba(45, 55, 72, 0.95);
        border-bottom-color: #4a5568;
    }
    
    .pull-to-refresh-indicator {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }
    
    .business-card-skeleton {
        background: linear-gradient(90deg, #4a5568 25%, #2d3748 50%, #4a5568 75%);
        background-size: 200% 100%;
    }
}

/* Performance optimizations */
@media (max-width: 768px) {
    .admin-business-card {
        will-change: transform, opacity;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    .business-actions .btn {
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}
