/**
 * Windscribe CAPTCHA Component Styles
 * Slider puzzle CAPTCHA styling
 */

/* Container */
#captcha-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeInBackdrop 0.3s ease-out;
}

#captcha-container.show {
    display: flex;
}

/* Content wrapper */
.captcha-content {
    background: #0f1419;
    color: #ffffff;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95);
    border: 1px solid #1a2332;
    max-width: 420px;
    width: 90%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Header section */
.captcha-header {
    text-align: center;
    background: rgba(0, 168, 225, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 32px;
    margin: 0;
    border-radius: 24px 24px 0 0;
}

.captcha-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 500;
    color: #e8eaed;
}

.captcha-header p {
    margin: 0;
    font-size: 14px;
    color: #9aa0a6;
}

/* Canvas container */
.captcha-canvas-container {
    position: relative;
    margin: 24px 32px 24px 32px;
    border: 1px solid #1a2332;
    border-radius: 8px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#captcha-bg-canvas {
    display: block;
    width: 100%;
    height: auto;
}

#captcha-piece-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: grab;
}

#captcha-piece-canvas:active {
    cursor: grabbing;
}

/* Slider track */
.captcha-slider {
    margin: 0 32px 32px 32px;
}

.captcha-slider-track {
    position: relative;
    width: 100%;
    height: 54px;
    background: #1a2332;
    border: 1px solid #2d3748;
    border-radius: 30px;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.captcha-slider-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 168, 225, 0.05), transparent);
    pointer-events: none;
}

/* Slider button */
.captcha-slider-button {
    position: absolute;
    left: 0;
    top: 50%;
    width: 54px;
    height: 50px;
    background: linear-gradient(135deg, #00a8e1 0%, #0090c7 100%);
    border-radius: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.3s ease;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 168, 225, 0.3);
    will-change: transform;
}

/* Disable transitions during dragging for smooth 60fps performance */
.captcha-slider-button.dragging {
    transition: none !important;
}

.captcha-slider-button:hover {
    box-shadow: 0 3px 12px rgba(0, 168, 225, 0.4);
}

.captcha-slider-button:active {
    cursor: grabbing;
}

/* Responsive design */
@media (max-width: 480px) {
    .captcha-content {
        padding: 16px;
        width: 95%;
    }

    .captcha-content h3 {
        font-size: 18px;
    }

    .captcha-content p {
        font-size: 13px;
    }

    .captcha-slider-track {
        height: 48px;
    }

    .captcha-slider-button {
        width: 48px;
        height: 44px;
        font-size: 22px;
    }
}

/* Accessibility */
.captcha-slider-button:focus {
    outline: 2px solid #00a8e1;
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


#captcha-container.show .captcha-content {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading state */
.captcha-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Error message */
.captcha-error {
    background: linear-gradient(to right, #ffe6e6, #ffefef);
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 16px;
    color: #c92a2a;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
    animation: slideIn 0.3s ease-out;
}

/* Success message */
.captcha-success {
    background: linear-gradient(to right, #e6ffe6, #f0fff0);
    border: 1px solid #51cf66;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 16px;
    color: #2b8a3e;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(81, 207, 102, 0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}