/* Global Styles */
html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    color: #333;
    height: 100vh;
    overflow-x: hidden;
}

/* Main Content */
.main-content {
    min-height: 100vh;
    padding: 0;
}

/* Chatbot Container */
.chatbot-container {
    width: 100%;
    height: 100vh;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat Header */
.chat-header {
    background: #ffffff;
    color: #333;
    padding: 20px;
    text-align: center;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid #e1e5e9;
}

.chat-header h1 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #6c757d;
    color: white;
}

.bot-message .message-avatar {
    background: #007bff;
    color: white;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 75%;
    min-width: 0px;
    width: fit-content;
    word-wrap: break-word;
    display: inline-block;
}

.user-message .message-content {
    background: #007bff;
    color: white;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-avatar {
    order: 2;
    margin-right: 0;
    margin-left: 12px;
}

.user-message .message-content {
    order: 1;
}

.message-content p {
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 4px;
}

/* Ensure proper spacing for message containers */
.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

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

.user-message {
    justify-content: flex-end;
}

.message-time {
    font-size: 0.75rem;
    color: #666;
    margin-top: 8px;
    text-align: right;
    display: block;
}

.user-message .message-time {
    text-align: left;
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: white;
    border-radius: 0 0 20px 20px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: #007bff;
}

.send-button {
    width: 45px;
    height: 45px;
    border: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
}

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

.chat-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.send-icon {
    font-size: 1.2rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-action {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quick-action:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.loading-indicator {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

.loading-message {
    opacity: 1;
}

.loading-message .message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 75%;
    min-width: 0px;
    width: fit-content;
    word-wrap: break-word;
}

.typing-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    width: 100%;
}

.typing-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #007bff;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-input-container {
        border-radius: 0;
    }

    .quick-actions {
        justify-content: center;
    }

    .quick-action {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Adjust message bubble width on mobile */
    .message-content {
        max-width: 88%;
        min-width: 0px;
        width: fit-content;
    }

    .user-message .message-content {
        max-width: 88%;
        min-width: 0px;
        width: fit-content;
    }

    /* Ensure proper alignment on mobile */
    .user-message {
        margin-left: auto;
    }

    /* Loading animation on mobile */
    .loading-message .message-content {
        padding: 10px 14px;
        min-height: 36px;
        max-width: 88%;
        min-width: 0px;
        width: fit-content;
    }

    .typing-dot {
        width: 8px;
        height: 8px;
    }

    .typing-animation {
        padding: 10px 0;
        gap: 4px;
    }
}
