/* ================= Base Styles & Variables ================= */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
    --bg-dark: #050505;
    --panel-bg: #0a0a0a;
    --neon-pink: #ff007f;
    --neon-pink-dim: rgba(255, 0, 127, 0.2);
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: rgba(255, 0, 127, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif !important;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* جلوگیری از اسکرول کل صفحه */
}

/* برای اطمینان از اعمال فونت روی اینپوت‌ها و دکمه‌ها */
input, button, textarea {
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif !important;
}
/* ================= Layout Structure ================= */
.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ================= Right Sidebar ================= */
.right-sidebar {
    width: 280px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    background: var(--bg-dark);
    z-index: 10;
    scrollbar-color: #333333 #0a0a0a;
}

.brand-title {
    text-align: center;
    color: var(--neon-pink);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-pink);
    margin-bottom: 10px;
}

.brand-title span {
    font-size: 1rem;
    font-weight: normal;
}

.brand-image {
    text-align: center;
    margin-bottom: 30px;
}

.brand-image img {
    max-width: 100%;
    filter: drop-shadow(0 0 15px var(--neon-pink-dim));
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 15px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.sidebar-menu a svg {
    margin-left: 15px;
    stroke: var(--text-main);
    transition: stroke 0.3s ease;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    border: 1px solid var(--neon-pink);
    box-shadow: 0 0 15px var(--neon-pink-dim) inset;
    color: var(--neon-pink);
}

.sidebar-menu a:hover svg, .sidebar-menu li.active a svg {
    stroke: var(--neon-pink);
}

/* Sidebar Bottom (Credit & User) */
.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.credit-box {
    width: 100%; /* اطمینان از اینکه باکس کل عرض سایدبار را می‌گیرد */
    display: flex;
    flex-direction: column; /* قرار دادن عنوان و اعتبار زیر هم */
    align-items: flex-start; /* در حالت dir="rtl" این دستور آیتم‌ها را به سمت راست می‌چسباند */
    text-align: right; /* راست‌چین کردن خود متن */
    padding-right: 15px; /* مقداری فاصله از لبه راست سایدبار (اختیاری - بسته به سلیقه تغییر دهید) */
    box-sizing: border-box;
}

.potion-icon {
    width: 40px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px var(--neon-pink));
}

.credit-info {
    text-align: right;
}

.credit-title {
    display: block;
    color: var(--neon-pink);
    font-size: 0.9rem;
}

.credit-amount {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.user-profile-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: rgba(255, 0, 127, 0.05);
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: bold;
    font-size: 1rem;
}

.user-role {
    display: block;
    color: var(--neon-pink);
    font-size: 0.8rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink-dim);
}

/* ================= Center Content ================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

.hub-title {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px;
    width: 300px;
}

.search-bar svg {
    stroke: var(--text-muted);
    margin-left: 10px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.header-avatars {
    display: flex;
    gap: -10px;
}

.header-avatars img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--neon-pink);
    margin-left: -15px;
    box-shadow: 0 0 10px var(--neon-pink-dim);
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.bottom-input-container {
    padding: 30px 40px;
}

.chat-input-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 5px 20px;
    background: rgba(255, 0, 127, 0.02);
    box-shadow: 0 0 15px var(--neon-pink-dim) inset;
    transition: all 0.3s ease;
}

.chat-input-box:focus-within {
    border-color: var(--neon-pink);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.4) inset, 0 0 10px var(--neon-pink-dim);
}

.chat-input-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 15px 0;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
}

.send-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.3s;
}

.send-btn:hover {
    transform: scale(1.1);
}

/* ================= Left Sidebar (Agent Panels) ================= */
.left-sidebar {
    width: 320px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* استایل اسکرول بار برای سایدبار چپ */
.left-sidebar::-webkit-scrollbar { width: 5px; }
.left-sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 5px; }

.agent-panel {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    background: rgba(10, 10, 10, 0.8);
    box-shadow: 0 0 15px var(--neon-pink-dim) inset;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.panel-header h3 {
    font-size: 1rem;
}

.status-online {
    color: var(--neon-pink);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.agent-item {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* آیتم‌ها را از نقطه شروع (راست در حالت rtl) می‌چیند */
    flex-direction: row; /* در حالت rtl، اولین عنصر (عکس) سمت راست قرار می‌گیرد */
    text-align: right; /* متن‌ها را راست‌چین می‌کند */
    gap: 15px; /* فاصله بین عکس و متن - این مقدار را بسته به سلیقه تغییر دهید */
    width: 100%;
}

.agent-item:hover {
    transform: translateX(-5px);
}

.agent-text {
     display: flex;
    flex-direction: column; /* متن‌ها را زیر هم قرار می‌دهد */
    align-items: flex-start; /* متن‌ها را از سمت راست تراز می‌کند */
    text-align: right; /* اطمینان از راست‌چین بودن متون */
}

.agent-text h4 {
    color: var(--neon-pink);
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.agent-text p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.agent-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 10px var(--neon-pink-dim);
}

.neon-outline-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--text-main);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    box-shadow: 0 0 10px var(--neon-pink-dim) inset;
}

.neon-outline-btn:hover {
    background: rgba(255, 0, 127, 0.1);
    box-shadow: 0 0 15px var(--neon-pink) inset, 0 0 10px var(--neon-pink-dim);
}

/* ================= Animations ================= */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 0, 127, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 127, 0); }
}

/* ================= Mobile Menu Overlays & Buttons ================= */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 90;
    display: none;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--neon-pink);
    cursor: pointer;
    padding: 5px;
}

/* ================= Responsive ================= */
@media (max-width: 1200px) {
    .left-sidebar { width: 280px; }
    .right-sidebar { width: 240px; }
}

@media (max-width: 992px) {
    .dashboard-layout {
        position: relative;
    }

    .mobile-toggle-btn {
        display: block;
    }

    /* منوی اصلی در موبایل (می‌رود سمت راست بیرون کادر) */
    .right-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        z-index: 100;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border-color);
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }

    .right-sidebar.active-mobile {
        right: 0;
    }

    /* منوی ایجنت‌ها در موبایل (می‌رود سمت چپ بیرون کادر) */
    .left-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 300px;
        z-index: 100;
        background: var(--bg-dark);
        transition: left 0.3s ease;
        border-right: 1px solid var(--border-color);
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    .left-sidebar.active-mobile {
        left: 0;
    }

    /* تنظیمات هدر برای موبایل */
    .top-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .header-center {
        order: 3;
        width: 100%;
    }

    .search-bar {
        width: 100%;
    }

    .header-right {
        order: 2;
        flex: 1;
        text-align: center;
    }

    .hub-title {
        color: var(--neon-pink);
        font-weight: bold;
    }

    .header-left {
        display: none; /* پنهان کردن آواتارها در موبایل برای فضای بیشتر */
    }

    /* تنظیمات باکس چت برای موبایل */
    .bottom-input-container {
        padding: 15px;
    }
}
