/* استایل کلی چت */
.post-chat-container {
    background: rgba(20, 20, 30, 0.7);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 30px 0;
    color: #f0f0f0;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
    font-size: 1.5rem;
    color: #8a2be2;
    margin: 0;
}

.online-users {
    background: rgba(60, 60, 80, 0.4);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.online-count {
    color: #ff6b6b;
    font-weight: bold;
}

/* بخش پیام‌ها */
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 20px;
    background: rgba(15, 15, 25, 0.5);
    border-radius: 15px;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.5);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.7);
}

.no-messages {
    text-align: center;
    padding: 50px 0;
    color: #888;
    font-size: 1.1rem;
}

/* استایل هر پیام */
.chat-message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in-out;
}

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

.message-avatar {
    margin-left: 15px;
}

.message-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.message-content {
    flex: 1;
    background: rgba(40, 40, 50, 0.4);
    padding: 12px 15px;
    border-radius: 15px;
    border-top-right-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.message-user {
    color: #8a2be2;
    font-weight: bold;
}

.message-time {
    color: #888;
}

.message-text {
    line-height: 1.6;
    word-break: break-word;
}

/* استایل پیام‌های کاربر فعلی */
.chat-message.current-user {
    flex-direction: row-reverse;
}

.chat-message.current-user .message-content {
    background: rgba(138, 43, 226, 0.2);
    border-top-right-radius: 15px;
    border-top-left-radius: 0;
}

.chat-message.current-user .message-avatar {
    margin-left: 0;
    margin-right: 15px;
}

/* بخش ورود پیام */
.chat-input {
    display: flex;
    margin-top: 15px;
}

.chat-input textarea {
    flex: 1;
    padding: 12px 15px;
    border-radius: 15px;
    border: none;
    background: rgba(40, 40, 50, 0.5);
    color: #f0f0f0;
    resize: none;
    height: 60px;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input textarea:focus {
    outline: none;
    border-color: rgba(138, 43, 226, 0.5);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.send-button {
    margin-right: 10px;
    padding: 0 25px;
    background: linear-gradient(135deg, #8a2be2, #6a1fb9);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.send-button:hover {
    background: linear-gradient(135deg, #9a3bf2, #7a2fc9);
    transform: translateY(-2px);
}

.send-button:active {
    transform: translateY(0);
}

/* نشانگر تایپ کردن */
.typing-indicator {
    height: 20px;
    color: #888;
    font-size: 0.9rem;
    margin-top: 5px;
    padding: 0 15px;
}

/* استایل برای کاربران غیرعضو */
.chat-login-required {
    text-align: center;
    padding: 30px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 15px;
    border: 1px dashed rgba(255, 107, 107, 0.3);
}

.chat-login-required a {
    color: #8a2be2;
    text-decoration: none;
    font-weight: bold;
}

.chat-login-required a:hover {
    text-decoration: underline;
}

/* انیمیشن‌ها */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #8a2be2;
    border-radius: 50%;
    margin: 0 2px;
    animation: pulse 1.5s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}