/* --- Base Container --- */
#simplebot-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2147483647 !important;
    width: 380px;
    max-width: 90vw;
    height: 620px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#simplebot-chat-widget.simplebot-widget-closed {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
}

/* Header & Tabs */
#simplebot-chat-header {
    background: var(--simplebot-primary, #a88a53);
    background: linear-gradient(135deg, var(--simplebot-primary, #a88a53) 0%, #8a6d3b 100%);
    padding: 15px 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

#simplebot-chat-widget.simplebot-widget-closed #simplebot-chat-header {
    background: transparent !important;
    padding: 0 !important;
    width: 60px !important;
    height: 60px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 50% !important;
}

.simplebot-tabs {
    display: flex;
    gap: 20px;
}

#simplebot-chat-widget.simplebot-widget-closed .simplebot-tabs {
    display: none !important;
}

.simplebot-tab-btn {
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    padding: 5px 0 !important;
    position: relative;
    transition: all 0.3s ease;
}

.simplebot-tab-btn.active {
    color: #fff !important;
}

.simplebot-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--simplebot-accent, #ffffff) !important;
    border-radius: 2px;
}

/* Floating Toggle Button */
#simplebot-toggle-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
}

#simplebot-chat-widget.simplebot-widget-closed #simplebot-toggle-btn {
    width: 60px !important;
    height: 60px !important;
    background: var(--simplebot-floating-btn, #a88a53) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    z-index: 2147483647 !important;
}

.simplebot-btn-icon {
    font-size: 32px !important;
}

.simplebot-icon-close {
    font-size: 24px !important;
    display: block !important;
}

#simplebot-chat-widget.simplebot-widget-closed .simplebot-icon-close {
    display: none !important;
}

#simplebot-chat-widget:not(.simplebot-widget-closed) .simplebot-icon-open {
    display: none !important;
}

/* Actions */
.simplebot-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#simplebot-clear-btn {
    background: none !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer;
    opacity: 0.7;
    padding: 5px !important;
    display: flex !important;
}

#simplebot-chat-widget.simplebot-widget-closed #simplebot-clear-btn {
    display: none !important;
}

/* Chat Body */
#simplebot-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fdfdfd;
    overflow: hidden;
    border-radius: 0 0 20px 20px;
}

#simplebot-chat-widget.simplebot-widget-closed #simplebot-chat-body {
    display: none !important;
}

#simplebot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.simplebot-message {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 18px;
}

.simplebot-message.bot,
.simplebot-message.operator {
    align-self: flex-start;
    background: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.simplebot-message.bot a,
.simplebot-message.operator a {
    color: var(--simplebot-accent, #C5A059) !important;
    font-weight: 600;
    text-decoration: underline;
}

.simplebot-message.bot a:hover,
.simplebot-message.operator a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.simplebot-message.user {
    align-self: flex-end;
    background: var(--simplebot-user-bg, #a88a53);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Input Area */
#simplebot-input-area {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eeeeee;
    display: flex;
    gap: 10px;
}

#simplebot-user-input {
    flex: 1;
    border: 1px solid #e0e0e0 !important;
    border-radius: 25px !important;
    padding: 10px 18px !important;
    font-size: 14px !important;
    outline: none !important;
}

#simplebot-send-btn {
    background: var(--simplebot-accent, #a88a53) !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer;
}

#simplebot-send-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Typing Indicator Animation */
.simplebot-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0;
}

.simplebot-typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: simplebot-typing 1.4s infinite ease-in-out;
}

.simplebot-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.simplebot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.simplebot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes simplebot-typing {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* WhatsApp */
.simplebot-whatsapp-container {
    padding: 0 20px 15px;
}

.simplebot-whatsapp-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #25D366 !important;
    color: #fff !important;
    border-radius: 12px;
    text-decoration: none !important;
    font-weight: 600;
}

/* FAQ */
.simplebot-tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
}

.simplebot-tab-content.active {
    display: flex;
}

.simplebot-faq-list {
    padding: 20px;
}

.simplebot-faq-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    overflow: hidden;
}

.simplebot-faq-question {
    padding: 12px 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.simplebot-faq-answer {
    padding: 15px;
    background: #fcfcfc;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #555;
}

/* Responsive */
@media (max-width: 480px) {
    #simplebot-chat-widget:not(.simplebot-widget-closed) {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }

    #simplebot-chat-widget.simplebot-widget-closed {
        bottom: 20px !important;
        right: 20px !important;
    }

    /* IqitTheme / Back-to-top */
    .btn-to-top.js-btn-to-top,
    #back-to-top,
    .back-to-top,
    #iqit-backtop {
        bottom: 95px !important;
        right: 30px !important;
        z-index: 2147483646 !important;
    }
}