/* RESET Y AISLAMIENTO */
.aet-wrapper { all: initial; font-family: 'Segoe UI', system-ui, sans-serif; box-sizing: border-box; display: block; max-width: 520px; margin: 2rem auto; background: #ffffff; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow: hidden; border: 1px solid #e2e8f0; position: relative; height: 680px; z-index: 1; }
.aet-wrapper * { box-sizing: border-box; }

/* HEADER */
.aet-header { background: linear-gradient(135deg, #4f46e5, #818cf8); color: #fff; padding: 15px; display: flex; align-items: center; gap: 12px; }
.aet-header h3 { margin: 0; font-weight: 800; font-size: 1.2rem; color: #fff; }
.aet-badge { background: rgba(255,255,255,0.25); padding: 4px 10px; border-radius: 20px; font-weight: bold; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.3); }
#aet-xp-badge { margin-left: auto; }
#aet-streak-box { background: #ef4444; padding: 4px 8px; border-radius: 15px; font-size: 0.75rem; display: none; }

/* PROGRESO */
#aet-progress-area { padding: 10px 15px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
#aet-progress-text { font-size: 0.75rem; color: #64748b; text-align: center; margin-bottom: 4px; }
#aet-progress-bar { height: 6px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
#aet-progress-fill { height: 100%; background: linear-gradient(90deg, #10b981, #059669); width: 0%; transition: width 0.8s ease; }

/* CHAT */
#aet-chat-box { flex: 1; overflow-y: auto; padding: 15px; background: #f8fafc; display: flex; flex-direction: column; gap: 12px; height: 360px; }
.aet-msg { max-width: 85%; padding: 12px 14px; border-radius: 12px; line-height: 1.4; font-size: 0.95rem; position: relative; animation: fadeIn 0.3s ease; }
.aet-msg.user { align-self: flex-end; background: #4f46e5; color: #fff; border-bottom-right-radius: 2px; }
.aet-msg.ai { align-self: flex-start; background: #e2e8f0; color: #334155; border-bottom-left-radius: 2px; }
.aet-msg p { margin: 0; }
.pron-feedback { background: #fffbeb; border: 1px solid #fcd34d; padding: 10px; border-radius: 8px; margin-top: 5px; font-size: 0.9em; color: #78350f; }

/* Modo Práctica activo - indicador visual */
.aet-wrapper.practice-active .aet-header { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
#aet-msg-input.practice-mode { border-color: #8b5cf6; background: #faf5ff; }

/* CONTROLES */
.aet-controls { padding: 12px; background: #fff; border-top: 1px solid #e2e8f0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#aet-msg-input { flex: 1; min-width: 120px; padding: 12px; border: 2px solid #e2e8f0; border-radius: 12px; outline: none; font-size: 1rem; background: #fff; color: #334155; }
#aet-msg-input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }

/* BOTONES */
.aet-btn { color: #fff; border: none; border-radius: 12px; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; width: 48px; height: 48px; padding: 0; }
#aet-send-btn { background: #10b981; width: auto; padding: 0 18px; font-weight: bold; font-size: 0.95rem; }
#aet-mic-btn { background: #64748b; }
#aet-mic-btn.listening { background: #ef4444 !important; animation: pulseRed 1.5s infinite; }

/* BOTONES CON TEXTO (RECTANGULARES) */
.aet-btn-rect { color: #fff; border: none; border-radius: 12px; cursor: pointer; font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; height: 48px; white-space: nowrap; transition: all 0.2s; }
#aet-pron-btn { background: #8b5cf6; }
#aet-pron-btn.active { background: #ef4444 !important; animation: pulseRed 1.5s infinite; }
#aet-challenge-btn { background: #f59e0b; box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3); }
.aet-btn:hover, .aet-btn-rect:hover { transform: scale(1.05); }
.aet-btn:disabled, .aet-btn-rect:disabled { background: #cbd5e1 !important; cursor: not-allowed; transform: none; box-shadow: none; }

/* OVERLAY RETO */
#aet-challenge-overlay { position: absolute; inset: 0; background: #ffffff; z-index: 100; display: none; flex-direction: column; padding: 25px; text-align: center; }
#aet-timer-bar { height: 8px; background: #e2e8f0; border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
#aet-timer-fill { height: 100%; background: #10b981; width: 100%; transition: width 1s linear; }
#aet-challenge-title { font-size: 1.5rem; font-weight: bold; color: #1e293b; margin-bottom: 25px; line-height: 1.3; }
#aet-challenge-title span { color: #4f46e5; display: block; font-size: 2rem; margin-top: 10px; }
#aet-listening-status { color: #64748b; margin: 20px 0; font-style: italic; display: none; }
#aet-challenge-feedback { background: #f0fdf4; border: 2px solid #10b981; padding: 15px; border-radius: 12px; margin: 15px 0; display: none; animation: pop 0.3s; }
#aet-challenge-feedback.error { background: #fef2f2; border-color: #ef4444; }
.chal-actions { margin-top: auto; display: flex; gap: 10px; }
.chal-action-btn { flex: 1; padding: 14px; border: none; border-radius: 12px; font-weight: bold; cursor: pointer; font-size: 1rem; }
#next-btn { background: #10b981; color: #fff; display: none; }
#exit-btn { background: #e2e8f0; color: #475569; }

/* FOOTER */
.aet-footer { text-align: center; padding: 8px; font-size: 0.7rem; color: #94a3b8; background: #f8fafc; border-top: 1px solid #e2e8f0; }

@keyframes slideDown { from{transform:translateY(-10px); opacity:0;} to{transform:translateY(0); opacity:1;} }
@keyframes fadeIn { from{opacity:0; transform:translateY(5px);} to{opacity:1; transform:translateY(0);} }
@keyframes pulseRed { 0%{box-shadow:0 0 0 0 rgba(239,68,68,0.7);} 70%{box-shadow:0 0 0 10px rgba(239,68,68,0);} 100%{box-shadow:0 0 0 0 rgba(239,68,68,0);} }
@keyframes pop { 0%{transform:scale(0.9);} 100%{transform:scale(1);} }
