/* Chatbot Widget Styles */

.chatbot-widget {
    position: fixed;
    bottom: 95px;
    right: 14px;
    width: 380px;
    height: 660px;
    max-height: 560px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100000;
    opacity: 0;
    transform: scale(0.85) translateY(30px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-widget.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #1e90ff 0%, #0d6efd 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #0d6efd;
}

.chatbot-title {
    flex: 1;
}

.chatbot-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-title p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-actions {
    display: flex;
    gap: 8px;
}

.chatbot-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* User Info Form */
.chatbot-user-form {
    flex: 1;
    overflow: hidden;
    padding: 20px 20px 20px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    max-height: 100%;
}

.user-form-content {
    width: 100%;
    max-width: 100%;
}

.form-welcome {
    display: none;
}

.form-group {
    margin-bottom: 14px;
}

.form-group:first-of-type {
    margin-top: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.form-group label i {
    color: #0d6efd;
    font-size: 14px;
}

.form-group .required {
    color: #dc3545;
}

.form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    color: #212529;
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-group input::placeholder {
    color: #adb5bd;
}

.form-submit-btn {
    width: 100%;
    padding: 11px 20px;
    background: linear-gradient(135deg, #1e90ff 0%, #0d6efd 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 18px;
}

.form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

.form-submit-btn:active {
    transform: translateY(0);
}

.form-submit-btn i {
    font-size: 18px;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    max-height: 100%;
}

.chatbot-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease-out;
}

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

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

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

.message-avatar.bot {
    background: linear-gradient(135deg, #1e90ff, #0d6efd);
    color: white;
}

.message-avatar.user {
    background: #e9ecef;
    color: #495057;
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message.bot .message-bubble {
    background: #343a40;
    color: white;
    border-radius: 12px 12px 12px 4px;
}

.chatbot-message.user .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-radius: 12px 12px 4px 12px;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    padding: 0 4px;
}

/* Suggestions */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.suggestion-btn {
    background: white;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
}

.suggestion-btn:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 24px;
    border: 1px solid #e9ecef;
    transition: border-color 0.2s;
}

.chatbot-input-wrapper:focus-within {
    border-color: #0d6efd;
    background: white;
}

.chatbot-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}

.chatbot-input-wrapper input::placeholder {
    color: #adb5bd;
}

.chatbot-input-action {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    font-size: 18px;
}

.chatbot-input-action:hover {
    color: #0d6efd;
}

.chatbot-send-btn {
    background: linear-gradient(135deg, #1e90ff, #0d6efd);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

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

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #343a40;
    color: white;
    border-radius: 12px 12px 12px 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

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

/* Powered by footer */
.chatbot-footer {
    padding: 10px 20px;
    text-align: center;
    font-size: 11px;
    color: #6c757d;
    background: white;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e9ecef;
}

.chatbot-footer a {
    color: #0d6efd;
    text-decoration: none;
}

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

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-widget {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: 450px;
        max-height: calc(100vh - 140px);
    }

    .chatbot-messages {
        min-height: auto;
        flex: 1;
    }
}
