/* Floating Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4f46e5;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    background-color: #4338ca;
}

/* Chat Popup Window */
.chatbot-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    /* Taller for chat */
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Dark Mode */
[data-theme='dark'] .chatbot-popup {
    background-color: #1f2937;
    border: 1px solid #374151;
}

/* Header */
.chatbot-header {
    background-color: #4f46e5;
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
}

.chatbot-close:hover {
    opacity: 1;
}

/* Body / Messages Area */
.chatbot-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-theme='dark'] .chatbot-body {
    background-color: #111827;
}

/* Messages Area parent */
.chatbot-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background-color: #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 2px;
}

[data-theme='dark'] .bot-message {
    background-color: #374151;
    color: #f3f4f6;
}

.user-message {
    align-self: flex-end;
    background-color: #4f46e5;
    color: white;
    border-bottom-right-radius: 2px;
}

/* Footer / Input Area */
.chatbot-footer {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e5e7eb;
}

[data-theme='dark'] .chatbot-footer {
    background-color: #1f2937;
    border-color: #374151;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

[data-theme='dark'] .input-group input {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
}

.input-group input:focus {
    border-color: #4f46e5;
}

.input-group button {
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.input-group button:hover {
    background-color: #4338ca;
}

/* Loading Dots */
.loading-message {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: #6b7280;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* View Handling */
.chatbot-view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.chatbot-view.active {
    display: flex;
}

/* Support Form Styles */
.support-body {
    padding: 20px;
    background-color: #e0f2fe;
    /* Light blue background as in image */
}

[data-theme='dark'] .support-body {
    background-color: #1e293b;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

[data-theme='dark'] .form-group label {
    color: #f1f5f9;
}

.required {
    color: #ef4444;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

[data-theme='dark'] .form-group input,
[data-theme='dark'] .form-group textarea {
    background-color: #334155;
    border-color: #475569;
    color: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    background-color: white;
}

.form-group textarea {
    resize: none;
}

.support-submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #2563eb;
    /* Blue button */
    color: white;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    transition: background 0.2s;
    margin-top: 10px;
}

.support-submit-btn:hover {
    background-color: #1d4ed8;
}

.support-submit-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.support-actions {
    text-align: center;
    margin-top: 15px;
}

.support-actions a {
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
}

.support-actions a:hover {
    text-decoration: underline;
}

.support-status {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    min-height: 20px;
}

.support-status.success {
    color: #10b981;
    font-weight: 600;
}

.support-status.error {
    color: #ef4444;
}

/* Support Link in Footer */
.chatbot-support-link {
    text-align: center;
    margin-top: 10px;
}

.chatbot-support-link a {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
}

.chatbot-support-link a:hover {
    text-decoration: underline;
    color: #4f46e5;
}