/* Virtual Mentor Chat Styles */

.chat-container {
    min-height: calc(100vh - 70px);
    background: var(--bg-color);
}

.chat-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    height: calc(100vh - 250px);
}

/* Sidebar */
.chat-sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    overflow-y: auto;
}

.chat-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-topics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.topic-btn {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 15px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.topic-btn i {
    color: var(--primary-color);
    font-size: 1.2rem;
    min-width: 20px;
}

.topic-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.topic-btn:hover i {
    color: white;
}

.sidebar-stats {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.sidebar-stats h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-stats .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.sidebar-stats .stat-item:last-child {
    border-bottom: none;
}

.sidebar-stats strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Chat Main Area */
.chat-main {
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Messages */
.message {
    display: flex;
    gap: 15px;
    animation: fadeIn 0.3s ease-in;
}

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

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

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

.mentor-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.message-content {
    flex: 1;
    max-width: 85%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-header strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-text {
    background: var(--bg-color);
    padding: 18px 20px;
    border-radius: 12px;
    line-height: 1.7;
    color: var(--text-primary);
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
}

.message-text p {
    margin-bottom: 12px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul,
.message-text ol {
    margin: 12px 0 12px 25px;
}

.message-text li {
    margin-bottom: 8px;
}

.message-text strong {
    font-weight: 600;
}

/* Message Actions */
.message-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.action-btn.helpful {
    color: var(--success-color);
}

/* Related Articles */
.related-articles {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
}

.related-articles h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.related-link {
    display: block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 0;
    transition: padding-left 0.3s;
}

.related-link:hover {
    padding-left: 10px;
}

/* Chat Input Area */
.chat-input-area {
    border-top: 2px solid var(--border-color);
    padding: 25px 30px;
    background: var(--card-bg);
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-info {
    display: flex;
    gap: 15px;
}

.user-name-input,
.user-role-select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.user-name-input {
    flex: 2;
}

.user-role-select {
    flex: 1;
}

.user-name-input:focus,
.user-role-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.question-input {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    transition: border-color 0.3s;
}

.question-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-button {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: stretch;
}

.send-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

.typing-indicator .message-avatar {
    animation: pulse 1.5s ease-in-out infinite;
}

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

.typing-dots {
    display: flex;
    gap: 6px;
    padding: 15px 20px;
    background: var(--bg-color);
    border-radius: 12px;
}

.typing-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

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

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .chat-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chat-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: none;
    }

    .chat-messages {
        height: 500px;
    }

    .message-content {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .chat-messages {
        padding: 20px 15px;
        height: 400px;
    }

    .chat-input-area {
        padding: 15px;
    }

    .user-info {
        flex-direction: column;
    }

    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .send-button {
        width: 100%;
    }

    .message-content {
        max-width: 100%;
    }

    .quick-topics {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .topic-btn {
        font-size: 0.85rem;
        padding: 12px;
    }
}
