/* Estilos para o componente de chat do Tutor AI */

.chat-container {
    height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.chat-header {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: rgba(33, 37, 41, 0.6);
}

.message-container {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    max-width: 90%;
}

.message-container:nth-child(odd) {
    align-self: flex-start;
}

.message-container:nth-child(even) {
    align-self: flex-end;
    align-items: flex-end;
}

.message {
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.message-user {
    background-color: var(--bs-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-tutor {
    background-color: var(--bs-secondary);
    color: white;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
}

.chat-input {
    padding: 16px;
    background-color: rgba(33, 37, 41, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Thinking message animation */
.thinking-message {
    opacity: 0.8;
}

.thinking-dots {
    display: inline-block;
    font-size: 1.5rem;
    line-height: 1;
    margin-right: 0.5rem;
}

.thinking-dots span {
    animation: thinking-blink 1.4s infinite;
    opacity: 0;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking-blink {
    0%, 60%, 100% {
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
}

.thinking-text {
    font-style: italic;
    opacity: 0.9;
}

#message-input {
    resize: none;
    border-radius: 20px;
    padding: 10px 16px;
}

.topic-badge {
    display: inline-block;
    background-color: var(--bs-info);
    color: white;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

/* Estilos para formatação de código e formatação de texto */
.message-tutor code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--bs-light);
}

.message-tutor pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
}

.message-tutor pre code {
    background-color: transparent;
    padding: 0;
}

.message-tutor ul, 
.message-tutor ol {
    padding-left: 25px;
    margin: 8px 0;
}

.message-tutor strong {
    color: var(--bs-warning);
}

.message-tutor em {
    color: var(--bs-info);
}