/* /home/www/panel.mediaboxy.pl/public_html/assets/css/slider-captcha.css */

.slider-captcha {
    max-width: 320px;
    width: 100%;
    margin: 15px auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.captcha-canvas-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 160px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 🔥 NOWE: Style dla IMG zamiast Canvas */
.captcha-bg-image {
    display: block;
    width: 100%;
    height: 160px;
    max-width: 320px;
    object-fit: cover;
    pointer-events: none;
}

.slider-piece-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 160px;
    object-fit: cover;
    transition: none;
    pointer-events: none;
    display: block;
}

.captcha-refresh {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 100;
}

.captcha-refresh:hover {
    background: #fff;
    transform: rotate(180deg);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.captcha-refresh i {
    font-size: 20px;
    color: #666;
}

.captcha-control {
    margin-top: 15px;
    width: 100%;
}

.slider-track {
    position: relative;
    height: 44px;
    width: 100%;
    background: linear-gradient(to right, #f7f9fa, #e9ecef);
    border: 2px solid #e4e7eb;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.slider-button {
    position: absolute;
    left: 0;
    top: 0;
    width: 52px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: grab;
    cursor: -webkit-grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    transition: background 0.3s;
    z-index: 2;
    border-radius: 22px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

.slider-button:active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.slider-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.5);
}

.slider-button.dragging {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.slider-button i {
    pointer-events: none;
}

.slider-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s;
    padding: 0 65px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.captcha-status {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    min-height: 22px;
    font-weight: 600;
    transition: all 0.3s;
}

.captcha-status.success {
    color: #52c41a;
    animation: successPulse 0.5s ease;
}

.captcha-status.error {
    color: #f5222d;
    animation: errorShake 0.5s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 🔥 Mobile optimization dla Chrome Android */
@media (max-width: 480px) {
    .slider-captcha {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .captcha-canvas-container {
        max-width: 100%;
        border-radius: 6px;
    }
    
    .captcha-bg-image {
        width: 100%;
        height: auto;
        min-height: 140px;
    }
    
    .slider-piece-image {
        height: auto;
        min-height: 140px;
    }
    
    .slider-text {
        font-size: 12px;
        padding: 0 58px;
    }
    
    .slider-track {
        height: 40px;
        border-radius: 20px;
    }
    
    .slider-button {
        width: 48px;
        font-size: 20px;
        border-radius: 20px;
    }
}

/* 🔥 Specjalne fixy dla Chrome Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .captcha-bg-image,
    .slider-piece-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Fix dla iOS Safari */
@supports (-webkit-touch-callout: none) {
    .slider-button {
        -webkit-tap-highlight-color: transparent;
    }
    
    .captcha-bg-image,
    .slider-piece-image {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Prevent text selection during drag */
.slider-captcha * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}