:root { 
    /* تم دارک نئونی و گنگ */
    --main-bg: #0f172a; /* سرمه‌ای بسیار تیره */
    --panel-bg: #1e293b; /* رنگ پنل‌ها و مودال‌ها */
    --border-color: #334155;
    --text-color: #f8fafc;
    --text-muted: #94a3b8; 
    --primary-color: #8b5cf6; /* بنفش نئونی جذاب */
    --vibrant-green: #10b981;
    --vibrant-blue: #3b82f6; 
    --vibrant-red: #f43f5e;
    --vibrant-gold: #fbbf24;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.6);
    --glow: 0 0 15px rgba(139, 92, 246, 0.4); /* افکت درخشش */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    /* بک‌گراند گرادیانت دارک با تم سایبری/رپ */
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    padding: 12px 15px;
    /* هدر با گرادیانت بنفش و درخشش (Glow) */
    background: linear-gradient(90deg, #4c1d95, var(--primary-color));
    color: #ffffff;
    text-align: center;
    box-shadow: var(--glow);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
}

/* =========================================
   اصلاحات سریع برای هماهنگی با تم تیره
   این کدها را بعد از بلاک header قرار بده
========================================= */

/* شیشه‌ای کردن و تیره کردن باکس‌های لیست و چت */
.member-item, .public-group-item, .message {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(4px);
    color: var(--text-color);
}

/* مودال‌ها (پنجره‌های بازشو) روی تم تیره */
.modal-content {
    background: var(--panel-bg) !important;
    color: var(--text-color);
    border: 1px solid #4c1d95;
    box-shadow: var(--glow) !important;
}

/* استایل‌دهی به دکمه‌های تب بالا (هنگام فعال بودن) */
.tab-btn {
    color: var(--text-muted);
}

.tab-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border: none;
    box-shadow: var(--glow);
}

/* اینپوت‌ها و فیلدهای متنی */
input.form-control, textarea.form-control {
    background: #0f172a !important;
    color: #fff !important;
    border: 1px solid var(--border-color) !important;
}

input.form-control:focus, textarea.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3) !important;
}

.header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
}

.container {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - 55px);
    overflow-y: auto;
}

/* استایل پنل‌ها و کارت‌ها */
.status-message, .form-card, .groups-list-container, .group-info-bar, .chat-box, #group-about-container {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.status-message {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

@media (max-width: 768px) {
    .welcome-grid {
        grid-template-columns: 1fr;
    }
}

.form-card {
    padding: 15px;
    height: fit-content;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s, opacity 0.2s;
    font-size: 0.9rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-green { background: var(--vibrant-green) !important; }
.btn-red { background: var(--vibrant-red) !important; }
.btn-blue { background: var(--vibrant-blue) !important; }
.btn-gold { 
    background: var(--vibrant-gold) !important;
    color: #fff !important; 
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
    width: auto;
    border-radius: 8px;
}

.groups-list-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.public-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.public-group-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.public-group-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

#active-group-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.group-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.group-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-info-bar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.group-info-bar h3 { margin: 0; font-size: 1rem; color: var(--text-color); }
.group-info-bar p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* بهینه‌سازی خود دکمه‌ها تا مچاله نشن و عرضشون استاندارد باشه */
.view-members-btn {
    width: auto !important; /* این خط عرض دکمه رو به حالت طبیعی برمی‌گردونه */
    white-space: nowrap !important; 
    flex-shrink: 0 !important; 
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
}

/* =========================================
   اصلاح بخش تب‌ها برای موبایل (بدون اسکرول)
   ========================================= */
.group-nav-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 12px;
    justify-content: space-between;
    /* جلوگیری از اسکرول و تقسیم مساوی فضا بین تب‌ها */
}

.tab-btn {
    flex: 1; /* همه تب‌ها عرض مساوی می‌گیرند */
    min-width: 0;
    display: flex;
    flex-direction: column; /* آیکون بالا، متن پایین */
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 2px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.65rem; /* فونت کوچک برای جا شدن در صفحه */
    font-weight: bold;
    gap: 4px;
    transition: all 0.2s;
    position: relative;
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.tab-content.active {
    display: flex;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    min-height: 250px;
    background: #f8fafc;
}

.message {
    padding: 8px 12px;
    border-radius: 14px;
    max-width: 80%;
    width: fit-content;
    line-height: 1.4;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.message.mine {
    background: var(--primary-color);
    margin-right: auto;
    border-bottom-right-radius: 4px;
    color: white;
}

.message.other {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    margin-left: auto;
    border-bottom-left-radius: 4px;
    color: var(--text-color);
}

.message-sender {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
    font-weight: bold;
}

.message.other .message-sender {
    color: var(--primary-color);
}

.chat-input-area {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    margin: 0;
    border-radius: 20px;
    padding: 12px 15px;
}

.chat-input-area button {
    width: 45px;
    height: 45px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 15px;
}

.modal-content {
    background: var(--panel-bg);
    border: none;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-header h4 { margin: 0; color: var(--text-color); }

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.members-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-info img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.hidden {
    display: none !important;
}

#group-about-text {
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.group-info-bar > div {
    flex-wrap: wrap;
}

/* نشانگر درخواست‌ها */
#req-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: white;
    font-weight: bold;
}
/* ==========================================
   طراحی گیمی و نئونی سر تب‌های اصلی (Tabs)
   ========================================== */

/* ۱. کانتینر یا نوار اصلی تب‌ها */
.tabs-container, .tabs-nav, .tab-header-bar {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
    background: #0b0f19 !important; /* بیس تاریک گیمی */
    padding: 10px 14px !important;
    border-bottom: 2px solid #1e293b !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    
    /* بهینه‌سازی موبایل: اسکرول افقی نرم در صورت زیاد بودن تب‌ها */
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
}

/* مخفی کردن اسکرول‌بار زشت مرورگر در کانتینر تب‌ها */
.tabs-container::-webkit-scrollbar, 
.tabs-nav::-webkit-scrollbar {
    display: none !important;
}

/* ۲. استایل دکمه‌های تب (حالت پیش‌فرض / غیرفعال) */
.tab-btn {
    background: linear-gradient(145deg, #151f32, #1e293b) !important;
    color: #94a3b8 !important; /* متن کمی مات */
    border: 1px solid #334155 !important;
    border-radius: 10px !important;
    padding: 10px 18px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
    flex-shrink: 0 !important; /* جلوگیری از فشرده شدن تب در موبایل */
}

/* آیکون‌های داخل تب */
.tab-btn i {
    font-size: 1rem !important;
    transition: transform 0.2s ease !important;
}

/* افکت لمس یا هاور تب‌های غیرفعال */
.tab-btn:hover, .tab-btn:active {
    color: #f8fafc !important;
    border-color: #475569 !important;
    transform: translateY(-1px) !important;
}


/* ۳. استایل ویژه تب فعال (Active Tab) - تم مایتیک نئون */
.tab-btn.active {
    background: linear-gradient(135deg, #6d28d9 0%, #ec4899 100%) !important; /* گرادیانت بنفش به صورتی نئون */
    color: #ffffff !important;
    border-color: #ff007f !important; /* مرز درخشان */
    font-weight: 900 !important;
    
    /* افکت درخشش نئونی (Glow) */
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.2) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(255, 255, 255, 0.4) !important;
    
    animation: tabPulse 2s infinite alternate !important;
}

/* افکت بزرگ شدن آیکون در تب فعال */
.tab-btn.active i {
    transform: scale(1.15) !important;
    color: #ffffff !important;
}

/* انیمیشن پالس نئونی بسیار ملایم برای تب فعال */
@keyframes tabPulse {
    from {
        box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
        border-color: #ec4899;
    }
    to {
        box-shadow: 0 0 18px rgba(236, 72, 153, 0.65);
        border-color: #ffffff;
    }
}
/* ==========================================
   یک‌ردیفه کردن دکمه‌های مدیریت گنگ
   ========================================== */
.group-info-bar > div:last-child {
    display: flex !important;
    flex-wrap: nowrap !important; /* اجبار به قرارگیری در یک خط */
    gap: 8px !important;
    justify-content: flex-start !important;
    align-items: center !important;
    
    /* تنظیمات موبایل: اگر صفحه خیلی کوچک بود، اجازه اسکرول افقی نرم بده */
    width: 100%; 
    overflow-x: auto !important; 
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px; /* فضای خالی برای جلوگیری از برش سایه دکمه‌ها */
}

/* مخفی کردن نوار اسکرول زشت مرورگر */
.group-info-bar > div:last-child::-webkit-scrollbar {
    display: none !important;
}

/* بهینه‌سازی خود دکمه‌ها تا مچاله یا دوخطی نشن */
.view-members-btn {
    white-space: nowrap !important; /* جلوگیری از شکستن متن دکمه */
    flex-shrink: 0 !important; /* حفظ سایز استاندارد دکمه در موبایل */
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
}
/* ==========================================
   گرافیک گیمی دکمه‌های مدیریت گنگ
   ========================================== */

/* استایل پایه و مشترک همه دکمه‌های این بخش */
.view-members-btn {
    width: auto !important; 
    white-space: nowrap !important; 
    flex-shrink: 0 !important; 
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4) !important;
}

/* افکت فشرده شدن موقع کلیک */
.view-members-btn:active {
    transform: scale(0.92) !important;
}

/* ۱. دکمه اعضای ما (تم آبی سایبری) */
#open-my-members-btn {
    background: linear-gradient(135deg, #1e293b, #0369a1) !important;
    color: #ffffff !important;
    border: 1px solid #0ea5e9 !important;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.3) !important;
}
#open-my-members-btn i { color: #7dd3fc !important; }

/* ۲. دکمه ویرایش گنگ (تم نارنجی/طلایی مایتیک) */
#edit-group-btn {
    background: linear-gradient(135deg, #78350f, #d97706) !important;
    color: #ffffff !important;
    border: 1px solid #f59e0b !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3) !important;
    animation: none !important; /* حذف انیمیشن‌های مزاحم قبلی */
}
#edit-group-btn i { color: #fde68a !important; }

/* ۳. دکمه حذف گنگ (تم قرمز لجندری / خطر) */
#delete-group-btn {
    background: linear-gradient(135deg, #4c0519, #be123c) !important;
    color: #ffffff !important;
    border: 1px solid #f43f5e !important;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.3) !important;
}
#delete-group-btn i { color: #fecdd3 !important; }
/* شخصی‌سازی باکس اسکرول اعلان‌های جنگ گنگ */
#gang-announcements-list::-webkit-scrollbar {
    width: 4px;
}
#gang-announcements-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
#gang-announcements-list b {
    color: var(--vibrant-gold);
}
/* کانتینر اصلی اعلان‌ها برای اسکرول افقی روان */
#gang-announcements-list {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 5px;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* زیباسازی اسکرول‌بار روی دسکتاپ و موبایل */
#gang-announcements-list::-webkit-scrollbar {
    height: 4px;
}
#gang-announcements-list::-webkit-scrollbar-thumb {
    background: var(--primary-color, #8b5cf6);
    border-radius: 10px;
}

/* استایل هر کارت اعلان انفرادی */
.gang-alert-item {
    flex: 0 0 auto; /* جلوگیری از مچاله شدن باکس‌ها */
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.85);
    border-bottom: none !important;
    color: #f8fafc;
    font-size: 0.82rem;
    box-shadow: var(--shadow-sm);
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
/* =========================================
   استایل‌های نوار اطلاعات مینیمال بالای صفحه
========================================= */
.mini-top-bar {
    display: flex;
    justify-content: flex-end; /* کپسول‌ها را می‌برد سمت چپ. برای راست‌چین شدن: flex-start */
    gap: 8px;
    padding: 8px 15px;
    /* یک بک‌گراند نامرئی و شیشه‌ای که جای صفحه را تنگ نکند */
    background: transparent; 
    z-index: 50;
}

.mini-currency-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem; /* فونت ریز و نقلی */
    font-weight: 900;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* رنگ‌بندی کپسول‌ها هماهنگ با تم دارک نئونی */
.spray-badge { background: linear-gradient(135deg, #e11d48, #be123c); }
.rapcoin-badge { background: linear-gradient(135deg, #d97706, #b45309); }

/* جبران حذف هدر بزرگ و دادن فضای بیشتر به لیست‌ها و چت‌ها */
.container {
    height: calc(100vh - 35px) !important;
}
/* =========================================
   فشرده‌سازی فواصل بالای صفحه برای موبایل
========================================= */

/* کاهش فضای خالی بالای کانتینر اصلی */
.container {
    padding-top: 5px !important; 
}

/* حذف حاشیه اضافه باکس اعلان و فشرده‌تر کردن آن */
#gang-battle-announcements {
    margin-top: 0 !important; /* خنثی کردن 20px کلاس status-message */
    margin-bottom: 10px !important; /* فاصله بهینه با تب‌های پایینی */
    padding: 10px 12px !important; /* کوچک‌تر کردن فضای داخلی باکس */
}

/* جمع‌وجور کردن نوار اطلاعات خود گنگ (عکس و اسم گنگ) */
.group-info-bar {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding: 8px 12px !important;
}

/* در صورت نیاز: کمی فشرده‌تر کردن متن داخل باکس اعلان */
#gang-battle-announcements h4 {
    margin-bottom: 6px !important;
    font-size: 0.9rem !important;
}
/* ==========================================
   استایل‌های سیستم لول گنگ
   ========================================== */
.gang-header-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.gang-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.gang-avatar-wrapper img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 12px !important;
    border: 2px solid var(--vibrant-gold);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.gang-lvl-badge {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    border: 1px solid var(--vibrant-gold);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
}

.gang-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gang-info-content h3 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    color: var(--vibrant-gold) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gang-info-content p {
    margin: 0 !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* کانتینر اصلی نوار و متن */
.gang-xp-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    width: 100%;
}

/* پس‌زمینه خالی نوار */
.gang-xp-bar {
    flex: 1; /* باعث میشه کل فضای خالی رو پر کنه */
    height: 8px; /* ضخامت نوار */
    background: #1e293b; /* رنگ پس‌زمینه تیره */
    border-radius: 4px;
    border: 1px solid #334155;
    overflow: hidden;
    position: relative;
}

/* قسمت رنگی و پرشونده نوار */
.gang-xp-fill {
    height: 100%;
    /* یک گرادیان رنگی جذاب گیمینگ */
    background: linear-gradient(90deg, #8b5cf6, #ec4899); 
    border-radius: 4px;
    /* انیمیشن نرم برای پر شدن */
    transition: width 0.5s ease-out; 
}

/* استایل عددهای XP */
.gang-xp-text {
    font-size: 0.7rem;
    font-weight: bold;
    color: #cbd5e1;
    font-family: monospace;
    white-space: nowrap;
}
/* کانتینر اصلی نوار و متن */
.gang-xp-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between; /* فاصله‌گذاری بهتر */
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

/* پس‌زمینه خالی نوار (بخش خاکستری) */
.gang-xp-bar {
    flex-grow: 1;
    min-width: 100px; /* محکم‌کاری: نوار هرگز از این کوچیک‌تر نمیشه */
    height: 10px; /* ضخامت نوار رو کمی بیشتر کردم تا واضح‌تر بشه */
    background: #1e293b;
    border-radius: 5px;
    border: 1px solid #334155;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5); /* سایه داخلی برای عمق دادن */
}

/* قسمت رنگی و پرشونده نوار */
.gang-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #ec4899); 
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); /* انیمیشن نرم‌تر */
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.5); /* درخشش نئونی گیمینگ */
}

/* استایل عددهای XP */
.gang-xp-text {
    font-size: 0.75rem;
    font-weight: 900;
    color: #f8fafc;
    font-family: 'Vazirmatn', monospace;
    white-space: nowrap;
    min-width: 65px; /* جلوگیری از پرش نوار وقتی عددها عوض میشن */
    text-align: left;
}
/* مخفی کردن متن توضیحات فقط در کادر هدر گنگ */
#group-header-info p,
#group-header-info div p {
    display: none !important;
}
/* افکت درخشش و تپش برای آیکون‌های مناطق خاص (مثل مرکز شهر) */
.district-block i.fa-industry {
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.5));
    animation: pulseCenter 2s infinite;
}

.district-block i.fa-building {
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.5));
    animation: pulseCenter 2s infinite;
}

.district-block i.fa-briefcase {
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.5));
    animation: pulseCenter 2s infinite;
}
:root { 
    /* تم گیمینگ نئونی با الهام از بلک‌مارکت */
    --main-bg: #050510; /* تاریک‌تر برای درخشش بیشتر رنگ‌ها */
    --panel-bg: rgba(20, 25, 45, 0.70); /* حالت شیشه‌ای و مدرن */
    --border-color: rgba(59, 130, 246, 0.4); /* حاشیه آبی ملایم سایبری */
    --text-color: #f8fafc;
    --text-muted: #94a3b8; 
    --primary-color: #ec4899; /* صورتی/بنفش نئونی پرانرژی */
    --vibrant-green: #10b981;
    --vibrant-blue: #0ea5e9; 
    --vibrant-red: #f43f5e;
    --vibrant-gold: #fbbf24;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.7);
    --glow: 0 0 15px rgba(236, 72, 153, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.1); 
}

body {
    font-family: 'Vazirmatn', sans-serif;
    /* بک‌گراند گیمینگ خفن: ترکیب تاریکی عمیق با هاله نئونی از بالا */
    background: radial-gradient(circle at 50% 0%, #301b4d 0%, #050510 70%);
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* تغییر هدر به همون تم طلایی/فروشگاهی جذاب */
.header {
    padding: 12px 15px;
    background: linear-gradient(90deg, #78350f, #d97706);
    color: #ffffff;
    text-align: center;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    border-bottom: 2px solid #fde68a;
    z-index: 10;
}

/* شیشه‌ای کردن و زیباتر کردن پنل‌ها و کارت‌ها */
.status-message, .form-card, .groups-list-container, .group-info-bar, .chat-box, #group-about-container {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px); /* افکت بلور برای حس اپلیکیشن‌های گیمینگ */
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* یه افکت نور (نوار طلایی) بالا سر پنل‌های اصلی برای حالت رقابتی */
.form-card::before, .groups-list-container::before, #group-about-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--vibrant-gold), transparent);
}

/* درخشان کردن اینپوت‌ها تو حالت فوکوس */
input.form-control:focus, textarea.form-control:focus {
    border-color: var(--vibrant-gold) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3) !important;
    background: rgba(15, 23, 42, 0.9) !important;
}
/* ==========================================
   تنظیمات هدر گنگ (بج ها و دکمه های مدیریت)
   ========================================== */
.top-badges-and-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.badges-group, .actions-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* کوچک‌تر کردن دکمه‌های مدیریتی برای جا شدن در کنار بج‌ها */
.actions-group .view-members-btn {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
}

.actions-group #delete-group-btn {
    padding: 6px 8px !important; /* فقط آیکون سطل زباله */
}

/* ==========================================
   نویگیشن بار پایین صفحه (Bottom Gaming Nav)
   ========================================== */
.bottom-gaming-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: linear-gradient(0deg, #050510 0%, #111827 100%);
    border-top: 1px solid #334155;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 10px;
}

/* 🔴 جبران فضای منوی پایین در کانتینر اصلی 🔴 */
.container {
    height: calc(100vh - 100px) !important; /* کم کردن فضای بالا و پایین */
    margin-bottom: 65px; /* جلوگیری از رفتن محتوا زیر منو */
}

/* استایل دکمه‌های چپ و راست (اعضا و خانه) */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30%;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
    transition: transform 0.2s;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 700;
}

.nav-item:hover, .nav-item:active {
    color: var(--vibrant-blue);
}

.nav-item:active i {
    transform: scale(0.9);
}

/* استایل دکمه مرکزی (منطقه گنگ) */
.center-action {
    position: relative;
    top: -20px; /* بیرون‌زدگی از کادر برای نمای بهتر */
    color: #fff !important;
    width: auto;
}

.action-ring {
    background: linear-gradient(135deg, #9f1239, #f43f5e);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #050510;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.3);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 5px;
}

.center-action:active .action-ring {
    transform: scale(0.85);
    box-shadow: 0 0 5px rgba(244, 63, 94, 0.8);
}

.center-action i {
    font-size: 1.8rem;
    margin-bottom: 0;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

.center-action span {
    color: var(--vibrant-red);
    text-shadow: 0 0 8px rgba(244, 63, 94, 0.3);
    font-size: 0.75rem;
}
/* ۱. جلوگیری از مچاله شدن کادر پروفایل و تب‌ها (حفظ سایز اصلی) */
.group-info-bar, .group-nav-tabs {
    flex-shrink: 0 !important;
}

/* ۲. آزادسازی ارتفاع بخش گروه برای اسکرول یکپارچه */
#active-group-section {
    display: flex;
    flex-direction: column;
    height: max-content !important; /* اجازه می‌دهیم به اندازه کل محتوا کش بیاید */
    overflow: visible !important; /* محدودیت اسکرول داخلی را برمی‌داریم */
}

/* ۳. حذف اسکرول داخلی از تب‌ها و انتقال آن به صفحه اصلی */
.tab-content {
    display: none;
    flex-direction: column;
    height: max-content !important;
    overflow: visible !important;
    padding-bottom: 20px; /* فضای خالی پایین صفحه برای راحتی */
}

.tab-content.active {
    display: flex;
}

/* ۴. اگر باکس چت داخلی هم اسکرول مجزا دارد، آن را یکپارچه می‌کنیم */
.chat-box {
    overflow-y: visible !important; 
    height: auto !important;
    flex: none !important;
}
/* ۱. تعریف کدهای رنگی منحصربه‌فرد برای هر تب (بر اساس هارمونی تم دارک) */
.tab-btn:nth-child(1) { --tab-r: 59;  --tab-g: 130; --tab-b: 246; } /* تب ۱: گپ (آبی سایبری) */
.tab-btn:nth-child(2) { --tab-r: 16;  --tab-g: 185; --tab-b: 129; } /* تب ۲: گروه‌ها (سبز زمردی) */
.tab-btn:nth-child(3) { --tab-r: 245; --tab-g: 158; --tab-b: 11;  } /* تب ۳: فروشگاه (طلایی) */
.tab-btn:nth-child(4) { --tab-r: 139; --tab-g: 92;  --tab-b: 246; } /* تب ۴: متحدین (بنفش) */
.tab-btn:nth-child(5) { --tab-r: 244; --tab-g: 63;  --tab-b: 94;  } /* تب ۵: درخواست‌ها (قرمز متمایل به صورتی) */
.tab-btn:nth-child(6) { --tab-r: 6;   --tab-g: 182; --tab-b: 212; } /* تب ۶: درباره (فیروزه‌ای) */

/* ۲. استایل حالت عادی و غیرفعال تب‌ها (کمرنگ و هارمونیک) */
.tab-btn {
    /* ساخت رنگ اصلی با متغیرها */
    --tab-color: rgb(var(--tab-r), var(--tab-g), var(--tab-b));
    
    /* بک‌گراند بسیار کمرنگ (۱۰٪ رنگ اصلی تب) */
    background: rgba(var(--tab-r), var(--tab-g), var(--tab-b), 0.1) !important;
    /* حاشیه مات */
    border: 1px solid rgba(var(--tab-r), var(--tab-g), var(--tab-b), 0.2) !important;
    /* رنگ آیکون و متن کمی تیره شده اما رنگی */
    color: rgba(var(--tab-r), var(--tab-g), var(--tab-b), 0.7) !important;
    
    opacity: 0.75 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ۳. افکت رفتن روی تب‌ها (Hover - روشن شدن ملایم) */
.tab-btn:hover {
    opacity: 1 !important;
    background: rgba(var(--tab-r), var(--tab-g), var(--tab-b), 0.25) !important;
    border-color: var(--tab-color) !important;
    color: var(--tab-color) !important;
    transform: translateY(-2px) !important;
}

/* ۴. حالت فعال تب (شاد، پررنگ و نئونی) */
.tab-btn.active {
    opacity: 1 !important;
    /* بک‌گراند کاملاً به رنگ شاد و اصلی تب درمی‌آید */
    background: var(--tab-color) !important;
    
    /* آیکون و متن سفید می‌شوند تا خوانایی عالی داشته باشند */
    color: #ffffff !important;
    border-color: #ffffff !important;
    font-weight: 900 !important;
    
    /* درخشش (Glow) با استفاده از رنگ خود تب */
    box-shadow: 0 0 15px rgba(var(--tab-r), var(--tab-g), var(--tab-b), 0.6), 
                inset 0 0 5px rgba(255, 255, 255, 0.3) !important;
    
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    transform: translateY(-2px) !important;
}

/* بزرگ‌تر شدن و خودنمایی آیکون در تب فعال */
.tab-btn.active i {
    transform: scale(1.15) !important;
    color: #ffffff !important;
    transition: transform 0.2s ease !important;
}
