/**
 * SLG Chatbot Styles
 */

/* Variables */
:root {
    --chatbot-primary: #2c3e50;
    --chatbot-secondary: #3498db;
    --chatbot-bg: #ffffff;
    --chatbot-text: #333333;
    --chatbot-light: #f8f9fa;
    --chatbot-border: #e0e0e0;
    --chatbot-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
}

/* Container */
.slg-chatbot {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

.slg-chatbot--right {
    right: 20px;
}

.slg-chatbot--left {
    left: 20px;
}

/* Toggle Button */
.slg-chatbot__toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-secondary);
    border: none;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, background 0.3s;
}

.slg-chatbot__toggle:hover {
    transform: scale(1.1);
    background: #2980b9;
}

.slg-chatbot__toggle-icon,
.slg-chatbot__toggle-close {
    font-size: 24px;
    color: white;
}

.slg-chatbot__toggle-close {
    display: none;
}

.slg-chatbot.is-open .slg-chatbot__toggle-icon {
    display: none;
}

.slg-chatbot.is-open .slg-chatbot__toggle-close {
    display: block;
}

/* Chat Window */
.slg-chatbot__window {
    position: absolute;
    bottom: 70px;
    width: 380px;
    max-height: 600px;
    background: var(--chatbot-bg);
    border-radius: 16px;
    box-shadow: var(--chatbot-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.slg-chatbot--right .slg-chatbot__window {
    right: 0;
}

.slg-chatbot--left .slg-chatbot__window {
    left: 0;
}

.slg-chatbot.is-open .slg-chatbot__window {
    display: flex;
    animation: chatbotSlideIn 0.3s ease;
}

@keyframes chatbotSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.slg-chatbot__header {
    background: var(--chatbot-primary);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slg-chatbot__title {
    font-weight: 600;
    font-size: 16px;
}

.slg-chatbot__close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
}

.slg-chatbot__close:hover {
    opacity: 1;
}

/* Messages */
.slg-chatbot__messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 200px;
    background: var(--chatbot-light);
}

.slg-chatbot__message {
    margin-bottom: 12px;
    display: flex;
}

.slg-chatbot__message--bot {
    justify-content: flex-start;
}

.slg-chatbot__message--user {
    justify-content: flex-end;
}

.slg-chatbot__bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
}

.slg-chatbot__message--bot .slg-chatbot__bubble {
    background: white;
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
}

.slg-chatbot__message--user .slg-chatbot__bubble {
    background: var(--chatbot-secondary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Quick Actions */
.slg-chatbot__actions {
    padding: 10px 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border-top: 1px solid var(--chatbot-border);
}

.slg-chatbot__action {
    padding: 10px;
    background: var(--chatbot-light);
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-align: left;
}

.slg-chatbot__action:hover {
    background: var(--chatbot-secondary);
    color: white;
    border-color: var(--chatbot-secondary);
}

/* Panels */
.slg-chatbot__panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    flex-direction: column;
}

.slg-chatbot__panel-header {
    background: var(--chatbot-primary);
    color: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.slg-chatbot__back {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

/* FAQ List */
.slg-chatbot__faq-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.slg-chatbot__faq-item {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: var(--chatbot-light);
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.slg-chatbot__faq-item:hover {
    background: #e8f4fc;
    border-color: var(--chatbot-secondary);
}

/* Search & Order Forms */
.slg-chatbot__search-form,
.slg-chatbot__order-form,
.slg-chatbot__contact-form {
    padding: 15px;
}

.slg-chatbot__search-input,
.slg-chatbot__order-email,
.slg-chatbot__order-ref,
.slg-chatbot__contact-name,
.slg-chatbot__contact-email,
.slg-chatbot__contact-message {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    font-size: 14px;
}

.slg-chatbot__search-input:focus,
.slg-chatbot__order-email:focus,
.slg-chatbot__order-ref:focus,
.slg-chatbot__contact-name:focus,
.slg-chatbot__contact-email:focus,
.slg-chatbot__contact-message:focus {
    outline: none;
    border-color: var(--chatbot-secondary);
}

.slg-chatbot__search-btn,
.slg-chatbot__order-btn,
.slg-chatbot__contact-btn {
    width: 100%;
    padding: 12px;
    background: var(--chatbot-secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.slg-chatbot__search-btn:hover,
.slg-chatbot__order-btn:hover,
.slg-chatbot__contact-btn:hover {
    background: #2980b9;
}

/* Search Results */
.slg-chatbot__search-results,
.slg-chatbot__order-result {
    padding: 10px 15px 15px;
    overflow-y: auto;
    flex: 1;
    max-height: 300px;
    background: #fff;
}

.slg-chatbot__product {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    color: #333 !important;
    transition: all 0.2s;
    align-items: flex-start;
}

.slg-chatbot__product:hover {
    background: #e3f2fd;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slg-chatbot__product-img {
    width: 60px;
    height: 60px;
    min-width: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #ddd;
}

.slg-chatbot__product-info {
    flex: 1;
    min-width: 0;
}

.slg-chatbot__product-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 6px;
    color: #2c3e50 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slg-chatbot__product-price {
    color: #e67e22 !important;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.slg-chatbot__product-stock {
    font-size: 11px;
    color: #27ae60 !important;
    font-weight: 500;
}

.slg-chatbot__product-stock.out {
    color: #e74c3c !important;
}

/* Order Status */
.slg-chatbot__order-status {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #333 !important;
}

.slg-chatbot__order-status h4 {
    margin: 0 0 12px;
    color: #2c3e50 !important;
    font-size: 16px;
    font-weight: 700;
}

.slg-chatbot__order-status p {
    margin: 8px 0;
    color: #333 !important;
    font-size: 14px;
    line-height: 1.4;
}

.slg-chatbot__order-status strong {
    color: #2c3e50 !important;
    font-weight: 600;
}

/* Loading */
.slg-chatbot__loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Error */
.slg-chatbot__error {
    padding: 15px;
    background: #fee;
    color: #c00;
    border-radius: 8px;
    text-align: center;
}

/* Success */
.slg-chatbot__success {
    padding: 15px;
    background: #efe;
    color: #070;
    border-radius: 8px;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 400px) {
    .slg-chatbot__window {
        width: calc(100vw - 40px);
        max-height: 70vh;
    }
}

/* Typing Indicator Animation */
.slg-chatbot__typing {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 6px;
}

.slg-chatbot__typing-dot {
    width: 10px;
    height: 10px;
    background: var(--chatbot-secondary);
    border-radius: 50%;
    animation: chatbotTyping 1.4s infinite ease-in-out both;
}

.slg-chatbot__typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.slg-chatbot__typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.slg-chatbot__typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes chatbotTyping {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}