/**
 * ATACAJUNTO APP - 下拉刷新样式
 * Pull-to-Refresh Styles
 */

/* 下拉刷新指示器 */
.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* 默认隐藏到屏幕外 */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out, height 0.2s ease-out;
    /* 安全区域支持 */
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

/* 下拉时显示 */
.pull-refresh-indicator.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: none;
}

.pull-refresh-indicator.refreshing {
    transition: height 0.3s ease-out;
}

/* 内容容器 */
.pull-refresh-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    padding: 10px;
}

/* 箭头图标 */
.pull-refresh-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.pull-refresh-icon i {
    font-size: 20px;
    color: white;
}

.pull-refresh-indicator.ready .pull-refresh-icon {
    transform: rotate(180deg) !important;
}

/* 加载动画 */
.pull-refresh-spinner {
    display: none;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

.pull-refresh-spinner i {
    font-size: 24px;
    color: white;
}

.pull-refresh-indicator.refreshing .pull-refresh-spinner {
    display: flex;
}

.pull-refresh-indicator.refreshing .pull-refresh-icon {
    display: none;
}

/* 文字 */
.pull-refresh-text {
    font-size: 13px;
    font-weight: 500;
    color: white;
    text-align: center;
    white-space: nowrap;
}

/* 防止页面在下拉时产生滚动 */
body.pull-refreshing {
    overflow: hidden;
    touch-action: none;
}

/* 禁用 iOS 的橡皮筋效果（可选） */
html, body {
    overscroll-behavior-y: none;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .pull-refresh-indicator {
        background: linear-gradient(135deg, var(--primary-dark) 0%, #d35400 100%);
    }
}

/* 平板和桌面端隐藏下拉刷新 */
@media (min-width: 769px) {
    .pull-refresh-indicator {
        display: none !important;
    }
}
