﻿* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: -moz-none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    -khtml-user-select: auto;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* استایل جدید چت ویدجت */
.chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.chat-notice {
    width: 125px !important;
    position: absolute;
    right: 70px;
    bottom: 50px;
    background: #fff;
    color: #4a5568;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    font-weight: 600;
    direction: rtl;
}

.chat-notice.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-notice::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 10px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.04);
}

/* آیکون چت */
.chat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse 2s infinite;
    position: relative;
}

    .chat-icon:hover {
        transform: scale(1.1);
        box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6);
    }

    .chat-icon::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: inherit;
        animation: ripple 2s infinite;
        z-index: -1;
    }

    .chat-icon i {
        font-size: 24px;
        color: white;
    }

/* بدنه چت */
.chat-widget {
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

    .chat-widget.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

/* هدر چت */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

    .chat-close:hover {
        opacity: 1;
    }

/* بدنه پیام‌ها */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* پیام کاربر */
.message-user {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

    .message-user .message-content {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 12px 16px;
        border-radius: 18px 18px 4px 18px;
        max-width: 70%;
        word-wrap: break-word;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }

/* پیام ادمین */
.message-admin {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

    .message-admin .message-content {
        background: white;
        color: #333;
        padding: 12px 16px;
        border-radius: 18px 18px 18px 4px;
        max-width: 70%;
        word-wrap: break-word;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

/* زمان پیام */
.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    text-align: right;
}

.message-admin .message-time {
    text-align: left;
}

/* فوتور چت */
.chat-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s;
    direction: rtl;
}

    .chat-input:focus {
        outline: none;
        border-color: #667eea;
    }

.chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .chat-send:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

/* نمایش آنلاین بودن */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-left: 8px;
    animation: status-pulse 2s infinite;
}

/* انیمیشن‌ها */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* پشتیبانی از موبایل */
@media (max-width: 768px) {
    .chat-container {
        bottom: 20px;
        right: 20px;
    }

    .chat-widget {
        width: 90vw;
        height: 70vh;
        bottom: 70px;
        left: 0;
    }

    .chat-icon {
        width: 56px;
        height: 56px;
    }
}

/* اسکرول بار زیبا */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

    .chat-body::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* راهنما */
.welcome-message {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

    .typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-4px);
    }
}


.chat-icon {
    position: relative;
}

.chat-tooltip {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1dd3f8 0%, #1ac6e8 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    width: 220px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(29, 211, 248, 0.3);
    z-index: 10000;
    animation: slideInUp 0.5s ease, fadeOut 0.5s ease 4.5s forwards;
    display: none;
}

    .chat-tooltip::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -8px;
        border-width: 8px;
        border-style: solid;
        border-color: #1dd3f8 transparent transparent transparent;
    }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* استایل مودال دریافت شماره */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.contact-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
    direction: rtl;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-modal h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.contact-modal p {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.phone-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    text-align: center;
    margin-bottom: 20px;
    transition: border-color 0.3s;
    direction: ltr;
}

    .phone-input:focus {
        outline: none;
        border-color: #1dd3f8;
    }

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #1dd3f8 0%, #1ac6e8 100%);
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(29, 211, 248, 0.3);
    }

.btn-secondary {
    background: #f3f4f6;
    color: #666;
}

    .btn-secondary:hover {
        background: #e5e7eb;
    }