/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    height: 500px;
    max-height: 80vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    display: none; /* Hidden by default */
}

.chatbot-header {
    background: linear-gradient(135deg, #4a6fa5, #3a5a80);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f5f7fa;
}

.chatbot-message {
    margin-bottom: 15px;
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    background: #4a6fa5;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background: white;
    color: #333;
    margin-right: auto;
    border: 1px solid #e1e4e8;
    border-bottom-left-radius: 5px;
}

.chatbot-input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e1e4e8;
}

.chatbot-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.chatbot-input:focus {
    border-color: #4a6fa5;
}

.chatbot-send {
    background: #4a6fa5;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.chatbot-send:hover {
    background: #3a5a80;
}

/* Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4a6fa5, #3a5a80);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 999;
    transition: all 0.3s ease;
}

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

/* Typing Indicator */
.typing-indicator {
    background: transparent !important;
    box-shadow: none !important;
    padding: 5px 15px !important;
}

.typing {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.typing span {
    width: 8px;
    height: 8px;
    background: #4a6fa5;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    opacity: 0.4;
}

.typing span:nth-child(1) {
    animation: typing 1s infinite;
}

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

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

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-container {
        width: 90%;
        right: 5%;
        bottom: 80px;
        height: 70vh;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Link styling in messages */
.chatbot-message a {
    color: #4a6fa5;
    text-decoration: none;
    font-weight: 500;
}

.chatbot-message a:hover {
    text-decoration: underline;
}

/* Message content formatting */
.message-content {
    word-wrap: break-word;
}

.message-content strong {
    font-weight: 600;
    color: #2c3e50;
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #718096;
}
