/* ===============================
   Background Dots
================================ */
body::before{
    content:"";
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    pointer-events:none;
    z-index:-1;
    background:none;
}

.dots-wrapper{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    overflow:hidden;
    z-index:-1;
    pointer-events:none;
}

.dot{
    position:absolute;
    width:50px;
    height:50px;
    border-radius:50%;
    opacity:0.25;
    filter:blur(3px);
    animation:float 30s ease-in-out infinite;
}

.dot:nth-child(1) { background: #ff8c3c; top: 5%; left: 10%; animation-delay: 0s; }
.dot:nth-child(2) { background: #ff6496; top: 15%; left: 75%; animation-delay: 3s; }
.dot:nth-child(3) { background: #64c8ff; top: 65%; left: 35%; animation-delay: 6s; }
.dot:nth-child(4) { background: #c8ff64; top: 50%; left: 5%; animation-delay: 9s; }
.dot:nth-child(5) { background: #b450ff; top: 70%; left: 85%; animation-delay: 12s; }
.dot:nth-child(6) { background: #ffff64; top: 80%; left: 20%; animation-delay: 15s; }
.dot:nth-child(7) { background: #ffb464; top: 75%; left: 90%; animation-delay: 18s; }
.dot:nth-child(8) { background: #ff8c3c; top: 55%; left: 55%; animation-delay: 1s; }
.dot:nth-child(9) { background: #ff6496; top: 65%; left: 65%; animation-delay: 5s; }
.dot:nth-child(10) { background: #64c8ff; top: 35%; left: 35%; animation-delay: 7s; }
.dot:nth-child(11) { background: #c8ff64; top: 30%; left: 30%; animation-delay: 9s; }
.dot:nth-child(12) { background: #b450ff; top: 40%; left: 40%; animation-delay: 10s; }
.dot:nth-child(13) { background: #ffff64; top: 50%; left: 50%; animation-delay: 11s; }
.dot:nth-child(14) { background: #ffb464; top: 60%; left: 60%; animation-delay: 15s; }

@keyframes float {
  0%   { transform: translateY(0px) translateX(0px); }
  25%  { transform: translateY(-80px) translateX(40px); }
  50%  { transform: translateY(60px) translateX(-30px); }
  75%  { transform: translateY(-40px) translateX(20px); }
  100% { transform: translateY(0px) translateX(0px); }
}


/* ===============================
   Global
================================ */
body{
    margin:0;
    font-family:'Tahoma',sans-serif;
    background:#1e1e1e;
    color:#f1f1f1;
    direction:rtl;
    overflow-x:hidden;
}

container{
    max-width:768px;
    margin:0 auto;
    padding:0 12px;
    display:flex;
    flex-direction:column;
    align-items:stretch;
}

/* ===============================
            HEADER        
================================ */
#chat-header{
    position:sticky;
    top:0;
    z-index:10;
    background:rgba(40,40,40,0.7);
    backdrop-filter:blur(8px);
    border-radius:0 0 16px 16px;
    padding:1px 1px;
    box-shadow:0 4px 10px rgba(0,0,0,0.3);
    max-width:768px;
    margin:0 auto;
    display:flex;
    flex-direction:column-reverse;
}

/* ===============================
   HEADER MENU   1
================================ */
.header-row-1 {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1px 5%; /* درصدی */
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* هر آیکون فاصله نسبی داشته باشد */
.header-row-1 > * {
  flex: 1; /* هر آیکون فضای مساوی بگیرد */
  text-align: center;
  margin: 0 2%; /* فاصله درصدی */
}

.menu-icon img{
    width:25px;
    height:25px;
    flex-shrink:0;
    cursor:pointer;
    transition:transform .2s;
}

.menu-icon img:hover{
    transform:scale(1.3);
}


/* ===============================
   HEADER MENU   3
================================ */
.header-row-3 {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 5px 0;
  border-bottom: -20px solid rgba(255,255,255,0.1);

}





/* ===============================
         آیکن زنگ
================================ */
/* bell */
.bell-icon{
    width:25px;
    height:25px;
    cursor:pointer;
}

/* ===============================
         دکمه خروج
================================ */
#logoutBtn img{
    width:25px;
    height:25px;
    flex-shrink:0;
    cursor:pointer;
    transition:transform .2s;
}

#logoutBtn img:hover{
    transform:scale(1.3);
}




/* کاربران آنلاین */
.online-box {
  background: rgba(0,0,0,0.3);
  padding: 1px 15px;
  border-radius: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f0;
  font-size: 14px;
}

/* انیمیشن چشمک‌زدن */
.online-indicator{
    font-size:1px;
    color:#bbb;
    white-space:nowrap;
    width: 10px;
    height: 10px;
    background-color: #28a745;   /* سبز روشن */
    border-radius: 50%;          /* تبدیل به دایره */
    box-shadow: 0 0 5px #28a745;
    animation: blink 2.2s infinite ease-in-out;
    margin: 2px;
  }

  /* انیمیشن چشمک‌زدن */
  @keyframes blink {
    0%   { opacity: 1; }
    50%  { opacity: 1.2; }
    0% { opacity: 1; }
    
}

#online-users{
    display:flex;
    gap:5px;
    margin-bottom:3px;
    
}

#online-users img{
    width:30px;
    height:30px;
    border-radius:50%;
    border:2px solid #ff8c3c;
    object-fit:cover;
    flex-shrink:0;
    cursor:pointer;
    transition:transform .2s;
}

#online-users img:hover{
    transform:scale(1.2);
}

/* ===============================
   TEXT SLIDER
================================ */
.mini-slider {
  width: 100%;
  height: 17px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

/* حرکت از چپ به راست با چرخش نامحدود */
#slider-text {
    font-size: 13px;
    /* اضافه کردن این خطوط */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

}





/* ===============================
   CHAT BOX
================================ */
/* استایل باکس چت و فرم تایپ برای تطابق با عرض header */
#chat-box,
#chat-form,
#confirm-dialog,
#installButton {
  max-width: 768px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}


#chat-box{
    min-height:750%;
    max-height:77vh;
    overflow-y:auto;
    padding:12px;
    background:rgba(255,255,255,0.05);
    backdrop-filter:blur(6px);
    border-radius:20px;
    margin-top:12px;
    display:flex;
    flex-direction:column;
    scroll-behavior:smooth;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    max-width:768px; /* محدودیت عرض دسکتاپ */
    margin-left:auto;
    margin-right:auto;
}
/* ===============================
   CHAT ROW فاصله حباب چت ها
================================ */
.chat-row{
    display:flex;
    align-items:flex-start;
    gap:1px;
    margin-bottom:5px;
}
/* ===============================
       ایکن کاربران چت
================================ */
.chat-avatar{
    width:35px;
    height:35px;
    border-radius:50%;
    object-fit:cover;
    flex-shrink:0;
}
/* ===============================
       حباب چت کاربر
================================ */
.chat-message{
    background:rgba(255,255,255,0.08);
    border-radius:16px;
    padding:6px 12px 8px;
    max-width:calc(100% - 50px);
    word-wrap:break-word;
}

/* username */
.chat-username{
    font-size:11px;
    color:rgba(255,255,255,0.45);
    margin-bottom:2px;
    max-width:160px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* message text */
.chat-text{
    font-size:14px;
    color:#f1f1f1;
    line-height:1.6;
}

/* own message */
.my-message-row{
    flex-direction:row-reverse;
}

.my-message-row .chat-message{
    background:rgba(255,140,60,0.2);
}

.my-message-row .chat-username{
    color:rgba(255,200,150,0.7);
}

/* ===============================
              MEDIA
================================ */
.chat-message img{
    max-width:70%;
    border-radius:10px;
    margin-top:8px;
    display:block;
    border:1px solid rgba(255,255,255,0.1);
    box-shadow:0 2px 8px rgba(0,0,0,0.2);
}

.chat-message video{
    max-width:100%;
    max-height:250px;
    border-radius:14px;
    object-fit:cover;
    margin-top:8px;
    display:block;
    background:#000;
    box-shadow:0 2px 12px rgba(0,0,0,0.4);
}
/* ===============================
             فرم ارسال پیام
================================ */
#chat-form {
  position: sticky;
  bottom: 1px;
  background:rgba(255,255,255,0.12);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  padding: 10px;
  backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
}

/* ===============================
   FORM
================================ */
#chat-form input[type="text"]{
    flex-grow:1;
    border:none;
    border-radius:10px;
    padding:10px;
    background:rgba(255,255,255,0.1);
    color:#fff;
    outline:none;
    font-size:1em;
    direction:rtl;
}

#chat-form button,
#chat-form label{
    background:rgba(255,255,255,0.12);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
    border:2px solid rgba(50,50,50,0.35);
    border-radius:50%;
    padding:6px;
    transition:background-color .3s;
}

#chat-form button:hover,
#chat-form label:hover{
    background-color:rgba(180,230,30,0.35);
}

/* ===============================
   Dialog     باکس تایید ارسال فایل
================================ */
.glass-dialog{
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    background:rgba(50,50,50,0.7);
    backdrop-filter:blur(10px);
    border-radius:20px;
    padding:20px;
    color:#fff;
    text-align:center;
    z-index:99;
}

.hidden{
    display:none;
}

/* ===============================
   Animations        انیمیشن
================================ */
@keyframes blink{
    0%{opacity:1}
    50%{opacity:.3}
    100%{opacity:1}
}

.blinking{
    animation:blink 1s infinite;
}




/* ===============================
   دکمه پایین (scrollDownBtn)
================================ */
#scrollDownBtn {
  position: fixed;
  bottom: 120px;
  right: 20px;
  
  width: 38px;
  height: 38px;
  
  border-radius: 50%;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* حذف فونت پیش‌فرض چون متن نداریم */
  font-size: 0; 
  
  color: #fff;
  
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  border: 1px solid rgba(255, 255, 255, 0.25);
  
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  
  cursor: pointer;
  
  transition: all 0.25s ease;
  
  z-index: 9000;
  
  opacity: 0;
  pointer-events: none;
  
  /* جلوگیری از انتخاب عکس */
  user-select: none;
}

/* کلاس فعال برای نمایش دکمه */
#scrollDownBtn.show {
  opacity: 1;
  pointer-events: auto;
}

/* حالت هاور */
#scrollDownBtn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.22);
}

/* ===============================
   استایل عکس داخل دکمه
================================ */
#scrollDownBtn img {
  width: 20px;  /* اندازه عرض آیکون */
  height: 20px; /* اندازه ارتفاع آیکون */
  object-fit: contain; /* حفظ نسبت تصویر */
  pointer-events: none; /* جلوگیری از درگ شدن عکس */
  display: block;
}


/* ===============================
           دکمه رادیو
================================ */
#radioIcon {
  width: 25px; /* تنظیم عرض آیکون */
  height: 25px; /* تنظیم ارتفاع آیکون */

  cursor: pointer; /* تغییر شکل نشانگر ماوس به دست */
    transition:transform .2s;
}

#radioIcon img:hover{
    transform:scale(1.3);
}


/* ===============================
         نمایش زمان در چت 
================================ */
.chat-time {
  font-size:10px;
  color:rgba(255,255,255,0.55);
  margin-right:8px; /* یا margin-left مناسب چپ-به-راست */
}


#message-menu button {
  display: block;
  margin: 8px 0;
  padding: 7px 20px;
  border-radius: 12px;
  border: none;
  color: #333;
  background: #ffd67e;
  font-size: 1em;
  cursor: pointer;
  transition: background .2s;
}
#message-menu button:hover {
  background: #ffc053;
}



/* ===============================
          .... بخش دکمه ریپلی
================================ */
.reply-preview {
  background: rgba(225,120,30,0.20);
  border-radius: 7px;
  padding: 4px 11px 3px 7px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #ffd67e;
  border-right: 3px solid #ffa200;
  font-family: 'Tahoma',sans-serif;
  max-width: 98%;
  overflow-x:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  direction:rtl;
}
.reply-preview .reply-username {
  color: #55d7ff;font-size:12px;margin-left:6px;font-weight:bold;
}
.reply-preview .reply-text {
  color:#FFD; font-size:12px;
}


.reply-notif {
  position: fixed;
  top: 22px;
  right: 50%;
  transform: translateX(50%);
  background: #253a32;
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 22px rgba(0,0,0,0.18);
  font-size: 14px;
  padding: 10px 28px;
  z-index: 900;
  text-align: center;
  transition: opacity 0.8s;
  opacity: 0.97;
  font-family:'Tahoma',sans-serif;
}
.reply-notif.f-hide {
  opacity: 0;
  pointer-events: none;
}


#reply-banner {
  display: none;
  margin-right: 15px;
  margin-bottom: 5px;
  padding: 5px 9px 2px 7px;
  background: #393939;
  border-radius: 9px;
  font-family: 'Tahoma',sans-serif;
  font-size: 13px;
  color: #ffd67e;
  max-width: 90%;
  overflow: hidden;
}

#reply-close {
  cursor: pointer;
  color: #f87171;
  background: transparent;
  border: none;
  font-family: 'Tahoma',sans-serif;
  font-size: 15px;
}



/* ===============================
          بخش پاپ آپ
================================ */
.popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s, visibility 0.3s;
}

.popup-overlay.active {
opacity: 1;
visibility: visible;
}

.popup-box {
background: rgba(255,255,255,0.12);
backdrop-filter:blur(8px);
border-radius: 20px;
padding: 30px;
width: 90%;
max-width: 500px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
border: 1px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(15px);
text-align: center;
transform: scale(0.9);
transition: transform 0.3s;
}

.popup-overlay.active .popup-box {
transform: scale(1);
}

.popup-header {
font-size: 24px;
font-weight: bold;
color: #ff7800;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 2px solid rgba(45, 52, 54, 0.1);
}

.popup-content {
margin: 20px 0;
text-align: right;
}

.popup-list {
list-style-type: none;
padding: 0;
}

.popup-list li {
padding: 12px 15px;
margin: 10px 0;
background: rgba(255, 255, 255, 0.6);
border-radius: 12px;
border-right: 4px solid #0984e3;
font-size: 16px;
color: #2d3436;
transition: background 0.3s;
}

.popup-list li:hover {
background: rgba(255, 255, 255, 0.9);
}

.close-btn {
background: red;
border: none;
padding: 12px 30px;
border-radius: 12px;
font-size: 16px;
font-weight: bold;
color: #fff;
cursor: pointer;
margin-top: 20px;
transition: all 0.3s;
}

.close-btn:hover {
background: black;
transform: translateY(-2px);
}