/* Career Chat - Telegram Dark Theme Style */
.career-chat {
    background: #0e1621;
    border-radius: 12px;
    max-width: 80%;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0e1621;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: fadeIn 0.2s ease;
    max-width: 85%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
    justify-content: flex-start;
    align-self: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-right: 30px !important;
}

/* Аватарки */
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #5b9bd5, #3a7bc8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.chat-message.user .chat-avatar {
    display: none;
}

/* Обёртка сообщения */
.message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

/* Подписи отправителя */
.message-sender {
    font-size: 13px;
    font-weight: 600;
    color: #5b9bd5;
    padding-left: 12px;
    margin-bottom: 2px;
}

.chat-message.user .message-sender {
    text-align: right;
    color: #7cb3e0;
    padding-right: 12px;
    padding-left: 0;
}

/* Пузыри сообщений - Telegram style */
.message-content {
    padding: 12px 20px !important;
    border-radius: 18px;
    font-size: 15px !important;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Пузырь учителя (слева) - Telegram style */
.career-chat .chat-message.bot .message-content {
    background: #212d3b !important;
    color: #ffffff;
    border-radius: 18px 18px 18px 4px;
}

/* Хвостик для пузыря учителя */
.chat-message.bot .message-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #212d3b;
    border-left: 0;
    border-bottom: 0;
}

/* Пузырь ученика (справа) */
.career-chat .chat-message.user .message-content {
    background: linear-gradient(135deg, #3d6a99 0%, #2b5278 100%) !important;
    color: #ffffff;
    border-radius: 18px 18px 4px 18px;
    border-right: 3px solid #7cb3e0;
}

/* Хвостик для пузыря ученика */
.chat-message.user .message-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #2b5278;
    border-right: 0;
    border-bottom: 0;
}

/* Индикатор печатания */
.typing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: fadeIn 0.2s ease;
    align-self: flex-start;
}

.typing-indicator .chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, #5b9bd5, #3a7bc8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.typing-dots {
    background: #212d3b;
    padding: 14px 20px;
    border-radius: 18px 18px 18px 4px;
    display: flex;
    gap: 6px;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #5b9bd5;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Кнопки в потоке сообщений */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 10px 0;
    margin-right: 30px !important;
    animation: fadeIn 0.2s ease;
}

.chat-option {
    background: linear-gradient(135deg, #3d6a99 0%, #2b5278 100%);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px !important;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(43, 82, 120, 0.4);
}

.chat-option:hover {
    background: linear-gradient(135deg, #4a7fb3 0%, #3a7bc8 100%);
    box-shadow: 0 4px 12px rgba(43, 82, 120, 0.6);
}

.chat-option.restart {
    background: transparent;
    border: 2px solid #2b5278;
    color: #5b9bd5;
    box-shadow: none;
}

.chat-option.restart:hover {
    background: rgba(43, 82, 120, 0.2);
    border-color: #3a7bc8;
}

/* CTA кнопка */
.chat-cta {
    display: inline-block;
    background: linear-gradient(135deg, #3d6a99 0%, #2b5278 100%);
    color: white !important;
    padding: 12px 24px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(43, 82, 120, 0.4);
}

.chat-cta:hover {
    background: linear-gradient(135deg, #4a7fb3 0%, #3a7bc8 100%);
    box-shadow: 0 4px 12px rgba(43, 82, 120, 0.6);
    text-decoration: none;
}

/* Скроллбар */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #0e1621;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #2b5278;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #3a7bc8;
}

/* Мобильная версия */
@media (max-width: 640px) {
    .career-chat {
        max-width: 95%;
        border-radius: 10px;
    }
    .chat-messages {
        height: 380px;
        padding: 12px 16px;
    }
    .chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .message-content {
        font-size: 14px;
        padding: 14px 35px !important;
    }
    .chat-option {
        font-size: 13px;
        padding: 10px 16px;
    }
    .chat-message.user {
        margin-right: 20px !important;
    }
    .chat-options {
        margin-right: 20px !important;
    }
}
