/* SiteMYNT Chatbot Widget Styles */

:root {
    --chatbot-primary: #6366f1;
    --chatbot-primary-dark: #4f46e5;
    --chatbot-gold: #FFD700;
    --chatbot-bg: #ffffff;
    --chatbot-text: #1f2937;
    --chatbot-text-muted: #6b7280;
    --chatbot-border: #e5e7eb;
    --chatbot-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Dark theme */
.chatbot-widget.theme-dark {
    --chatbot-bg: #1f2937;
    --chatbot-text: #f9fafb;
    --chatbot-text-muted: #9ca3af;
    --chatbot-border: #374151;
}

/* Container */
.chatbot-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: fixed;
    z-index: 9999;
}

.chatbot-widget.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.chatbot-widget.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Floating Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-primary-dark));
    color: white;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.35);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
}

.chatbot-toggle.open .chatbot-icon-open {
    display: none;
}

.chatbot-toggle.open .chatbot-icon-close {
    display: block;
}

.chatbot-toggle:not(.open) .chatbot-icon-close {
    display: none;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: 550px;
    background: var(--chatbot-bg);
    border-radius: 16px;
    box-shadow: var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-widget.position-bottom-right .chatbot-window {
    right: 0;
}

.chatbot-widget.position-bottom-left .chatbot-window {
    left: 0;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-primary-dark));
    color: white;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.chatbot-header-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chatbot-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chatbot-logo {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.chatbot-logo-gold {
    color: var(--chatbot-gold);
}

.chatbot-title-suffix {
    font-weight: 600;
    font-size: 14px;
    opacity: 0.9;
}

.chatbot-status {
    font-size: 12px;
    color: #39ff14;
    opacity: 1;
}

.chatbot-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.chatbot-close svg {
    width: 16px;
    height: 16px;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chatbot-bg);
}

.chatbot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

.chatbot-message.assistant {
    background: #f3f4f6;
    color: var(--chatbot-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.theme-dark .chatbot-message.assistant {
    background: #374151;
}

.chatbot-message.user {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 60px;
}

.theme-dark .chatbot-typing {
    background: #374151;
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-text-muted);
    animation: chatbot-bounce 1.4s infinite ease-in-out both;
}

.chatbot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.chatbot-typing-dot:nth-child(3) { animation-delay: 0; }

@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.chatbot-input-area {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 8px;
    background: var(--chatbot-bg);
    align-items: center;
}

.chatbot-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--chatbot-border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--chatbot-bg);
    color: var(--chatbot-text);
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
}

.chatbot-input::placeholder {
    color: var(--chatbot-text-muted);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-primary-dark));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

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

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

.chatbot-send svg {
    width: 18px;
    height: 18px;
}

/* Lead Form */
.chatbot-lead-form {
    padding: 16px;
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-lead-title {
    font-weight: 600;
    color: var(--chatbot-text);
    margin-bottom: 12px;
    font-size: 14px;
}

.chatbot-lead-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    background: var(--chatbot-bg);
    color: var(--chatbot-text);
    box-sizing: border-box;
}

.chatbot-lead-form input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
}

.chatbot-lead-submit {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-lead-submit:hover {
    transform: scale(1.02);
}

.chatbot-lead-skip {
    width: 100%;
    padding: 8px;
    background: transparent;
    color: var(--chatbot-text-muted);
    border: none;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}

/* Offline Banner */
.chatbot-offline {
    padding: 12px 16px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    text-align: center;
}

.theme-dark .chatbot-offline {
    background: #78350f;
    color: #fef3c7;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-widget.position-bottom-right,
    .chatbot-widget.position-bottom-left {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .chatbot-window {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 88px;
        width: calc(100vw - 32px);
        max-height: 70vh;
        border-radius: 16px;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-text-muted);
}
