/* از فونت Vazirmatn که خودت روی سایت لود کردی استفاده می‌کنیم، نیازی به import جدا نیست */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-void: #07070f;
    --bg-panel: rgba(17, 17, 32, 0.78);
    --bg-panel-solid: #121223;
    --bg-input: rgba(255, 255, 255, 0.06);
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(167, 139, 250, 0.45);
    --accent-violet: #a78bfa;
    --accent-magenta: #f472b6;
    --accent-cyan: #5eead4;
    --text-primary: #f5f3ff;
    --text-muted: #9d9dc0;
    --gradient-alive: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-magenta) 55%, var(--accent-cyan) 100%);
    --gradient-user: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: linear-gradient(160deg, #0d0d1f 0%, #1a1030 50%, #0d0d1f 100%);
    min-height: 100vh;
    direction: rtl;
    color: var(--text-primary);
}

header {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 2.2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
}

header h1 {
    background: var(--gradient-alive);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2.4rem;
    margin-bottom: 0.4rem;
}

header p {
    color: var(--text-muted);
}

main {
    padding: 4rem 1rem;
}

.hero {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-soft);
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero h2 {
    color: var(--text-primary);
    font-size: 1.9rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ===== چت‌بات ===== */
#chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

/* دکمه شناور با حلقه‌های نور نئون زنده */
.chatbot-button {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--bg-panel-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.25s ease;
}

.chatbot-button:hover {
    transform: scale(1.08);
}

.pulse-ring {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--gradient-alive);
    z-index: 0;
    animation: breathe 2.4s ease-in-out infinite;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--bg-panel-solid);
    margin: 3px;
}

.ping {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-violet);
    animation: ping 2.6s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}

.ping.delay {
    animation-delay: 1.3s;
    border-color: var(--accent-magenta);
}

.orb-icon {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
}

@keyframes breathe {
    0%, 100% { filter: brightness(1) saturate(1); box-shadow: 0 0 16px 2px rgba(167, 139, 250, 0.55); }
    50% { filter: brightness(1.25) saturate(1.3); box-shadow: 0 0 26px 6px rgba(244, 114, 182, 0.6); }
}

@keyframes ping {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* پنجره چت */
.chatbot-window {
    display: none;
    width: 380px;
    height: 620px;
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(167, 139, 250, 0.12);
    flex-direction: column;
    overflow: hidden;
    animation: riseIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-window.active {
    display: flex;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.18));
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-primary);
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

/* آواتار زنده - ارب نورانی */
.chat-avatar {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.avatar-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--gradient-alive);
    filter: blur(6px);
    animation: breathe 3s ease-in-out infinite;
}

.avatar-orb {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

.chat-title h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px 2px var(--accent-cyan);
    animation: dotPulse 1.8s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.chat-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

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

.chat-messages {
    flex: 1;
    padding: 1.4rem;
    overflow-y: auto;
    background: transparent;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-violet);
    border-radius: 3px;
    opacity: 0.5;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 0.85rem 1.15rem;
    border-radius: 18px;
    white-space: pre-line;
    line-height: 1.7;
    font-size: 0.93rem;
}

.message.user .message-content {
    background: var(--gradient-user);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.message.bot .message-content {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-soft);
    border-bottom-left-radius: 4px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 0.95rem 1.15rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: var(--accent-violet);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; background: var(--accent-magenta); }
.typing-dot:nth-child(3) { animation-delay: 0.4s; background: var(--accent-cyan); }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.chat-input-area {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-soft);
}

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

.chat-input {
    flex: 1;
    border: 1px solid var(--border-soft);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: 25px;
    padding: 0.75rem 1.2rem;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    font-size: 0.92rem;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.chat-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-user);
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send:hover:not(:disabled) {
    transform: scale(1.1);
}

.chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-footer-link {
    text-align: center;
    padding: 0.55rem 0 0.9rem;
    background: rgba(255, 255, 255, 0.02);
}

.chat-footer-link a {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: none;
    transition: color 0.2s;
}

.chat-footer-link a:hover {
    color: var(--accent-cyan);
}

/* موبایل */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 110px);
        right: -8px;
    }
}
