/**
 *  CAPTCHA Styles
 */

.captcha-wrapper {
    max-width: 300px;
    margin: 20px auto;
    background: #1A1A1A;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.captcha-header {
    text-align: center;
    margin-bottom: 10px;
    padding: 15px 10px 10px 10px;
}

.captcha-header h3 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 18px;
}

.captcha-question {
    color: #ccc;
    font-size: 13px;
    font-weight: 400;
    margin: 0;
}

.captcha-canvas {
    position: relative;
    width: 260px;
    height: 130px;
    background:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%, transparent 75%, #2a2a2a 75%, #2a2a2a),
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%, transparent 75%, #2a2a2a 75%, #2a2a2a),
        linear-gradient(to bottom, #1a1a1a, #3a3a3a);
    background-size: 20px 20px, 20px 20px, 100% 100%;
    background-position: 0 0, 10px 10px, 0 0;
    margin: 0 auto 20px;
    overflow: hidden;
}

.captcha-canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.captcha-item {
    position: absolute;
    width: 32px;
    height: 32px;
    cursor: grab;
    transition: transform 0.1s ease-out;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.captcha-item:hover {
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.8)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.captcha-item.dragging {
    cursor: grabbing;
    z-index: 1000;
    filter: drop-shadow(0 0 12px rgba(255, 165, 0, 1)) drop-shadow(4px 4px 8px rgba(0, 0, 0, 0.8));
}

.captcha-item img {
    width: 100%;
    height: 100%;
    pointer-events: none;
    image-rendering: pixelated;
}

/* Phase 2.5: Honeypot Items (invisible trap for bots) */
.captcha-trap {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: all;
    position: absolute;
}

.captcha-dropzone {
    min-height: 80px;
    background: #404040;
    border: 3px dashed #fff;
    border-radius: 6px;
    padding: 12px;
    margin: 0 10px 15px 10px;
    transition: all 0.3s ease;
}

.captcha-dropzone.hover {
    background: #505050;
    border-color: #fff;
}

.dropzone-label {
    text-align: center;
    color: #ccc;
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 8px;
}

.dropzone-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 50px;
}

.captcha-item.in-dropzone {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #555;
    border-radius: 4px;
    padding: 2px;
}

.captcha-item.in-dropzone:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #777;
}

.captcha-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 0 10px 12px 10px;
}

.captcha-btn {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.captcha-btn-primary {
    background: #FF6900;
    color: #fff;
}

.captcha-btn-primary:hover:not(:disabled) {
    background: #ff7a1a;
}

.captcha-btn-primary:disabled {
    background: #cc5400;
    cursor: not-allowed;
    opacity: 0.5;
}

.captcha-btn-secondary {
    background: #6a6a6a;
    color: #fff;
}

.captcha-btn-secondary:hover {
    background: #7a7a7a;
}

.captcha-message {
    text-align: center;
    padding: 8px;
    margin: 0 10px 10px 10px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 12px;
    min-height: 16px;
}

.captcha-message-success {
    background: rgba(46, 204, 113, 0.2);
    border: 2px solid #27ae60;
    color: #2ecc71;
}

.captcha-message-error {
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid #c0392b;
    color: #e74c3c;
}

.captcha-message-info {
    background: rgba(52, 152, 219, 0.2);
    border: 2px solid #2980b9;
    color: #3498db;
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .captcha-wrapper {
        max-width: 100%;
        padding: 15px;
    }

    .captcha-canvas {
        width: 100%;
        max-width: 260px;
        height: 130px;
    }

    .captcha-item {
        width: 28px;
        height: 28px;
    }

    .captcha-item.in-dropzone {
        width: 28px;
        height: 28px;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .captcha-item {
        width: 36px;
        height: 36px;
    }

    .captcha-item.in-dropzone {
        width: 36px;
        height: 36px;
    }
}
