.chatbot-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 200px;
}

.chatbot-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.chatbot-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.chatbot-text span {
    line-height: 1.3;
    text-align: left;
    flex: 1;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-icon {
    background: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chatbot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.chatbot-icon i {
    color: #065f46;
    font-size: 20px;
}

/* Chat Modal Styles */
.chat-modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.chat-modal-content h2 {
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 24px;
    text-align: center;
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 15px;
    max-height: 400px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Chat Message Styles */
.chat-message {
    display: flex;
    margin-bottom: 10px;
    animation: messageSlideIn 0.5s ease-out;
}

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

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

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.bot-message .message-content {
    background: white;
    color: #374151;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.message-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

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

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

/* Onboarding Options */
.onboarding-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.option-btn {
    padding: 10px 14px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    white-space: normal;
}

.option-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

/* Continue Button */
.continue-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.continue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Guide Message */
.guide-message .message-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #3b82f6;
}

/* Success Message */
.success-message .message-content {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #10b981;
    text-align: center;
    max-width: 80%;
    margin: 0 auto;
}

/* Welcome Message Animations */
.welcome-message {
    margin-bottom: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
    animation: welcomeSlideIn 0.8s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    animation: headerFadeIn 0.6s ease-out 0.3s both;
}

.welcome-header .welcome-emoji {
    font-size: 24px;
    animation: emojiBounce 0.8s ease-out 0.5s both;
}

.welcome-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    animation: titleSlideIn 0.6s ease-out 0.4s both;
}

.welcome-intro {
    margin-bottom: 20px;
}

.intro-line {
    margin: 8px 0;
    line-height: 1.6;
    color: #374151;
    opacity: 0;
    animation: lineFadeIn 0.5s ease-out both;
}

.intro-line:nth-child(1) {
    animation-delay: 0.6s;
}

.intro-line:nth-child(2) {
    animation-delay: 0.8s;
}

.help-section {
    margin: 20px 0;
    animation: sectionFadeIn 0.5s ease-out 1.0s both;
}

.help-intro {
    margin: 0 0 12px 0;
    font-weight: 600;
    color: #1e293b;
}

.help-list {
    margin: 12px 0;
    padding-left: 20px;
}

.help-item {
    margin: 6px 0;
    color: #374151;
    opacity: 0;
    transform: translateX(-10px);
    animation: listItemSlideIn 0.4s ease-out both;
}

.instructions-section {
    margin: 20px 0;
    animation: sectionFadeIn 0.5s ease-out 1.8s both;
}

.instruction-line {
    margin: 8px 0;
    line-height: 1.6;
    color: #374151;
    opacity: 0;
    animation: lineFadeIn 0.5s ease-out both;
}

.instruction-line:nth-child(1) {
    animation-delay: 2.0s;
}

.instruction-line:nth-child(2) {
    animation-delay: 2.2s;
}

.completion-section {
    margin: 20px 0;
    animation: sectionFadeIn 0.5s ease-out 2.5s both;
}

.completion-line {
    margin: 0;
    line-height: 1.6;
    color: #374151;
    opacity: 0;
    animation: lineFadeIn 0.5s ease-out 2.7s both;
}

.return-note {
    font-style: italic;
    color: #6b7280 !important;
    margin-top: 15px !important;
    opacity: 0;
    animation: noteFadeIn 0.5s ease-out 3.0s both;
}

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

@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes listItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    animation: messageSlideIn 0.5s ease-out;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Chat Actions */
.chat-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

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

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.action-btn.secondary:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
        max-width: 180px;
        padding: 12px;
    }

    .chatbot-text {
        font-size: 12px;
    }

    .chatbot-icon {
        width: 40px;
        height: 40px;
    }

    .chatbot-icon i {
        font-size: 16px;
    }

    .chat-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .chat-messages {
        max-height: 300px;
    }

    .chat-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .message-content {
        max-width: 85%;
        font-size: 13px;
    }

    .onboarding-options {
        gap: 6px;
    }

    .option-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Chat Input Styles */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
    background: white;
}

.chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
    color: #9ca3af;
}

.send-btn {
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.send-btn i {
    font-size: 14px;
}

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

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}