/* SISTEMA DE CHAT MODERNO PARA TUTOR BIBLICO */
/* Version sin emojis para evitar problemas de codificacion */

:root {
    --tutor-primary: #3b82f6;
    --tutor-secondary: #1e40af;
    --tutor-accent: #f59e0b;
    --tutor-success: #10b981;
    --tutor-warning: #f59e0b;
    --tutor-error: #ef4444;
    --tutor-bg-light: #f8fafc;
    --tutor-bg-dark: #1e293b;
    --tutor-text-light: #64748b;
    --tutor-text-dark: #0f172a;
    --tutor-border: rgba(59, 130, 246, 0.2);
    --tutor-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    --tutor-gradient: linear-gradient(135deg, var(--tutor-primary), var(--tutor-secondary));
}

/* MODAL MODERNIZADO */
.tutor-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutor-chat-modal.active {
    opacity: 1;
    visibility: visible;
}

.tutor-chat-container {
    width: 90%;
    max-width: 800px;
    height: 85vh;
    background: white;
    border-radius: 20px;
    box-shadow: var(--tutor-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutor-chat-modal.active .tutor-chat-container {
    transform: scale(1) translateY(0);
}

/* HEADER MODERNIZADO */
.tutor-chat-header {
    background: var(--tutor-gradient);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.tutor-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: headerShimmer 3s infinite;
}

@keyframes headerShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.tutor-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tutor-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    animation: avatarPulse 2s infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tutor-details h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
}

.tutor-details p {
    margin: 5px 0;
    opacity: 0.9;
    font-size: 0.9em;
}

.tutor-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--tutor-success);
    border-radius: 50%;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-action-btn, .close-tutor {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.header-action-btn:hover, .close-tutor:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* AREA DE MENSAJES MODERNIZADA */
.tutor-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--tutor-bg-light);
    position: relative;
}

.tutor-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.tutor-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tutor-chat-messages::-webkit-scrollbar-thumb {
    background: var(--tutor-border);
    border-radius: 3px;
}

/* MENSAJES ESTILIZADOS */
.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    animation: messageAppear 0.5s ease forwards;
}

@keyframes messageAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--tutor-gradient);
    color: white;
}

.tutor-message .message-avatar {
    background: var(--tutor-accent);
    color: white;
}

.message-bubble {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: var(--tutor-gradient);
    color: white;
    border-bottom-right-radius: 5px;
}

.tutor-message .message-bubble {
    background: white;
    color: var(--tutor-text-dark);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message-content {
    line-height: 1.6;
}

.message-time {
    font-size: 0.75em;
    color: var(--tutor-text-light);
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* INDICADOR DE IA */
.ai-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 15px;
    font-size: 0.8em;
    color: var(--tutor-primary);
    border: 1px solid var(--tutor-border);
}

.ai-indicator i {
    animation: robotBlink 2s infinite;
}

@keyframes robotBlink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0.5; }
}

/* AREA DE INPUT MODERNIZADA */
.tutor-chat-input {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--tutor-border);
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--tutor-text-light);
    font-size: 0.9em;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--tutor-primary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: scale(1); opacity: 0.5; }
    30% { transform: scale(1.2); opacity: 1; }
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
}

.tutor-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--tutor-border);
    border-radius: 25px;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
    background: var(--tutor-bg-light);
}

.tutor-input:focus {
    border-color: var(--tutor-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.send-message {
    width: 50px;
    height: 50px;
    background: var(--tutor-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.send-message:hover {
    transform: scale(1.1);
    box-shadow: var(--tutor-shadow);
}

.send-message:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* BOTONES RAPIDOS */
.quick-questions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 15px;
    background: var(--tutor-bg-light);
    border: 1px solid var(--tutor-border);
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--tutor-text-dark);
}

.quick-btn:hover {
    background: var(--tutor-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .tutor-chat-container {
        width: 95%;
        height: 90vh;
        border-radius: 15px;
    }
    
    .tutor-chat-header {
        padding: 15px;
    }
    
    .tutor-info {
        gap: 10px;
    }
    
    .tutor-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 12px 16px;
    }
    
    .quick-questions {
        gap: 8px;
    }
    
    .quick-btn {
        font-size: 0.8em;
        padding: 6px 12px;
    }
}
