:root {
    --smart-chatbot-primary: #3b82f6;
    --smart-chatbot-secondary: #9333ea;
}


.smart-chatbot-widget {
    position: fixed;
}

.smart-chat-button {
    border-radius: 50% !important;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    position: absolute;
    transition: transform 0.3s ease;
    bottom: -1px;
}

.smart-chatbot-widget .bottom-right {
    right: 16px !important;
}

.smart-chatbot-widget .bottom-left {
    left: 10px !important;
}

.smart-chatbot-widget .bottom-left .title-chatbot-frooshino {
    left: 0 !important;
}

.smart-chatbot-widget .bottom-left .title-chatbot-frooshino::after {
    left: 28% !important;
}

.smart-chatbot-widget .bottom-right .title-chatbot-frooshino {
    right: 0 !important;
}

.smart-chatbot-widget .bottom-right .title-chatbot-frooshino::after {
    right: 16% !important;
}

.smart-chat-button:hover {
    transform: scale(1.1);
}

.smart-chat-button #smartChatToggle {
    overflow: hidden;
    background: #fff;
    display: block;
    border-radius: 50%;
    width: 69px;
    padding: 3px;
    height: 69px;
}

.smart-chat-button #smartChatToggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.smart-chat-popup {
    position: absolute;
    bottom: 80px;
    width: 346px;
    height: 690px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    color:#000;
}

.smart-chat-popup.show {
    display: flex;
    animation: slideUp 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.smart-chat-header {
    background: linear-gradient(135deg, var(--smart-chatbot-primary), var(--smart-chatbot-secondary));
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
}

.smart-chat-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    opacity: 0.8;
    margin: 4px 0 0 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.chat-close-btn {
    background: red;
    border: none !important;
    color: #fff !important;
    font-size: 24px !important;
    cursor: pointer !important;
    width: 30px;
    height: 30px;
    border-radius: 50% !important;
}

.smart-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-image: url("../image/chat.jpg");
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.smart-chat-messages::-webkit-scrollbar {
     width: 6px;
 }

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

.smart-chat-messages::-webkit-scrollbar-thumb {
     background-color: #888;
     border-radius: 10px;
 }

.smart-chat-messages::-webkit-scrollbar-thumb:hover {
     background-color: #555;
 }

.message {
    margin-bottom: 16px;
    animation: fadeInUp 0.4s ease-out;
}

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

.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bot-message .message-wrapper {
    display: block !important;
}

.user-message .message-wrapper {
    flex-direction: row-reverse;
}
.bot-message .message-wrapper .message-avatar {
    margin-bottom: 5px;
}
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--smart-chatbot-primary), var(--smart-chatbot-secondary));
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.message-content {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    font-size: 14px;
}

.user-message .message-content {
    background: linear-gradient(to bottom, #dcfce7, #d1fae5);
}

.smart-chat-input {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
}

#limitDisplay {
    margin-bottom: 8px;
}

.smart-questions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.smart-questions button {
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 12px;
    border-radius: 20px;
    border: 1px solid #bfdbfe;
    cursor: pointer;
    transition: all 0.2s;
}

.smart-questions button:hover {
    background: #bfdbfe !important;
}

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

#messageInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

#messageInput:focus {
    border-color: var(--smart-chatbot-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--smart-chatbot-primary), var(--smart-chatbot-secondary));
    color: white !important;
    border-radius: 50% !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

#typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* محصولات */
.product-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: linear-gradient(to right, #f9fafb, #f3f4f6);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border: 1px solid #e5e7eb;
    margin-top: 8px;
    font-size: 12px !important;
}

.product-card:hover {
    background: linear-gradient(to right, #ede9fe, #ddd6fe);
    border-color: #c7d2fe;
    transform: translateX(-4px);
}

/* تقسیم‌کننده پیام‌ها */
.messages-divider {
    text-align: center;
    margin: 16px 0;
    padding: 12px;
    background: linear-gradient(to right, #f3f4f6, #e5e7eb);
    border-radius: 12px;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

.clear-history-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* بهبود نمایش محدودیت */
.limit-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 8px;
}

.limit-info.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.limit-info.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.limit-info small {
    display: block;
    margin-top: 4px;
    opacity: 0.8;
}

@media (max-width: 480px) {
    .smart-chat-popup {
        width: 100%;
        height: 100%;
        bottom: 0;
        border-radius: 0;
        position: fixed;
    }

}

.title-chatbot-frooshino {
    position: absolute;
    width: 150px;
    padding: 13px;
    background: #fff;
    border-radius: 10px;
    top: -56px;
    font-size: 14px !important;
    font-weight: bold !important;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}



.title-chatbot-frooshino::after {
    content: "";
    position: absolute;
    bottom: -5px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    text-align: center;
}

.order-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    text-align: center;
}

.orders-container {
    margin-top: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 12px;
    border-radius: 19px;
    background: #fff;
}

.order-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.order-header h4 {
    margin: 0;
    color: #333;
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.status-completed { background: #4caf50; }
.status-processing { background: #ff9800; }
.status-pending { background: #f44336; }
.status-cancelled { background: #9e9e9e; }
.status-refunded { background: #795548; }

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.order-details p {
    margin: 0;
    background: white;
    padding: 10px;
    border-radius: 4px;
}

.order-items {
    margin-bottom: 20px;
}

.order-items h5 {
    margin-bottom: 10px;
    color: #555;
}

.item {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-left: 15px;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-name {
    font-weight: bold;
    color: #333;
}

.item-qty, .item-price {
    font-size: 14px;
    color: #666;
}

.billing-info {
    background: white;
    padding: 15px;
    border-radius: 4px;
}

.billing-info h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
}

@media (max-width: 768px) {
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .order-details {
        grid-template-columns: 1fr;
    }

    .item {
        flex-direction: column;
        text-align: center;
    }

    .item img {
        margin: 0 0 10px 0;
    }
}