/* === TUTOR IA LIMPIO === */
:root {
    --brand-color: #0056D2;
    --bg-chat: #f4f6f8;
    --border-color: #e0e0e0;
}

/* Contenedor Principal */
.ia-tutor-wrapper {
    background-color: #fff;
    /* Quitamos bordes externos si está dentro de un modal para evitar "doble borde" */
    display: flex;
    flex-direction: column;
    height: 500px; /* Altura fija */
    max-width: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

/* === 1. HEADER SIMPLIFICADO === */
.tutor-header {
    background: #ffffff; /* Fondo blanco para no chocar con el azul del modal */
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-avatar {
    position: relative;
    width: 35px;
    height: 35px;
    background: #e3f2fd; /* Azul muy clarito */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    font-size: 1.1rem;
}

.status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background-color: #2ecc71;
    border: 2px solid #fff;
    border-radius: 50%;
}

.header-info h6 {
    color: #333;
    font-size: 0.95rem;
}
.header-info small {
    color: #2ecc71; /* Texto verde "disponible" */
    font-weight: 600;
    font-size: 0.75rem;
}

/* === 2. CUERPO CHAT === */
#tutor-chat-body {
    flex: 1;
    padding: 20px;
    background-color: var(--bg-chat);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    
    /* Scrollbar fino */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Scrollbar para Chrome/Edge */
#tutor-chat-body::-webkit-scrollbar {
    width: 6px;
}
#tutor-chat-body::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 10px;
}

/* Mensajes */
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.2s ease-out;
}

/* Avatar pequeño en los mensajes del BOT */
.chat-message.bot .avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ddd;
    color: var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-top: 2px;
}

.message-content {
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Burbuja Bot (Blanca) */
.chat-message.bot .message-content {
    background-color: #fff;
    color: #333;
    border-radius: 0 12px 12px 12px;
    border: 1px solid var(--border-color);
}

/* Burbuja Usuario (Azul) */
.chat-message.user {
    align-self: flex-end;
    /* Quitamos el avatar del usuario para limpiar ruido visual, solo burbuja */
}

.chat-message.user .message-content {
    background-color: var(--brand-color);
    color: #fff;
    border-radius: 12px 0 12px 12px;
    border: none;
}

/* === 3. SUGERENCIAS === */
.tutor-suggestions {
    padding: 10px 20px;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Ocultar scroll horizontal */
}

.suggestion-btn {
    white-space: nowrap;
    background: #f0f7ff;
    border: 1px solid transparent;
    color: var(--brand-color);
    border-radius: 50rem;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: var(--brand-color);
    color: #fff;
}

/* === 4. INPUT === */
.tutor-chat-footer {
    padding: 15px 20px;
    background-color: #fff;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 4px 6px 4px 16px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    background: #fff;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 210, 0.1);
}

#tutor-user-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: #333;
}

#tutor-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: var(--brand-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

#tutor-send-btn:hover {
    transform: scale(1.1);
}

/* Animación Typing */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px !important;
    min-height: 40px;
}
.dot {
    width: 5px;
    height: 5px;
    background-color: #bbb;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }