/**
 * Pull-to-Refresh Styles
 * P2 Task #22: Touch Optimization - Mobile/Tablet Pull-to-Refresh
 */

/* Pull-to-refresh indicator */
.pull-to-refresh-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, opacity;
}

/* Indicator content */
.pull-to-refresh-indicator .ptr-text {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    margin: 0 10px;
}

.pull-to-refresh-indicator .ptr-arrow {
    display: block;
    font-size: 1.25rem;
    color: #0d6efd;
    transition: transform 0.2s ease;
}

.pull-to-refresh-indicator .ptr-spinner {
    display: none;
}

/* Refreshing state */
.pull-to-refresh-indicator.refreshing .ptr-text {
    color: #0d6efd;
}

/* Container states */
.ptr-pulling {
    /* Optional: Add subtle visual feedback during pull */
}

.ptr-refreshing {
    /* Container is refreshing */
}

/* Accessibility */
.ptr-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Mobile optimizations */
@media (max-width: 767.98px) {
    .pull-to-refresh-indicator {
        height: 50px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
    }

    .pull-to-refresh-indicator .ptr-text {
        font-size: 0.8rem;
    }

    .pull-to-refresh-indicator .ptr-arrow {
        font-size: 1rem;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .pull-to-refresh-indicator {
        height: 65px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pull-to-refresh-indicator {
        background: linear-gradient(to bottom, rgba(33, 37, 41, 0.95), rgba(33, 37, 41, 0.8));
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .pull-to-refresh-indicator .ptr-text {
        color: #adb5bd;
    }

    .pull-to-refresh-indicator.refreshing .ptr-text {
        color: #0d6efd;
    }
}

/* Animation keyframes */
@keyframes ptr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Prevent text selection during pull */
.ptr-pulling {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
