/* Captcha Ludique - Styles */
.captcha-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.captcha-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4, #10b981);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.captcha-container.captcha-success {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    transform: scale(1.02);
}

.captcha-container.captcha-success::before {
    background: #10b981;
    animation: none;
}

.captcha-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.captcha-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.captcha-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.captcha-challenge {
    margin: 15px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.challenge-content {
    text-align: center;
    width: 100%;
}

.challenge-question {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 15px;
}

.challenge-hint {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin-top: 10px;
}

/* Math Visual */
.math-visual {
    margin: 15px 0;
}

.math-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 24px;
    font-weight: bold;
}

.math-equation .number {
    background: #8b5cf6;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.math-equation .operator {
    font-size: 30px;
    color: #374151;
}

.math-equation .equals {
    font-size: 30px;
    color: #374151;
}

.math-equation .question {
    background: #fbbf24;
    padding: 10px 15px;
    border-radius: 8px;
    animation: wiggle 1s infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Word Visual */
.word-visual {
    margin: 15px 0;
}

.scrambled-letters {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.scrambled-letters .letter {
    background: #ef4444;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 18px;
    animation: shake 0.5s infinite alternate;
}

@keyframes shake {
    0% { transform: translateX(-2px); }
    100% { transform: translateX(2px); }
}

.arrow {
    text-align: center;
    font-size: 20px;
    margin: 10px 0;
    animation: bounce-down 1.5s infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.word-boxes {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.letter-box {
    width: 40px;
    height: 40px;
    border: 2px dashed #94a3b8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #64748b;
}

/* Pattern Visual */
.pattern-visual {
    margin: 15px 0;
}

.sequence {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.sequence-item {
    background: #06b6d4;
    color: white;
    padding: 12px 16px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    min-width: 50px;
    text-align: center;
    animation: pop 0.6s ease-in-out;
    animation-fill-mode: both;
}

.sequence-item:nth-child(1) { animation-delay: 0.1s; }
.sequence-item:nth-child(2) { animation-delay: 0.2s; }
.sequence-item:nth-child(3) { animation-delay: 0.3s; }
.sequence-item:nth-child(4) { animation-delay: 0.4s; }

.sequence-item.question {
    background: #fbbf24;
    animation: glow 1.5s infinite alternate;
}

@keyframes pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #fbbf24; }
    100% { box-shadow: 0 0 20px #fbbf24, 0 0 30px #fbbf24; }
}

/* Logic Visual */
.logic-visual {
    margin: 15px 0;
    text-align: center;
}

.brain-icon {
    font-size: 48px;
    animation: think 2s infinite;
}

@keyframes think {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.thinking-dots {
    font-size: 24px;
    margin-top: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Input Area */
.captcha-input-area {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

#captcha-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

#captcha-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#captcha-input:disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.captcha-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.captcha-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

.captcha-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Feedback */
.captcha-feedback {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin: 10px 0;
    display: none;
}

.captcha-feedback.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.captcha-feedback.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Refresh */
.captcha-refresh {
    text-align: center;
    margin-top: 15px;
}

.captcha-refresh-btn {
    background: none;
    border: 1px solid #d1d5db;
    padding: 8px 15px;
    border-radius: 6px;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.captcha-refresh-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* Responsive */
@media (max-width: 640px) {
    .captcha-container {
        padding: 15px;
    }

    .captcha-input-area {
        flex-direction: column;
    }

    .math-equation {
        font-size: 20px;
        gap: 10px;
    }

    .math-equation .number {
        padding: 8px 12px;
        min-width: 40px;
    }

    .sequence-item {
        padding: 10px 14px;
        font-size: 16px;
        min-width: 45px;
    }

    .scrambled-letters .letter {
        padding: 6px 10px;
        font-size: 16px;
    }
}