﻿/* صفحه اصلی */
.main-page {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
}

    .main-page h1 {
        font-size: 1.8rem;
        color: #2c3e50;
        margin-bottom: 20px;
    }

/* دکمه اصلی باز کردن ربات */
#chat-button {
    background: #2aabee;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(42,171,238,0.3);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

    #chat-button:hover {
        background: #1e8fc7;
        transform: scale(1.02);
    }

    #chat-button i {
        font-size: 1.5rem;
    }

/* ویجت چت */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: 0.3s ease-in-out;
    z-index: 1000;
}

    .chat-widget.hidden {
        display: none;
    }

/* هدر با پروفایل */
.chat-header {
    background: #ffffff;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.avatar {
    width: 60px;
    height: 60px;
    background: #2aabee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(42,171,238,0.3);
    margin-bottom: 8px;
}

.status {
    font-size: 0.9rem;
    color: #4caf50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* سه نقطه متحرک (لودینگ) */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

    .typing-dots span {
        width: 6px;
        height: 6px;
        background: #4caf50;
        border-radius: 50%;
        display: inline-block;
        animation: typing 1.4s infinite ease-in-out both;
    }

        .typing-dots span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-dots span:nth-child(2) {
            animation-delay: -0.16s;
        }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.hidden {
    display: none !important;
}

/* ناحیه پیام‌ها */
.messages-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* حباب پیام ربات */
.bot-message {
    align-self: flex-start;
    background: #e4e6eb;
    color: #050505;
    border-radius: 18px 18px 18px 4px;
    padding: 10px 15px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* حباب پیام کاربر */
.user-message {
    align-self: flex-end;
    background: #2aabee;
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 15px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* دکمه درون حباب (تماس با ما) */
.contact-button {
    background: white;
    border: 1px solid #2aabee;
    color: #2aabee;
    border-radius: 20px;
    padding: 8px 15px;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .contact-button:hover {
        background: #2aabee;
        color: white;
    }

/* ناحیه پایین */
.bottom-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

/* دکمه استارت (تمام عرض) */
.start-button-container {
    display: flex;
    justify-content: center;
}

#start-bot-button {
    background: #2aabee;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(42,171,238,0.3);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

    #start-bot-button:hover {
        background: #1e8fc7;
        transform: scale(1.02);
    }

/* دکمه‌های مربعی */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.menu-button {
    background: #f0f2f5;
    border: none;
    border-radius: 15px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

    .menu-button i {
        font-size: 1.5rem;
        color: #2aabee;
    }

    .menu-button:hover {
        background: #e0e4e9;
        transform: translateY(-2px);
    }

/* ناحیه ورودی */
.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .input-container.hidden {
        display: none;
    }

#message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}

    #message-input:focus {
        border-color: #2aabee;
        box-shadow: 0 0 0 2px rgba(42,171,238,0.2);
    }

#send-button {
    background: #2aabee;
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

    #send-button:hover {
        background: #1e8fc7;
    }

.close-chat {
    position: absolute;
    left: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #888;
    cursor: pointer;
}

@media (max-width: 480px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}


/* ===== دکمه ===== */
.bot-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #0088cc;
    color: white;
    
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: 0.3s ease;
    z-index: 9999;
}

    /* هاور */
    .bot-btn:hover {
        background: #0077b5;
        transform: scale(1.05);
    }

/* آیکن */
.bot-icon {
    display: flex;
    animation: float 1.5s ease-in-out infinite;
}

/* انیمیشن بالا پایین */
@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}

/* حالت قیب شدن */
.bot-btn.hide {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* موبایل */
@media (max-width: 768px) {
    .bot-btn {
        width: 60px;
        height: 60px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        display: flex;
    }

    .bot-text {
        display: none;
    }
}
