/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-family: 'Arial', sans-serif;
}

.chatbot-container.active {
    transform: translateY(0);
    opacity: 1;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: #39cfca; /* Using the site's theme color */
    color: #fff;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
}

.chatbot-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-title {
    font-weight: bold;
    font-size: 16px;
}

.chatbot-controls {
    display: flex;
}

.chatbot-control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    padding: 0;
    transition: transform 0.2s ease;
}

.chatbot-control-btn:hover {
    transform: scale(1.1);
}

#chatbot-reset {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-body {
    height: 60vh;
    overflow-y: auto;
    padding: 15px;
    background-color: #f5f5f5;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-message.bot {
    align-items: flex-start;
}

.chat-message.user {
    align-items: flex-end;
    align-self: flex-end;
    margin-left: auto;
}

.chat-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
    background-color: #fff;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.user .chat-bubble {
    background-color: #005baa; /* Using another site theme color */
    color: #fff;
    border-bottom-right-radius: 5px;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #e1e1e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-option-btn {
    background-color: #fff;
    border: 1px solid #39cfca;
    color: #39cfca;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-option-btn:hover {
    background-color: #39cfca;
    color: #fff;
}

.chatbot-footer {
    padding: 10px 15px;
    background-color: #fff;
    border-top: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e1e1e1;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
}

.chatbot-send-btn {
    background-color: #39cfca;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chatbot-send-btn:hover {
    background-color: #2db5b0;
}

.chatbot-toggle {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #39cfca;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.chatbot-toggle i {
    color: #fff;
    font-size: 24px;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #39cfca;
    opacity: 0.7;
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.chatbot-typing {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #aaa;
    border-radius: 50%;
    margin-right: 4px;
    animation: typingAnimation 1.5s infinite ease-in-out;
}

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

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

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

@keyframes typingAnimation {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.chat-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    margin-left: 5px;
}

/* Form styles */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* Course link styles */
.course-link {
    color: #005baa;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
    display: inline-block;
    margin-top: 5px;
    position: relative;
}

.course-link:hover {
    color: #39cfca;
}

.course-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #39cfca;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.course-link:hover::after {
    transform: scaleX(1);
}

.chat-form-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.chat-form-submit {
    background-color: #39cfca;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.chat-form-submit:hover {
    background-color: #2db5b0;
}

/* Responsive styles */
@media only screen and (max-width: 768px) {
    .chatbot-container {
        width: 300px;
    }
    
    .chatbot-body {
        height: 250px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        bottom: 73px;
        right: 15px;
    }
    
    .chatbot-toggle i {
        font-size: 20px;
    }
}
