/**
 * TurniX PWA - Pull to Refresh Styles
 */

/* Pull to Refresh Container */
.turnix-pull-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8f9fa 0%, transparent 100%);
    z-index: 1040;
    transform: translateY(-100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Content container */
.turnix-pull-refresh-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Spinner */
.turnix-pull-refresh-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: #BA1817;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

/* Ready state - spinner full rotation indicator */
.turnix-pull-refresh-ready .turnix-pull-refresh-spinner {
    border-color: #BA1817;
    border-top-color: transparent;
    animation: pull-refresh-ready 0.3s ease;
}

/* Loading state - spinner animato */
.turnix-pull-refresh-loading .turnix-pull-refresh-spinner {
    animation: pull-refresh-spin 0.8s linear infinite;
}

/* Text */
.turnix-pull-refresh-text {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    transition: color 0.2s ease;
}

.turnix-pull-refresh-ready .turnix-pull-refresh-text {
    color: #BA1817;
}

/* Animations */
@keyframes pull-refresh-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pull-refresh-ready {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Arrow icon variant (optional) */
.turnix-pull-refresh-arrow {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #6c757d;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.turnix-pull-refresh-ready .turnix-pull-refresh-arrow {
    stroke: #BA1817;
    transform: rotate(180deg);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .turnix-pull-refresh {
        background: linear-gradient(180deg, #1a1a1a 0%, transparent 100%);
    }

    .turnix-pull-refresh-spinner {
        border-color: #333;
        border-top-color: #BA1817;
    }

    .turnix-pull-refresh-text {
        color: #adb5bd;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .turnix-pull-refresh,
    .turnix-pull-refresh-spinner,
    .turnix-pull-refresh-text,
    .turnix-pull-refresh-arrow {
        transition: none;
    }

    .turnix-pull-refresh-loading .turnix-pull-refresh-spinner {
        animation: none;
    }
}

/* iOS style variant */
.turnix-pull-refresh.ios-style .turnix-pull-refresh-spinner {
    width: 28px;
    height: 28px;
    border-width: 2px;
}

/* Material style variant */
.turnix-pull-refresh.material-style .turnix-pull-refresh-content {
    padding: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
