/* My Real Captcha Frontend Styles */

/* General CAPTCHA Container */
.captcha-container {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    max-width: 350px;
    margin: 1.5rem auto !important;
    padding: 1.5rem !important;
    text-align: center;
}

.captcha-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.captcha-wrapper img {
    border-radius: 6px;
    max-width: 200px !important;
    height: auto !important;
    border: 1px solid #e2e8f0;
}

.refresh-captcha {
    background: #f8f9fa !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 8px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: unset !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.refresh-captcha:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
}

.refresh-captcha .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    color: #64748b !important;
}

.captcha-input {
    text-align: center;
}

.captcha-input input {
    width: 100% !important;
    max-width: 200px !important;
    padding: 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: #fff !important;
    margin: 0 auto !important;
    display: block !important;
}

.captcha-input input:focus {
    outline: none !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
    transform: translateY(-1px);
}

.captcha-input input::placeholder {
    color: #9ca3af !important;
    font-weight: normal !important;
}

/* Comment Form Specific Styles */
.comment-form-captcha {
    margin: 1.5rem 0 !important;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.comment-form-captcha label {
    display: block !important;
    margin-bottom: 0.75rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    font-size: 1rem !important;
}

.comment-form-captcha .required {
    color: #ef4444 !important;
}

/* Login and Registration Forms */
.login .captcha-container,
#registerform .captcha-container {
    margin: 1rem 0 !important;
    max-width: 300px !important;
}

/* WooCommerce Checkout */
.woocommerce-checkout .captcha-container {
    margin: 2rem 0 !important;
}

/* Contact Form 7 Integration */
.wpcf7 .captcha-container {
    margin: 1rem 0 !important;
}

.wpcf7-form-control-wrap .captcha-container {
    margin-top: 0.5rem !important;
}

/* External Provider Styles */
.g-recaptcha,
.h-captcha,
.cf-turnstile {
    margin: 1.5rem auto !important;
    max-width: 350px;
    display: flex !important;
    justify-content: center !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .captcha-container {
        max-width: 100% !important;
        margin: 1rem 0 !important;
        padding: 1rem !important;
    }
    
    .captcha-wrapper {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .captcha-wrapper img {
        max-width: 180px !important;
    }
    
    .captcha-input input {
        max-width: 180px !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .captcha-container {
        padding: 0.75rem !important;
    }
    
    .captcha-wrapper {
        padding: 0.75rem;
    }
    
    .captcha-wrapper img {
        max-width: 160px !important;
    }
    
    .captcha-input input {
        max-width: 160px !important;
        padding: 10px 12px !important;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .captcha-container {
        background: linear-gradient(135deg, #1f2937, #111827);
        border-color: #374151 !important;
        color: #f9fafb;
    }
    
    .captcha-wrapper {
        background: #374151;
    }
    
    .captcha-input input {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }
    
    .captcha-input input:focus {
        border-color: #6366f1 !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    }
    
    .comment-form-captcha {
        background: #1f2937;
        border-color: #374151;
    }
    
    .comment-form-captcha label {
        color: #f9fafb !important;
    }
}

/* Animation for CAPTCHA refresh */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s infinite linear !important;
}

/* Accessibility improvements */
.captcha-container:focus-within {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .captcha-container {
        border: 3px solid #000 !important;
        background: #fff !important;
    }
    
    .captcha-input input {
        border: 2px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
}