/* استایل دکمه چت شناور */
.chat-widget-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    border: none;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.chat-widget-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* پاپ‌آپ چت */
.chat-widget-popup {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
}

.chat-widget-popup.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chat-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 300px;
    max-height: 400px;
}

.chat-widget-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.chat-message.customer {
    align-items: flex-start;
}

.chat-message.admin {
    align-items: flex-end;
}

.chat-message-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.chat-message.customer .chat-message-bubble {
    background: #e9ecef;
    color: #333;
    border-bottom-right-radius: 5px;
}

.chat-message.admin .chat-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-left-radius: 5px;
}

.chat-message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.chat-message-time {
    font-size: 11px;
    color: #6c757d;
}

.chat-message-status {
    font-size: 12px;
    margin-left: 5px;
}

.chat-message-bubble.auto-message {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffc107;
    font-style: italic;
    text-align: center;
    padding: 8px 12px;
}

.chat-widget-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-widget-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-widget-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.chat-widget-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    min-height: 80px;
    margin-bottom: 10px;
}

.chat-widget-send-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.chat-widget-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.chat-widget-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* فرم ورود */
.chat-login-form {
    padding: 20px;
}

.chat-login-form h6 {
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.chat-login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.chat-login-form button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* FAQ */
.chat-faq-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.chat-faq-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.chat-faq-item {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-faq-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.chat-faq-question {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-faq-answer {
    display: none;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.chat-faq-item.active .chat-faq-answer {
    display: block;
}

.chat-faq-icon {
    transition: transform 0.3s;
}

.chat-faq-item.active .chat-faq-icon {
    transform: rotate(180deg);
}

/* Loading */
.chat-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget-popup {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 90px;
        max-height: calc(100vh - 120px);
    }
}

