:root {
    --primary: #8a2be2;
    --primary-dark: #6a1b9a;
    --text-dark: #2e1a36;
    --text-light: #665c70;
    --glass-bg:rgb(245, 238, 238);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
}
body {
    background:linear-gradient(135deg, #4b0082 0%, #2e0052 100%); /* #0f0518 */
    height: 100vh;
    overflow: hidden;
    display: flex;
    color: var(--text-dark);
    position: relative;
 }
.sidebar {
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.logo{
   font-size: 22px;
   font-weight: 800;
   color: var(--primary);
   margin-bottom: 50px;
   display: flex;
   align-items: center;
   gap: 10px;
}
.nav-links{
   list-style: none;
   flex-grow: 1; 
}
.nav-links li {
    margin-bottom: 15px;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 16px;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.3s;
}
.nav-links a:hover, .nav-links a.active {
    background: rgba(138, 43, 226, 0.15);
    color: var(--primary);
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);

}
.user-profile:hover{
    background-color: rgba(138, 43, 226, 0.15);
    border-radius: 5px;
    cursor: pointer;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}
.main-content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
h1 {
    font-size: 28px;
    color: var(--text-dark);
}
canvas{
  position: fixed;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index:-1;
}
.avatarlink{
    text-decoration: none;
    list-style: none;
}
.avatarlink:visited{
    color:black;
}
.avatarlink.activeB{
    background: rgba(138, 43, 226, 0.15);
    color: var(--primary);
    border-radius: 8px;
}
.chatai{
    position: fixed;
    width: 95%;          /* Вместо 1350px */
    max-width: 1300px;   /* Максимальная ширина */
    height: 80vh;        /* Вместо 750px */
    border: 1px solid purple;
    border-radius: 15px;
    background-color: rgb(117, 109, 151);
    backdrop-filter: blur(1px);
    padding: 15px;
    margin-left: 3%;     /* Оставляем твой отступ */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.textchat {
    flex: 1;
    background: rgb(241, 240, 250);
    border-radius: 15px;
    padding: 15px;
    overflow-y: auto;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 95%;          /* Вместо 1350px */
    max-width: 2000px;   /* Максимальная ширина */
}
.textchat p {
    font-size: 17px;
    margin: 0;
    line-height: 1.4;
}

.input-wrapper {
    position: relative;  /* Чтобы кнопки позиционировались относительно этого блока */
    width: 100%;
}

.questionsai {
    width: 100%;
    height: 50px;
    border-radius: 25px; /* Более округлое */
    border: 2px solid #8a2be2;
    padding: 0 100px 0 15px; /* Отступ справа под кнопки! */
    font-size: 18px;
    outline: none;
    box-sizing: border-box;
    background: #dfcdee;
}
.questionsai::placeholder{
    color:rgb(105, 103, 103);
}
/* Контейнер для кнопок внутри поля */
.input-buttons {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 5px;
}

/* Стили кнопок */
.input-buttons button {
    background: transparent;
    border: none;
    font-size: 25px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.input-buttons button:hover {
    background: rgba(138, 43, 226, 0.1);
}
.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.4;
}
.message.ai {
    background: #e1bee7;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}
.message.user {
    background: #571397;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}
.chat-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-avatar {
    font-size: 20px;
    background: #f3e5f5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}

.bot-info {
    display: flex;
    flex-direction: column;
}

.bot-info strong {
    font-size: 16px;
    color: #fae0ed;
}

.status {
    font-size: 12px;
    color: #88c7a2;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status.online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
}

.status.typing::before {
    background: #FFC107;
    animation: blink 1s infinite;
}