/**
 * Email Protector CSS Styles
 * Estilos para el plugin de protección de emails
 */

/* Contenedor principal */
.email-protector-container {
    margin: 15px auto;
    padding: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 400px;
}

/* Cuando se muestra el email, hacer el contenedor más sutil */
.email-protector-container.email-shown {
    background: transparent !important;
    border: none !important;
    padding: 5px !important;
}

/* Botón principal */
.email-protector-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    text-align: center;
    display: block;       
    margin: 0 auto; 
}

.email-protector-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.email-protector-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.email-protector-button.button-hover:not(:disabled) {
    background: linear-gradient(135deg, #7b8ce8 0%, #8657a8 100%);
}

/* Animación de carga en el botón */
.email-protector-button:disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Área de resultados */
.email-protector-result {
    margin-top: 15px;
    padding: 15px;
    background: transparent !important;
    border: none !important;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
    max-width: 350px;     
    margin-left: auto;     
    margin-right: auto;    
    text-align: center; 
}

/* Cuando se revela el email, hacer el fondo transparente */
.email-protector-result.email-revealed {
    background: none !important;
    border: none !important;
    padding: 5px !important;
    max-width: 350px;      /* same width as above */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

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

/* Estilos del captcha */
.email-protector-captcha {
    text-align: center;
}

.email-protector-captcha p {
    margin: 0 0 15px 0;
    color: #333;
}

.email-protector-captcha strong {
    color: #2c3e50;
}

/* Pregunta matemática */
.math-question {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    background: #fff5f5;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #fedcdc;
    margin: 15px 0;
}

/* Campo de respuesta */
.captcha-answer {
    width: 100%;
    max-width: 200px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
    margin: 10px auto;
}

.captcha-answer:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Contador de tiempo */
.time-countdown {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
}

.countdown-number {
    display: inline-block;
    background: #ff7675;
    color: white;
    font-size: 32px;
    font-weight: bold;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.countdown-text {
    display: block;
    color: #856404;
    font-weight: 500;
}

.countdown-ready {
    display: inline-block;
    background: #00b894;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

.email-protector-buttons { /* AÑADIDO: Nueva regla para el contenedor de botones */
    text-align: center;
    margin-top: 15px; /* Opcional: añade un poco de espacio superior */
}

/* Botones de acción */
.email-protector-verify,
.email-protector-cancel,
.email-protector-retry {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.email-protector-verify {
    background: #00b894;
    color: white;
}

.email-protector-verify:hover:not(:disabled) {
    background: #00a085;
    transform: translateY(-1px);
}

.email-protector-verify:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.email-protector-cancel {
    background: #6c757d;
    color: white;
}

.email-protector-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.email-protector-retry {
    background: #fd79a8;
    color: white;
}

.email-protector-retry:hover {
    background: #e84393;
    transform: translateY(-1px);
}

/* Email revelado */
.email-revealed {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.email-revealed .email-protector-link {
    display: inline-block !important;
    color: #667eea !important;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    background: transparent !important;
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid #667eea;
    margin: 0;
    z-index: 999;
    position: relative;
    transition: all 0.3s ease;
}

.email-protector-link:hover {
    background: #667eea !important;
    color: white !important;
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.email-protector-link::before {
    content: '📧 ';
    margin-right: 8px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.email-protector-link:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.email-protector-link::before {
    content: '📧 ';
    margin-right: 8px;
}

/* Mensajes de error */
.email-protector-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.email-protector-error p {
    color: #c62828;
    margin: 0 0 10px 0;
    font-weight: 500;
}

/* Responsivo */
@media (max-width: 480px) {
    .email-protector-container {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .email-protector-button {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
    
    .captcha-answer {
        width: 100%;
        max-width: none;
        font-size: 18px;
        padding: 15px;
    }
    
    .math-question {
        font-size: 20px;
        padding: 15px;
    }
    
    .email-protector-verify,
    .email-protector-cancel,
    .email-protector-retry {
        width: 100%;
        margin: 5px 0;
        padding: 12px;
        font-size: 16px;
    }
}

/* Tema oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .email-protector-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .email-protector-result {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .captcha-answer {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .captcha-answer:focus {
        border-color: #667eea;
    }
    
    .math-question {
        background: #2d1b2d;
        border-color: #553c5c;
        color: #ff7675;
    }
    
    .time-countdown {
        background: #2d2a1f;
        border-color: #4a4625;
        color: #e2e8f0;
    }
    
    .countdown-text {
        color: #cbd5e0;
    }
    
    .email-protector-error {
        background: #2d1b1f;
        border-color: #553c42;
    }
    
    .email-protector-error p { /* Añade o modifica esta regla */
        color: #cbd5e0; /* Un rojo claro para un buen contraste en modo oscuro */
    }
    
    .email-protector-captcha p {
        color: #cbd5e0; /* Texto de la pregunta general del captcha */
    }
    
    .email-protector-captcha strong {
        color: #e2e8f0; /* Texto fuerte dentro del captcha */
    }
}

/* Animaciones adicionales */
.email-protector-container:hover {
    border-color: #cbd5e0;
    transition: border-color 0.3s ease;
}

/* Accesibilidad */
.email-protector-button:focus,
.captcha-answer:focus,
.email-protector-verify:focus,
.email-protector-cancel:focus,
.email-protector-retry:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Indicador de carga personalizado */
.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}