@font-face {
    font-family: "YekanBakh";
    src: url("assets/fonts/YekanBakhFaNum-VF.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}


body{
margin:0;
font-family:tahoma;
background:#e7ebf0;
height:100vh;
/*display:flex;*/
font-family: "YekanBakh", tahoma, sans-serif;
}


html, body {
    touch-action: manipulation; 
}

.sidebar{
width:280px;
background:white;
border-right:1px solid #ddd;
overflow-y:auto;
}

.channel{
padding:12px;
border-bottom:1px solid #eee;
cursor:pointer;
display:flex;
justify-content:space-between;
align-items:center;
}

.channel:hover{
background:#f5f5f5;
}

.badge{
background:#1e88e5;
color:white;
border-radius:20px;
padding:3px 8px;
font-size:12px;
}

.chat-container{
flex:1;
display:flex;
flex-direction:column;
height:100vh;
}

.messages{
flex:1;
overflow-y:auto;
/*padding:20px;*/
display:flex;
flex-direction:column;
/*margin-bottom: 50px;*/
    padding-bottom: 100px; 
}

.msg{
display:flex;
flex-direction:row;
margin:6px 0;
max-width:60%;
position:relative;
}

.msg.me{
align-self:flex-start;
}

.msg.other{
align-self:flex-end;
}

.bubble{
padding:10px 14px;
border-radius:14px;
background:white;
box-shadow:0 1px 2px rgba(0,0,0,0.1);
width:fit-content;
/*max-width:100%;*/
word-break:break-word;
}

.msg.me .bubble{
background:#2a9df4;
color:white;
}

.time{
font-size:11px;
opacity:0.6;
margin-top:3px;
}

.msg.me .time{
text-align:right;
}

.msg.other .time{
text-align:left;
}

.date-divider{
align-self:center;
background:#d9dde3;
color:#444;
font-size:12px;
padding:4px 12px;
border-radius:10px;
margin:15px 0;
}

#floatingDate{
position:fixed;
top:70px;
left:50%;
transform:translateX(-50%);
background:#333;
color:white;
padding:4px 10px;
border-radius:10px;
font-size:12px;
opacity:0.9;
pointer-events:none;
}

.send-box{
display:flex;
padding:10px;
background:white;
border-top:1px solid #ddd;
gap:8px;

   position: fixed;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    padding-bottom: env(safe-area-inset-bottom);
    /*background: #fff;*/
    z-index: 9999;

}

.send-box input[type=text], .send-box textarea{
flex:1;
padding:10px;
border-radius:20px;
border:1px solid #ccc;
outline:none;
}

.send-box button{
background:#2a9df4;
border:none;
color:white;
padding:8px 16px;
border-radius:20px;
cursor:pointer;
}

.send-box button:hover{
background:#1b8ae0;
}

.bubble img{
max-width:260px;
border-radius:10px;
display:block;
}

.bubble video{
max-width:260px;
border-radius:10px;
}

.bubble audio{
width:250px;
}


.date-divider{
text-align:center;
margin:20px 0;
color:#777;
font-size:12px;
}


.date-divider{
    text-align:center;
    margin:15px 0;
    font-size:13px;
    color:#888;
    position:relative;
}

.date-divider::before,
.date-divider::after{
    content:'';
    position:absolute;
    top:50%;
    width:40%;
    height:1px;
  
}

.date-divider::before{
    right:55%;
}

.date-divider::after{
    left:55%;
}


#floatingDate{
    position:absolute;
    top:10px;
    left:50%;
    transform:translateX(-50%);
    background:#e5e5ea;
    color:#333;
    padding:4px 12px;
    border-radius:10px;
    font-size:12px;
    z-index:50;
    opacity:0;
    transition:opacity .2s;
}

.chat-container{
    position:relative;
}

/*Responsive*/

body{
margin:0;
font-family:tahoma;
background:#f2f2f2;
}

.app{
display:flex;
height:100vh;
overflow:hidden;
}

/* sidebar */

.sidebar{
width:320px;
background:#fff;
border-left:1px solid #ddd;
display:flex;
flex-direction:column;
}

.sidebar-header{
padding:15px;
font-weight:bold;
border-bottom:1px solid #eee;
}

.channels{
overflow:auto;
flex:1;
    padding-bottom: 100px;
}

.channel{
padding:12px;
display:flex;
justify-content:space-between;
cursor:pointer;
border-bottom:1px solid #f1f1f1;
}

.channel:hover{
background:#f6f6f6;
}

.channel-name{
font-weight:bold;
margin-top:10px;
}

.channel-last{
font-size:12px;
color:#777;
}

.badge{
background:#2ecc71;
color:white;
padding:3px 8px;
border-radius:10px;
font-size:12px;
}

/* chat */

.chat-container{
flex:1;
display:flex;
flex-direction:column;
}

.chat-header{
    height: 55px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: flex-start;
    padding: 0 15px;
    align-content: flex-start;
    flex-direction: column;
    flex-wrap: nowrap;
    padding-top: 15px;
    justify-content: center;
}

.chat-title{
font-weight:bold;
}

.back-btn{
display:none;
margin-left:10px;
}

.messages{
flex:1;
overflow:auto;
padding:15px;
}

.send-box{
display:flex;
gap:8px;
padding:10px;
background:white;
border-top:1px solid #ddd;
}

.send-box input[type=text]{
flex:1;
padding:10px;
border:1px solid #ccc;
border-radius:8px;
}

/* موبایل */

@media (max-width:768px){

.sidebar{
position:absolute;
width:100%;
height:100%;
z-index:10;
}

.sidebar.hide{
display:none;
}

    .back-btn {
        display: block;
        padding: 0;
        margin-top: -5px;
        position: absolute;
        left: 12px;
    }
 
}



@media (max-width:768px){

.app{
position:relative;
}

.sidebar{
width:100%;
height:100%;
position:absolute;
right:0;
top:0;
background:white;
z-index:5;
}

.chat-container{
width:100%;
height:100%;
position:absolute;
right:100%;
top:0;
background:white;
transition:0.3s;
}

/* وقتی چت باز شود */

.app.chat-open .chat-container{
right:0;
}

.app.chat-open .sidebar{
right:-100%;
}

}



/* آواتار کنار پیام */
.msg { display: flex; align-items: flex-end; margin-bottom: 10px; }
/*.msg.me { flex-direction: row-reverse; }*/
.msg-avatar { width: 35px; height: 35px; border-radius: 50%; margin: 0 8px; object-fit: cover; }

/* هدر سایدبار */
.sidebar-user-header { display: flex; align-items: center; padding: 15px; background: #242f3d; cursor: pointer; border-bottom: 1px solid #1c242f; }
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; margin-left: 10px; }

/* مودال تنظیمات */
.modal { display:none; position: fixed; z-index: 1000; left:0; top:0; width:100%; height:100%; background: rgba(0,0,0,0.8); }
.modal-content { background: #17212b; width: 300px; margin: 100px auto; padding: 20px; border-radius: 15px; color: white; text-align: center; }
.modal-content img { width: 100px; height: 100px; border-radius: 50%; cursor: pointer; margin-bottom: 15px; }
.modal-content input, .modal-content textarea { width: 100%; background: #242f3d; border: none; color: white; padding: 10px; margin-bottom: 10px; border-radius: 5px; }


#searchChat{
width:100%;
margin-top:10px;
padding:8px;
border:1px solid #ddd;
border-radius:8px;
font-size:14px;
}

.member-item img{
        width: 50px;
    height: 50px;
}


.member-item{
        display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

.member-item .username{
        margin-top: 10px;
    margin-right: 10px;
}

.sidebar-avatar{
    margin-left: 10px;
    width: 50px;
    height: 50px;
    border-radius: 180px;
        float: right;
}

#myname{
    
        color: white ;
        font-size:13px;
}


.channel-info{
    width:90%;
}




/* ===== Base ===== */
*{box-sizing:border-box}
body{
margin:0;
font-family:tahoma;
height:100vh;
background:
radial-gradient(circle at 20% 20%, #e8f4ff 0%, transparent 40%),
radial-gradient(circle at 80% 30%, #f0fbff 0%, transparent 45%),
linear-gradient(180deg,#f7fbff,#eef6ff);
overflow:hidden;
}

.app{
display:flex;
height:100vh;
}

/* ===== Glass Card ===== */

.sidebar,
.chat-container,
.modal-content{
background:rgba(255,255,255,0.45);
backdrop-filter:blur(18px) saturate(160%);
-webkit-backdrop-filter:blur(18px) saturate(160%);
border:1px solid rgba(255,255,255,0.6);
box-shadow:
0 8px 30px rgba(0,0,0,0.08),
0 0 25px rgba(0,150,255,0.05);
}

/* subtle animated neon border */

.sidebar::before,
.chat-container::before{
content:"";
position:absolute;
inset:0;
border-radius:14px;
pointer-events:none;
/*background:linear-gradient(120deg,*/
/*transparent,*/
/*rgba(0,170,255,0.3),*/
/*transparent);*/
opacity:.35;
/*animation:neonMove 8s linear infinite;*/
}

@keyframes neonMove{
0%{transform:translateX(-100%)}
100%{transform:translateX(100%)}
}

/* ===== Sidebar ===== */

.sidebar{
width:320px;
display:flex;
flex-direction:column;
position:relative;
}

.sidebar-header{
padding:18px;
font-weight:bold;
border-bottom:1px solid rgba(255,255,255,0.5);
}

#searchChat{
width:100%;
margin-top:10px;
padding:10px;
border-radius:12px;
border:1px solid rgba(200,220,255,0.7);
background:rgba(255,255,255,0.6);
outline:none;
}

/* ===== Channel list ===== */

.channels{
overflow:auto;
flex:1;
}

.channel{
padding:12px;
display:flex;
justify-content:space-between;
align-items:center;
cursor:pointer;
border-bottom:1px solid rgba(255,255,255,0.5);
transition:all .2s;
}

.channel:hover{
background:rgba(255,255,255,0.6);
box-shadow:0 0 12px rgba(0,170,255,0.15);
}

.channel-info{
width:90%;
}

.channel-name{
font-weight:bold;
color:#1a2a3a;
}

.channel-last{
font-size:12px;
color:#5f6e7f;
margin-top:3px;
}

/* avatars */

.sidebar-avatar{
margin-left:10px;
width:50px;
height:50px;
border-radius:50%;
object-fit:cover;
box-shadow:
0 0 10px rgba(0,160,255,0.25),
0 2px 8px rgba(0,0,0,0.15);
}

/* badge */

.badge{
background:linear-gradient(135deg,#00b7ff,#006eff);
color:white;
padding:3px 8px;
border-radius:20px;
font-size:12px;
box-shadow:0 0 8px rgba(0,160,255,0.6);
}

/* ===== Chat ===== */

.chat-container{
flex:1;
display:flex;
flex-direction:column;
position:relative;
background-image:url('assets/img/pattern.png');
}

/* header */

.chat-header{
height:60px;
display:flex;
flex-direction:column;
padding:10px 18px;
border-bottom:1px solid rgba(255,255,255,0.6);
}

.chat-title{
font-weight:bold;
color:#1b2b3a;
}

/* messages */

.messages{
flex:1;
overflow:auto;
/*padding:20px;*/
display:flex;
flex-direction:column;
margin-bottom: 50px;
    padding-bottom: 80px; 
}

/* message layout */

.msg{
display:flex;
margin:8px 0;
max-width:65%;
}

.msg.me{
align-self:flex-start;
}

.msg.other{
align-self:flex-end;
}

/* bubble glass */

.bubble{
padding:10px 14px;
border-radius:16px;
background:rgba(255,255,255,0.65);
backdrop-filter:blur(8px);
box-shadow:
0 4px 12px rgba(0,0,0,0.1),
0 0 8px rgba(0,160,255,0.15);
word-break:break-word;
}

/* my message */

.msg.me .bubble{
background:linear-gradient(140deg,#5ec8ff,#009dff);
color:white;
box-shadow:
0 4px 14px rgba(0,120,255,0.35),
0 0 12px rgba(0,160,255,0.5);
}

/* time */

.time{
font-size:11px;
opacity:0.7;
margin-top:4px;
}

/* ===== Send box ===== */

.send-box{
display:flex;
gap:8px;
padding:12px;
border-top:1px solid rgba(255,255,255,0.6);
}

.send-box textarea{
flex:1;
padding:10px;
border-radius:16px;
border:1px solid rgba(200,220,255,0.6);
background:rgba(255,255,255,0.7);
outline:none;
resize:none;
}

.send-box button{
border:none;
background:linear-gradient(135deg,#00b7ff,#006eff);
color:white;
padding:8px 16px;
border-radius:16px;
cursor:pointer;
box-shadow:none;
transition:transform .15s;
}

.send-box button:hover{
transform:translateY(-2px);
}

/* ===== Date divider ===== */

.date-divider{
align-self:center;
background:rgba(255,255,255,0.6);
padding:4px 12px;
border-radius:12px;
font-size:12px;
color:#5f6e7f;
box-shadow:0 0 6px rgba(0,160,255,0.2);
margin:18px 0;
}

/* ===== Floating date ===== */

#floatingDate{
position:absolute;
top:10px;
left:50%;
transform:translateX(-50%);
background:rgba(255,255,255,0.75);
padding:4px 12px;
border-radius:10px;
font-size:12px;
box-shadow:0 0 10px rgba(0,150,255,0.25);
opacity:0;
transition:opacity .2s;
}

/* ===== Sidebar user header ===== */

.sidebar-user-header{
display:flex;
align-items:center;
padding:15px;
background:rgba(255,255,255,0.3);
border-bottom:1px solid rgba(255,255,255,0.6);
cursor:pointer;
}

.avatar-sm{
width:40px;
height:40px;
border-radius:50%;
margin-left:10px;
box-shadow:0 0 10px rgba(0,160,255,0.3);
}

/* ===== Modal ===== */

.modal{
display:none;
position:fixed;
z-index:1000;
left:0;
top:0;
width:100%;
height:100%;
background:rgba(20,30,50,0.25);
backdrop-filter:blur(6px);
}

.modal-content{
width:320px;
margin:120px auto;
padding:20px;
border-radius:16px;
text-align:center;
}

.modal-content input,
.modal-content textarea{
width:100%;
padding:10px;
border-radius:10px;
border:1px solid rgba(200,220,255,0.6);
background:rgba(255,255,255,0.7);
margin-bottom:10px;
}

/* ===== Members ===== */

.member-item{
display:flex;
align-items:center;
margin:8px 0;
}

.member-item img{
width:50px;
height:50px;
border-radius:50%;
margin-left:10px;
}

/* ===== Responsive ===== */

@media (max-width:768px){

.sidebar{
position:absolute;
width:100%;
height:100%;
z-index:5;
}

.chat-container{
position:absolute;
width:100%;
height:100%;
right:100%;
transition:.3s;
}

.app.chat-open .chat-container{
    height: 100dvh;
 right:0;
 
}

.app.chat-open .sidebar{
right:-100%;
}

}



/* neon edge moving border */
.glass-neon{
position:relative;
overflow:hidden;
}

.glass-neon::before{
content:"";
position:absolute;
inset:0;
border-radius:16px;
padding:2px;
background:linear-gradient(130deg,
rgba(0,180,255,0.0) 0%,
rgba(0,200,255,0.7) 50%,
rgba(0,180,255,0.0) 100%);
mask:
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);
mask-composite:exclude;
animation:neonFlow 6s linear infinite;
}

@keyframes neonFlow{
0%{transform:translateX(-100%)}
100%{transform:translateX(100%)}
}

/* apply to panels */
.sidebar,
.chat-container,
.modal-content{
border-radius:18px;
}

.sidebar,
.chat-container{
overflow:hidden;
}

.sidebar.glow,
.chat-container.glow{
position:relative;
}

.sidebar{
    border-radius:0;
}


.chat-open .chat-container{
animation:chatSlideIn .45s cubic-bezier(.25,.8,.25,1);
}

@keyframes chatSlideIn{
0%{
opacity:0;
transform:translateX(40px) scale(.97);
filter:blur(4px);
}
60%{
opacity:1;
transform:translateX(0) scale(1.01);
filter:blur(0);
}
100%{
transform:scale(1);
}
}




.channel{
transition:.25s;
}

.channel:hover{
background:rgba(255,255,255,0.7);
transform:translateX(-4px);
box-shadow:
0 2px 12px rgba(0,180,255,0.25),
inset 0 0 10px rgba(0,180,255,0.2);
}



/* ====== Neon Glass Button ====== */

button{
padding:10px 22px;
border:none;
border-radius:14px;
font-size:15px;
font-weight:bold;
cursor:pointer;

background:rgba(255,255,255,0.55);
backdrop-filter:blur(10px) saturate(160%);
-webkit-backdrop-filter:blur(10px) saturate(160%);

border:1px solid rgba(255,255,255,0.8);

color:#0c2c45;
transition:all .22s cubic-bezier(.25,.8,.25,1);
}

/* Hover: 3D Lift + Strong Neon */
button:hover{
transform:translateY(-3px) scale(1.03);
background:rgb(2 131 207 / 70%);

/*box-shadow:*/
/*0 6px 18px rgba(0,150,255,0.32),*/
/*0 0 18px rgba(0,170,255,0.45),*/
/*inset 0 0 10px rgba(255,255,255,0.6);*/
}

/* Active: pressed like iOS */
button:active{
transform:scale(.94);
box-shadow:
0 0 12px rgba(0,150,255,0.45) inset,
0 0 20px rgba(0,170,255,0.5);
}

/* Optional: If you want Blue variant */
.button-blue{
background:linear-gradient(135deg,#00c2ff,#0075ff);
color:white;
border:none;
box-shadow:
0 4px 16px rgba(0,150,255,0.45),
0 0 16px rgba(0,160,255,0.7);
}

.button-blue:hover{
transform:translateY(-3px) scale(1.04);
background:linear-gradient(135deg,#00d0ff,#008cff);
}

.editName,.editBio{
    color:black !important;
}

.AddChannel{
        width: 17px;
    position: absolute;
    left: 28px;
    top: 30px;
    background-color: #d7d7d7;
    padding: 0px 2px 1px 8px;
    border-radius: 5px;
    cursor: pointer;

}




.msg.other{
        flex-direction: row-reverse;
}

.send-box{
    display:none;
}
.send-box.show{
       display: flex;
    position: fixed;
    bottom: 0px;
    z-index: 100;
    width: 100%;
    right: 0;
    left: 0;
}


/*.bubble {*/
/*    position: relative;*/
/*    padding: 10px 14px;*/
/*    margin: 6px 0;*/
/*    background: rgba(255, 255, 255, 0.09);*/
/*    backdrop-filter: blur(12px);*/
/*    border-radius: 12px;*/
/*    color: #fff;*/
/*    font-size: 14px;*/
/*    line-height: 1.4;*/
/*    width: fit-content;*/
/*    max-width: 80%;*/
/*    transition: background 0.2s ease;*/
/*}*/

/*.bubble:hover {*/
/*    background: rgba(255, 255, 255, 0.14);*/
/*}*/

/* دکمه سه نقطه */

.message-options-btn {
    position: absolute;
    top: -7px;
    right: -30px; /* سمت چپ پیام */
    opacity: 0;
    font-size: 18px;
    cursor: pointer;
    color: black;
    transition: opacity 0.2s, transform 0.2s;
}

.msg.me .message-options-btn {
    position: absolute;
    top: -7px;
    right:auto;
    left: -30px; /* سمت چپ پیام */
    opacity: 0;
    font-size: 18px;
    cursor: pointer;
    color: black;
    transition: opacity 0.2s, transform 0.2s;
}


.bubble:hover .message-options-btn {
    opacity: 1;
    transform: translateX(4px);
}

/* منوی کوچک */
.message-options-menu {
    position: absolute;
    top: 20px;
    right: -25px;
    left:auto;
    /* background: white; */
    color: black;
    /* backdrop-filter: blur(16px); */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); */
    /* overflow: hidden; */
    z-index: 10;
}
.msg.me .message-options-menu {
    left: -25px;
    right:auto;
}
.message-options-menu.hidden {
    display: none;
}

.message-options-menu button {
    background: white;
    border: none;
    color: black;
    text-align: right;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 5px;
}

.message-options-menu button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(30,30,30,0.9);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
    z-index: 99;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.bubble{
        position: relative;
    z-index: 1;
}



/* ====== Forward Modal Overlay ====== */
.forward-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.55);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    opacity: 0;
    animation: fadeInModal 0.25s ease forwards;
}

@keyframes fadeInModal {
    to {
        opacity: 1;
    }
}

/* ====== Modal Box ====== */
.forward-box {
    width: 360px;
    max-width: 90%;
    padding: 22px;
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);

    box-shadow:
        0 0 25px rgba(0, 150, 255, 0.25),
        0 8px 25px rgba(0, 0, 0, 0.35);

    color: #fff;

    transform: scale(0.9);
    animation: popIn 0.25s ease forwards;
}

@keyframes popIn {
    to {
        transform: scale(1);
    }
}

.forward-box h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #9fd8ff;
}

/* پیش‌نمایش پیام */
.preview-text {
    background: rgba(255, 255, 255, 0.07);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 14px;
    color: #e0f4ff;
    max-height: 80px;
    overflow-y: auto;
}

/* input */
.forward-box input {
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: none;
    outline: none;

    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
}

.forward-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* دکمه‌ها */
.forward-box button {
    width: 100%;
    padding: 9px;
    margin-top: 6px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s;
}

/* دکمه ارسال */
.forward-box button:first-of-type {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
}

.forward-box button:first-of-type:hover {
    box-shadow: 0 0 12px rgba(0, 150, 255, 0.6);
}

/* دکمه انصراف */
.forward-box button:last-of-type {
    background: rgba(255, 255, 255, 0.08);
    color: #ddd;
}

.forward-box button:last-of-type:hover {
    background: rgba(255, 255, 255, 0.15);
}


#forward-list{
max-height:260px;
overflow-y:auto;
margin-top:10px;
}

.forward-user{
display:flex;
align-items:center;
gap:10px;
padding:8px;
border-radius:10px;
cursor:pointer;
transition:.2s;
}

.forward-user:hover{
background:rgba(255,255,255,0.08);
}

.forward-user img{
width:36px;
height:36px;
border-radius:50%;
object-fit:cover;
}

.forward-user-name{
font-size:14px;
color:#fff;
}
.modal{
position:fixed;
inset:0;
background:rgba(0,0,0,0.5);
display:none;
align-items:center;
justify-content:center;
}

.modal-box{
background:white;
padding:20px;
border-radius:12px;
width:350px;
max-height:80vh;
overflow:auto;
}

.member{
display:flex;
align-items:center;
gap:10px;
padding:6px;
cursor:pointer;
}

.member img{
width:32px;
height:32px;
border-radius:50%;
}
/* پس زمینه مودال */

.modal{
position:fixed;
inset:0;
background:rgba(20,25,35,0.35);
backdrop-filter:blur(6px);
display:none;
align-items:center;
justify-content:center;
z-index:1000;
}


/* باکس مودال */

.modal-box{

width:420px;
max-height:85vh;
overflow:auto;

padding:28px;

border-radius:18px;

background:rgba(255,255,255,0.65);
backdrop-filter:blur(18px);

box-shadow:
0 20px 40px rgba(0,0,0,0.15),
inset 0 1px 0 rgba(255,255,255,0.6);

border:1px solid rgba(255,255,255,0.4);

}


/* عنوان */

.modal-box h3{
margin-bottom:20px;
font-size:22px;
font-weight:700;
text-align:center;
color:#1b1e28;
}

.modal-box h4{
margin-top:18px;
margin-bottom:10px;
font-size:16px;
color:#444;
}


/* input ها */

.modal-box input,
.modal-box textarea,
.modal-box select{

width:100%;
padding:10px 12px;
margin-bottom:12px;

border-radius:10px;

border:1px solid rgba(0,0,0,0.1);

background:rgba(255,255,255,0.7);

font-size:14px;

transition:all .2s;

outline:none;

}


.modal-box input:focus,
.modal-box textarea:focus,
.modal-box select:focus{

border-color:#4c8bf5;

box-shadow:
0 0 0 2px rgba(76,139,245,0.15);

background:white;

}


/* لیست اعضا */

#member_list{
margin-top:10px;
display:flex;
flex-direction:column;
gap:6px;
}


/* هر کاربر */

.member{

display:flex;
align-items:center;
    justify-content: flex-start;

padding:8px 10px;

border-radius:10px;

transition:all .18s;

cursor:pointer;

}


.member:hover{
background:rgba(76,139,245,0.08);
}


/* سمت راست کاربر */

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


/* آواتار */

.member img{

width:34px;
height:34px;

border-radius:50%;

object-fit:cover;

box-shadow:0 2px 6px rgba(0,0,0,0.2);

}


/* نام */

.member-name{
font-size:14px;
color:#222;
}


/* چک باکس */

.member input{
width:16px;
height:16px;
cursor:pointer;
}


/* دکمه ها */

.modal-box button{

padding:10px 16px;

border:none;

border-radius:10px;

cursor:pointer;

font-size:14px;

transition:all .2s;

}


/* دکمه ایجاد */

.modal-box button:first-of-type{

background:linear-gradient(135deg,#4c8bf5,#6aa7ff);
color:white;

box-shadow:
0 6px 16px rgba(76,139,245,0.35);

}

.modal-box button:first-of-type:hover{

transform:translateY(-1px);

box-shadow: none;

}


/* دکمه انصراف */

.modal-box button:last-of-type{

background:#e9edf5;
color:#333;

}

.modal-box button:last-of-type:hover{
background:#dde3ef;
}


.mobile-nav{

position:fixed;
bottom:0;
left:0;
right:0;

height:60px;

background:rgba(255,255,255,0.8);
backdrop-filter:blur(10px);

display:flex;

border-top:1px solid rgba(0,0,0,0.1);

z-index:100;

}

.nav-item{

flex:1;

display:flex;
flex-direction:column;
align-items:center;
justify-content:center;

border:none;
background:none;

font-size:13px;
cursor:pointer;

color:#555;

}

.nav-item.active{
color:#4c8bf5;
}



.sidebar-tabs{

display:flex;
gap:6px;

padding:10px;

border-bottom:1px solid rgba(0,0,0,0.08);

}

.tab{

flex:1;

padding:8px;

text-align:center;

border-radius:8px;

cursor:pointer;

font-size:14px;

background:rgba(0,0,0,0.04);

transition:.2s;

}

.tab:hover{
background:rgba(0,0,0,0.08);
}

.tab.active{

background:#4c8bf5;
color:white;

}


.media-list{

padding:10px;

}

.media-header{

font-weight:700;

margin-bottom:10px;

}

.video-item{

display:flex;
gap:10px;

padding:8px;

border-radius:8px;

cursor:pointer;

transition:.2s;

}

.video-item:hover{
background:rgba(0,0,0,0.06);
}

.video-thumb{

width:80px;
height:45px;

border-radius:6px;

object-fit:cover;

}

.video-title{

    font-size: 12px;
    line-height: 1.2;

}
.mobile-tabs{

display:none;

}

/* موبایل */

@media (max-width:768px){

.mobile-tabs{

display:flex;

position:sticky;

top:0;

background:white;

z-index:10;

padding:6px;

gap:6px;

border-bottom:1px solid rgba(0,0,0,0.08);

}


#messageInput{
    width: 60%;
}
.m-tab{

flex:1;

display:flex;
flex-direction:column;

align-items:center;
justify-content:center;

padding:8px;

border:none;

border-radius:10px;

background:#f3f3f3;

font-size:12px;

cursor:pointer;

}

.m-tab span{
font-size:11px;
}

.m-tab.active{

background:#4c8bf5;

color:white;

}

}




.video-player{

position:fixed;

top:0;
left:0;
right:0;
bottom:0;

background:rgba(0,0,0,0.8);

display:flex;

align-items:center;
justify-content:center;

z-index:9999;

}

.video-player video{

max-width:90%;
max-height:90%;

border-radius:10px;

}



.video-modal{

display:none;

position:fixed;
top:0;
left:0;
right:0;
bottom:0;

background:rgba(0,0,0,0.85);

z-index:9999;

align-items:center;
justify-content:center;

}

.video-modal-content{

position:relative;

width:90%;
max-width:900px;

}

.video-modal video{

width:100%;
border-radius:12px;

}

.video-close{

position:absolute;
top:-35px;
right:0;

font-size:28px;

color:white;

cursor:pointer;

}


*{
font-family: "YekanBakh", tahoma, sans-serif;
    line-height: 1.2;
}

.logout-btn{
    width: 44px;
    display: inline-block;
    padding: 3px 7px;
    background: transparent;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 10px;
    position: absolute;
    padding: 0;
    width: 0;
    height: 0;
    cursor: pointer;
    right: 83px;
    top: 55px;
}

.logout-btn:hover{
background:#dc2626;
}

#editChannelBtn{
    cursor:pointer;
}

#channelName,#channelBio{
    color:black;
}

.bubble .text{
    font-size:13px;
}

#lastSeen{
        font-size: 10px;
    margin-top: 5px;
}








:root{
  --bg: #f3f5f9;
  --panel: rgba(255,255,255,0.88);
  --panel-solid: #ffffff;
  --border: rgba(17,24,39,0.08);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f7cff;
  --primary-dark: #315df5;
  --success: #16a34a;
  --danger: #ef4444;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*{
  box-sizing:border-box;
}

html, body{
  margin:0;
  padding:0;
  width:100%;
  height:100%;
  overflow:hidden;
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 55%, #e9eef8 100%);
  font-family: "YekanBakh", Tahoma, sans-serif;
  color:var(--text);
}

body{
  direction: rtl;
}

button, input, textarea, select{
  font: inherit;
}

button{
  cursor:pointer;
  border:none;
  outline:none;
}

.app{
  display:flex;
  width:100%;
  height:100vh;
  overflow:hidden;
  position:relative;
  gap:16px;
  padding:16px;
}

/* SIDEBAR */
.sidebar{
  width: 340px;
  min-width: 340px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.sidebar-top{
  padding:18px;
  border-bottom:1px solid var(--border);
}

.sidebar-user-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border-radius:18px;
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow-soft);
  cursor:pointer;
  transition: .25s ease;
}

.sidebar-user-header:hover{
  transform: translateY(-1px);
  background:#fff;
}

.avatar-sm{
  width:48px;
  height:48px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid rgba(79,124,255,0.14);
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.my-info{
  display:flex;
  flex-direction:column;
  gap:2px;
  flex:1;
  min-width:0;
}

.my-name{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.my-label{
  font-size:12px;
  color:var(--muted);
}

.icon-btn{
  width:38px;
  height:38px;
  border-radius:12px;
  /*background:#f8fafc;*/
  color:#334155;
  display:grid;
  place-items:center;
  transition:.2s ease;
  flex-shrink:0;
      display: block;
    position: absolute;
    top: 19px;
    right: 60px;
}

.icon-btn:hover{
  background:#eef2ff;
  transform: translateY(-1px);
}

.gear-btn{
  font-size:16px;
}

.sidebar-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}

.add-channel-btn,
.logout-btn{
  flex:1;
  height:42px;
  border-radius:14px;
  font-weight:700;
  transition:.2s ease;
}

.add-channel-btn{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  box-shadow: 0 10px 22px rgba(79,124,255,0.22);
}

.add-channel-btn:hover{
  transform: translateY(-1px);
}

.logout-btn{
  background:#fff;
  color:#ef4444;
}

.logout-btn:hover{
  background:#fff5f5;
}

.sidebar-tabs{
  display:flex;
  gap:10px;
  margin-top:14px;
}

.tab{
  flex:1;
  text-align:center;
  padding:12px 10px;
  border-radius:14px;
  background:#f8fafc;
  color:var(--muted);
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.tab:hover{
  background:#eef2ff;
  color:var(--text);
}

.tab.active{
  background: linear-gradient(135deg, rgba(79,124,255,0.14), rgba(79,124,255,0.22));
  color:var(--primary-dark);
  box-shadow: inset 0 0 0 1px rgba(79,124,255,0.12);
}

.sidebar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:-2px;
  font-size:13px;
  font-weight:800;
  color:var(--text);
}

.search-wrap{
  flex:1;
  display:flex;
  justify-content:flex-start;
}

#searchChat{
  width:100%;
  height:42px;
  border:none;
  border-radius:14px;
  background:#f8fafc;
  padding:0 14px;
  outline:none;
  color:var(--text);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05);
}

.sidebar-body{
  flex:1;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.channels,
.media-list{
  flex:1;
  overflow:auto;
  padding:12px;
  padding-bottom: 150px;
}

.channel{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  margin-bottom:10px;
  border-radius:18px;
  background:rgba(255,255,255,0.78);
  border:1px solid rgba(15,23,42,0.05);
  cursor:pointer;
  transition:.22s ease;
  box-shadow: 0 8px 20px rgba(15,23,42,0.04);
}

.channel:hover{
  transform: translateY(-1px);
  background:#fff;
  box-shadow: 0 12px 24px rgba(15,23,42,0.07);
}

.sidebar-avatar{
  width:52px;
  height:52px;
  border-radius:50%;
  object-fit:cover;
  flex-shrink:0;
  border:2px solid rgba(255,255,255,0.8);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.channel-info{
  flex:1;
  min-width:0;
}

.channel-name{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  margin-bottom:4px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.channel-last{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.badge{
  min-width:24px;
  height:24px;
  padding:0 7px;
  border-radius:999px;
  background:var(--primary);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
}

/* CHAT */
.chat-container{
  flex:1;
  min-width:0;
  background-color: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px);
  border:1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  position:relative;
      background-size: contain;
    background-blend-mode: lighten;
    height:auto !important;
}

.chat-header{
  height:78px;
  padding:0 18px;
  border-bottom:1px solid var(--border);
  display:flex;
  gap:12px;
  background: rgba(255,255,255,0.6);
  z-index:3;
}

.back-btn{
  width:42px;
  height:42px;
  border-radius:14px;
  background:#f8fafc;
  display:none;
  align-items:center;
  justify-content:center;
  color:var(--text);
}

.chat-title-wrap{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
      justify-content: center;
}

.chat-title{
  font-size:16px;
  font-weight:900;
  color:var(--text);
}

.chat-meta,
.chat-status{
  font-size:12px;
  color:var(--muted);
}

.messages{
  flex:1;
  overflow:auto;
  padding:18px;
  z-index: 4;
  background:
    radial-gradient(circle at top, rgba(79,124,255,0.04), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.45));
}

.msg{
  display:flex;
  margin-bottom:14px;
}

.msg.me{
  justify-content:flex-start;
}

.msg.other{
  justify-content:flex-end;
}

.bubble{
  max-width:min(75%, 620px);
  padding:12px 16px;
  border-radius:18px;
  background:#ffffff;
  color:var(--text);
  box-shadow: 0 8px 20px rgba(15,23,42,0.06);
  border:1px solid rgba(15,23,42,0.04);
  word-wrap:break-word;
  white-space:pre-wrap;
}

.msg.me .bubble{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  border:none;
}

.time{
  display:block;
  margin-top:6px;
  font-size:11px;
  opacity:0.75;
  text-align:left;
}

.date-divider{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:16px 0;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.date-divider::before,
.date-divider::after{
  content:"";
  height:1px;
  background:rgba(15,23,42,0.08);
  flex:1;
  margin:0 12px;
}

#floatingDate{
  position:absolute;
  top:90px;
  left:50%;
  transform:translateX(-50%);
  z-index:20;
  background: rgba(15,23,42,0.82);
  color:#fff;
  font-size:12px;
  padding:8px 14px;
  border-radius:999px;
  opacity:0;
  pointer-events:none;
  transition:.2s ease;
}

.send-box{
  display:flex;
  align-items:flex-end;
  gap:10px;
  padding:14px;
  border-top:1px solid var(--border);
  background: rgba(255,255,255,0.8);
}

#reply-container{
  width:100%;
}

#messageInput{
  flex:1;
  resize:none;
  min-height:48px;
  max-height:140px;
  border:none;
  outline:none;
  background:#f8fafc;
  border-radius:16px;
  padding:14px 16px;
  color:var(--text);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05);
      width: 80%;
    height: 50px;
    max-width: 100%;
    display: block;
    flex: none;
    float: right;
}

.attach-btn,
.send-btn{
  height:48px;
  border-radius:16px;
  font-weight:800;
  padding:0 18px;
  transition:.2s ease;
}

.attach-btn{
  width:48px;
  padding:0;
  background:#f1f5f9;
}

.send-btn{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
  box-shadow: 0 10px 22px rgba(79,124,255,0.2);
}

.send-btn:hover,
.attach-btn:hover{
  transform: translateY(-1px);
}

/* MODAL */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.45);
  backdrop-filter: blur(8px);
  z-index:1000;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal-box{
  width:min(520px, 100%);
  max-height:90vh;
  overflow:auto;
  background:rgba(255,255,255,0.95);
  border-radius:28px;
  border:1px solid rgba(255,255,255,0.6);
  box-shadow: 0 30px 80px rgba(0,0,0,0.18);
  padding:22px;
}

.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.modal-header h3,
.section-title{
  margin:0;
  color:var(--text);
}

.section-title{
  margin-top:16px;
  margin-bottom:10px;
  font-size:14px;
}

.profile-avatar{
  width:110px;
  height:110px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  margin:10px auto 18px;
  cursor:pointer;
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
  border:4px solid #fff;
}

.input,
.textarea,
select{
  width:100%;
  border:none;
  outline:none;
  background:#f8fafc;
  color:var(--text);
  border-radius:16px;
  padding:14px 16px;
  margin-bottom:12px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05);
}

.textarea{
  min-height:120px;
  resize:vertical;
}

.modal-actions{
  display:flex;
  gap:10px;
  margin-top:16px;
}

.btn{
  flex:1;
  height:46px;
  border-radius:16px;
  font-weight:800;
}

.btn-primary{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
}

.btn-secondary{
  background:#f1f5f9;
  color:var(--text);
}

.member-list{
  max-height:220px;
  overflow:auto;
  border-radius:16px;
  background:#f8fafc;
  padding:8px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.05);
}

/* MEDIA */
.media-header{
  font-size:14px;
  font-weight:800;
  margin-bottom:12px;
  color:var(--text);
}

/* RESPONSIVE */
@media (max-width: 1100px){
  .sidebar{
    width:300px;
    min-width:300px;
  }
}

@media (max-width: 900px){
  .app{
    padding:10px;
    gap:10px;
  }

  .sidebar{
    width:280px;
    min-width:280px;
  }

  .bubble{
    max-width:84%;
  }
}

@media (max-width: 768px){
  html, body{
    overflow:hidden;
  }

  .app{
    padding:0;
    gap:0;
  }

  .sidebar{
    position:absolute;
    inset:0;
    width:100%;
    min-width:100%;
    border-radius:0;
    z-index:20;
  }

  .chat-container{
    position:absolute;
    inset:0;
    width:100%;
    border-radius:0;
    z-index:10;
  }

  .back-btn{
    display:flex;
  }

  .sidebar.hide{
    transform: translateX(100%);
    opacity:0;
    pointer-events:none;
  }

  .app.chat-open .sidebar{
    transform: translateX(100%);
    opacity:0;
    pointer-events:none;
  }

  .app.chat-open .chat-container{
    z-index:30;
  }

  .bubble{
    max-width:130%;
  }
}




@media (max-width:768px){

.mobile-tabs{

display:flex;

position:sticky;

top:0;

background:white;

z-index:10;

padding:6px;

gap:6px;

border-bottom:1px solid rgba(0,0,0,0.08);

}

.send-box.show{
    position:sticky;
    bottom:75px;
}

#messageInput{
    width: 60%;
}

.chat-container::after {
content: "";
position: absolute;
inset: 0;
border-radius: 0;
pointer-events: none;
opacity: 0.7;
background-color: white;
/* animation: neonMove 8s linear infinite; */
}

}


