#chat-section {
margin-top: -3rem;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}

.topics-list {

}

.topic-btn {
    width: 100%;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.topic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.messages-container {
    max-height: 400px;
    background: #e6e6e6b3;
}

.messages-container {
     direction: rtl; /*меняет направление на справа налево */
    overflow-y: scroll;
}

.messages-container::-webkit-scrollbar {
  width: 3px; /* Ширина полосы прокрутки */
}

.messages-container::-webkit-scrollbar-thumb {
  background: #000; /* Цвет "ползунка" */
  border-radius: 2px; /* Закругление углов "ползунка" */
}

.messages-container::-webkit-scrollbar-track {
  background: #e6e6e6; /* Цвет полосы прокрутки */
}






.message {
    direction: ltr; /* возвращаем обычное направление для содержимого */
}



.message {

}

.message-reply {

}

.message-header {

}

.message-author {
  margin-left: 46px;
  line-height: 30px;
}

.message-date {

}



.message-files {
    margin-top: 10px;
}

.message-image {
    max-width: 200px;
    max-height: 150px;
    cursor: pointer;
    border-radius: 4px;
    margin-right: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.message-file {
    display: inline-block;
    padding: 5px 10px;
    background: #e9ecef;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    margin-right: 10px;
    margin-bottom: 5px;
}

.message-file:hover {
    background: #dee2e6;
    text-decoration: none;
}

.message-actions {
   margin-right: 1rem;
    float: right;
}

.reply-btn {
    font-size: 0.8em;
}

.message-form {
background: #e6e6e6b3;
}

.message-form textarea {
    min-height: 80px;
    resize: vertical;
}



.auth-prompt {
    text-align: center;
    padding: 13px 0 0;
    margin-top: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 90%;
    max-height: 80%;
    text-align: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    opacity: 0.7;
}





.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.no-messages {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.topic-item {
    margin-bottom: 10px;
}


#select-topic-btn .topic-btn, #select-topic-btn .topic-btn:hover{background: none;
    border: none;
    color: var(--bs-body-color) !important;
    text-align: right;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin-top: 3rem;
transform: none; 
    box-shadow: none;
    cursor: default;
}
#select-topic-btn .topic-btn i, #select-topic-btn .topic-btn .badge{display: none;}

.topics-list.select .topic-item .topic-btn{background: none;
    border: none;
    color: var(--bs-body-color);
    text-align: left;
    font-weight: 700;
    font-size: 1.2rem;
width: auto;
}


.topic-btn .badge {
    margin-left: 5px;
    font-size: 0.8em;
}

.topic-btn .badge-light {
    background-color: rgba(255, 255, 255, 0.8);
    color: #000;
}
.message-avatar{bottom:33px}
.message-avatar, .message-avatar img{width: 50px;
    height: 50px;
    display: flex
;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #8b8888;}


.myautor .message-avatar {display: none;}


     /*фон для сообщений*/
.message-content {
  --r: 1em;  /* the radius */
  --t: 1em; /* the size of the tail */
  
  width: fit-content; /* ширина зависит от содержимого */
  max-width: 100%;
  min-width: 260px;
  height: auto; /* высота зависит от содержимого */
  padding: .5rem 1rem;
  border-inline: var(--t) solid #0000;
  border-radius: calc(var(--r) + var(--t))/var(--r);
  mask: 
    radial-gradient(100% 100% at var(--_p) 0,#0000 99%,#000 102%) 
      var(--_p) 100%/var(--t) var(--t) no-repeat,
    linear-gradient(#000 0 0) padding-box;
  
  font-size: 1rem;
  
/*  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease-in-out forwards;*/
  --_p: 0;
  border-bottom-left-radius: 0 0;
  place-self: start;
  background-color: var(--bs-secondary-bg);
  white-space: pre-wrap;
  display: block;
  margin-left: 43px;
}
     
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


	 .myautor .message-content {
--_p: 100%;
border-radius: calc(var(--r) + var(--t))/var(--r);
border-bottom-right-radius: 0 0;
place-self: end;
background: #b3b3b3;
color: #000;
         white-space: normal;
         }
		 
		 


.message-actions .reply-btn{text-decoration: none;
    text-transform: uppercase;
    color: #000000;
    font-size: .7rem;
    font-weight: 600;}
	
.message-actions .reply-btn	.telegramm{width: 20px;
    display: inline-flex
;
    height: 20px;
    align-items: center;
    justify-content: center;
    color: #fbfbfb;
    background: #000;}
	
	.message-block{display: inline-block;
    max-width: 60%;}
	
	
	.myautor .message-conteiner{display: flex;
align-items: flex-end;
flex-direction: column;
}
.myautor .message-block{max-width: 100%;}
	.myautor .message-author{text-align: right;}
	.myautor .datemess{font-weight: 400;}



.reply-to-message {
border-left: 2px solid #8d8d8d;
    padding: 7px;
    background: #9f9f9f;
    margin-bottom: 1rem;
    white-space: normal;
}

.reply-to-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.reply-to-content {
    flex: 1;
}

.reply-to-username {
font-weight: 700;
    font-size: 12px;
}

.reply-to-text {
font-style: italic;
    font-size: 12px;
    max-width: 300px;
}

.reply-to-date {
font-size: 11px;
    color: #545454;
    text-align: right;
    margin-top: 3px;
}



#message-text {
    padding-right: 100px !important; /* Место для кнопок */
    min-height: 60px;
}

#message-form .form-actions .btn {
    z-index: 2;
    
}

#message-form .form-group {
    position: relative;
}

#message-form .form-actions {
   position: absolute;
    right: 15px;
    bottom: 10px;
}

#message-form .telegramm.rounded-circle{width: 34px;
    display: inline-flex
;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #fbfbfb;
    background: #000;
    font-size: 26px;
transform: rotate(45deg);
}

#cancel-reply{text-decoration: none;
    color: #000000;
    font-size: 1.2rem;}
#cancel-reply:hover{color:red;}


#message-form .file-input-wrapper {
  display: inline-flex;
    height: 33px;
    vertical-align: middle;
}

#message-form .file-input-label {
    cursor: pointer;
}

#message-form .file-input-label:hover {
    background-color: #f0f0f0;
}

#message-form .file-input-label i {
    font-size: 2.2rem;
    color: #666;
}

#message-form .file-input-label:hover i {
    color: #333;
}

@media (max-width: 1399px) {
#chat-section {
margin-top: 1rem;
    padding: 0;
}
    .selectchat{flex-wrap: wrap; width: 100% !important;}
    #select-topic-btn{width: 100%}
   #vibortemaother {width: 100%;
       margin: 0 !important;}
       #select-topic-btn .topic-btn{text-align: center;margin-top: 0;}
    .message-content {
    min-width: 230px;
        margin-left: 22px;
    }
    .message-avatar, .message-avatar img {
    width: 25px;
    height: 25px;
        font-size: 1rem;
}
    .message-avatar {
    bottom: 74px;
}
    .message-author {
    margin-left: 40px;
    }
    .message-actions {
    margin-right: -6rem;
    }
    #message-text {
    padding-right: 70px !important;
    }
    #message-form .file-input-label i {
    font-size: 1.5rem;
    }
    #message-form .telegramm.rounded-circle {
    width: 25px;
    height: 25px;
    font-size: 1rem;
}
    #message-form .file-input-wrapper {
    height: 27px;
}
    #send-message{padding: 0;}
    #message-form .form-actions {
    right: 6px;
    top: 8px;
}
    #cancel-reply {
    font-size: .8rem;
    padding: 0;
}
    .messages-container {
    max-height: none;
    }
        
}