body, html {
  height: 100% !important;
  margin: 0 !important;
  width: 100% !important;
  background: #fff !important;
  color: #222;
}

#app {
  display: flex !important;
  height: 100% !important;
  width: 100% !important;
}

body { background: #fff !important; color: #222; }
.header-avatar { width: 60px; height: 60px; border-radius: 50%; margin-right: 15px; }
.header-title { display: flex; align-items: center; margin-bottom: 30px; }
#loaderOverlay {
  position: fixed; top:0; left:0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.8); display: none;
  justify-content: center; align-items: center; z-index: 9999;
}
.file-upload {
  display: inline-block;
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.file-upload:hover {
  background: #0056b3;
}
.file-upload input[type="file"] {
  display: none;
}
.file-loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,123,255,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  color: white;
}
.current-file-info, .current-file-display {
  margin-left: 15px;
  padding: 8px 15px;
  background: #e9ecef;
  border-radius: 5px;
  display: none;
  align-items: center;
}
.current-file-info i, .current-file-display i {
  margin-right: 8px;
  color: #6c757d;
}
.file-indicator {
  padding: 5px 12px;
  background: rgba(0,0,0,0.05);
  border-radius: 8px;
  font-size: 0.85rem;
  display: inline-grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  overflow: hidden;
  margin-bottom: 8px;
}

.file-indicator span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-message {
  margin-bottom: 15px;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in-out;
  display: flex;
  max-width: 85%;
}

.user-message {
  margin-left: auto;
  background: #f9f9f9;
  color: #222;
  padding: 10px 15px;
  border-radius: 20px;
  max-width: 70%;
  text-align: left;
  border: 1px solid #ebebeb;
}

.ai-message {
  display: flex;
  align-items: flex-start;
}

/* НОВОЕ ПРАВИЛО: Скрываем аватар для сообщений со статусом */
.ai-message.status-message .ai-avatar {
    display: none;
}

.ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-right: 12px;
  margin-top: -5px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-shrink: 0;
  transition: transform 0.18s, filter 0.18s;
}
.ai-avatar:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 15px rgba(0, 110, 200, 0.7));
}

.ai-message strong {
  color: #ffffff;
  font-weight: 600;
}

.continue-chat {
  border-top: 1px solid #dee2e6;
  padding-top: 20px;
}
.file-indicator {
  margin: -10px 0 10px;
  color: #6c757d;
  font-size: 0.9em;
  text-align: right;
}
.file-indicator i {
  margin-right: 5px;
}
.fa-lg {
  font-size: 1.15em !important;
}
.ai-response {
    white-space: pre-wrap;
    overflow-wrap: anywhere; /* переносим даже длинные слова/URL */
    word-break: break-word;
}

/* === Новая адаптивная структура, стилизованная под ChatGPT === */
:root {
  --sidebar-width: 260px;
  --sidebar-bg: #000000;
  --sidebar-link: #ffffff;
  --sidebar-link-hover: #0d6efd;
  --chat-bg: #000000;
  --prompt-bg: transparent; /* Сделаем фон бара прозрачным, чтобы был виден фон страницы */
}

body, html, #app {
  height: 100%;
  margin: 0;
  display: flex;
}

#app {
  width: 100%;
}

.sidebar {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, rgb(0 72 255 / 63%) 0%, rgb(68 149 255 / 57%) 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none; /* Убираем свечение */
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  overflow: hidden;
  transition: transform 0.3s ease-in-out; /* ИЗМЕНЕНО: анимируем сдвиг, а не ширину */
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1021;
  transform: translateX(0); /* ИЗМЕНЕНО: начальная позиция */
  margin-left: 0 !important; /* Убираем возможный отступ */
}
.sidebar-header {
  font-weight: 600;
  font-size: 1.1rem;
}
.sidebar-header .btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sidebar-header .btn:hover {
    opacity: 1;
}

#toggleSidebarBtn {
    position: absolute;
    top: 4px;
    left: calc(var(--sidebar-width) - 40px);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1022;
    transition: left 0.3s ease-in-out, background-color 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}
#toggleSidebarBtn:hover {
    background: rgba(0,0,0,0.05);
    transform: scale(1.1);
}
#toggleSidebarBtn:active {
    transform: scale(0.95);
}
#app.sidebar-collapsed #toggleSidebarBtn {
    left: 10px;
}

#newChatCollapsedBtn {
    position: absolute;
    top: 4px; /* Same as toggle button */
    left: 44px; /* 10px (toggle left) + 24px (toggle width) + 10px gap */
    width: 24px;
    height: 24px;
    color: #000;
    z-index: 1022;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

#newChatCollapsedBtn i {
    position: relative;
    top: -1px;
}

#newChatCollapsedBtn:hover {
    color: #000;
    transform: scale(1.1);
    text-decoration: none; /* Убираем подчеркивание */
}

#app.sidebar-collapsed #newChatCollapsedBtn {
    display: flex; /* Show when sidebar is collapsed */
}

.sidebar .nav-link span {
    transition: opacity 0.2s; /* Убрана задержка */
    white-space: nowrap; /* Предотвращаем перенос текста во время анимации */
}

/* Collapsed state for sidebar */
.sidebar.collapsed {
    transform: translateX(-100%); /* ИЗМЕНЕНО: уезжает влево */
    pointer-events: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}
.sidebar.collapsed .nav-item a {
    padding-left: 1rem;
    justify-content: center;
}

.sidebar .nav-link {
  color: #ffffff; /* white text */
  background: transparent;
  border-radius: 12px;
  transition:
    background-color 0.35s cubic-bezier(.4,0,.2,1),
    color 0.35s cubic-bezier(.4,0,.2,1),
    box-shadow 0.35s cubic-bezier(.4,0,.2,1);
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  text-shadow: none;
}
.sidebar-footer {
  height: 0 !important;
  padding: 0 !important;
  border: none !important;
}
.sidebar-footer-logo-wrapper,
.sidebar-footer span {
  display: none !important;
}

.sidebar-footer > * {
  position: relative;
  z-index: 2;
}

.sidebar-footer #floating-icons-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.sidebar-footer .floating-icon {
    position: absolute;
    display: block;
    opacity: 0;
    filter: brightness(0) invert(1);
    font-size: 24px;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    25% { opacity: 0.3; }
    50% { transform: translateY(-15px) rotate(180deg); }
    75% { opacity: 0.3; }
    100% { transform: translateY(0) rotate(360deg); opacity: 0; }
}

.chat-area {
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  min-width: 0 !important;
  width: 100% !important;
  background: #fff !important;
  position: relative;
  overflow: hidden;
  margin-left: 0 !important; /* Убираем возможный отступ */
}

.chat-area::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 150px;
    background: none;
    pointer-events: none;
    z-index: 5;
}

/* Лазурное свечение сверху */
.top-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to bottom, rgba(29, 138, 255, 0.5), transparent);
    z-index: 2;
    pointer-events: none;
    filter: blur(2px);
}

#snowflakes-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3; /* Паутинка над свечением */
}

.chat-header,
.chat-messages,
.prompt-bar {
    position: relative;
    z-index: 4; /* Контент чата на самом верху */
}

.chat-header.menu-is-open {
    z-index: 2;
}

.chat-header {
  position: relative;
  height: 60px;
  min-height: 60px;
}
.chat-header .user-avatar {
  position: static;
  top: auto;
  right: auto;
}
.chat-messages {
  scroll-behavior: smooth;
  /* background: var(--chat-bg); */ /* Removed, as parent has it */
  align-items: flex-start;
  justify-content: flex-end; /* NEW: Align content to the bottom */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  padding-top: 0;
  overflow-y: auto;
}
.chat-messages::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}
.chat-message {
  animation: fadeIn 0.3s ease-in-out;
}

.prompt-bar {
  background: var(--prompt-bg);
  opacity: 0;
  animation: promptFadeIn 0.7s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: 0.7s;
}
.prompt-bar textarea {
  border: none;
  outline: none;
  resize: none;
  background: #2b2b2b;
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 160px;
  overflow-y: auto;
  color: white;
}
.prompt-bar textarea:focus {
  box-shadow: 0 0 0 2px rgba(13,110,253,.25);
}

.file-upload-inline label {
  cursor: pointer;
  color: #adb5bd;
  transition: color .2s;
}
.file-upload-inline label:hover {
  color: #ffffff;
}

@keyframes fadeIn {
  from {opacity: 0; transform: translateY(10px);}
  to {opacity: 1; transform: translateY(0);}
}

/* Prompt inner container */
.prompt-inner{
  width: 100%;
  background:#2b2b2b;
  border:1px solid #444;
  border-radius:32px;
  padding:12px 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.prompt-inner .d-flex{gap:8px;}
.prompt-bar{display:flex;/*justify-content:center;*/}
.prompt-bar textarea.form-control {
    background-color: transparent !important;
    color: white !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    padding: 14px 18px;
    font-size: 1rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
.prompt-bar textarea.form-control::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.prompt-bar textarea.form-control:focus {
    box-shadow: none !important;
}
.prompt-bar button[type="submit"]{
    border-radius:50%;
    width:48px;
    height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    background-color: #3e3e3e; /* New grey color */
    border: none;
    transition: background-color 0.2s;
}

.prompt-bar button[type="submit"]:hover {
    background-color: #505050;
}

.chat-inner{width:100%;padding:0 24px;}

.prompt-wrapper {
    width: 100%;
    max-width: 900px; /* Ограничим ширину на больших экранах */
    margin: 0 auto;  /* Центрируем */
}

/* Logo image size */
.logo-image {
  height: 50px !important;
  width: 50px !important;
  border-radius: 50%;
  object-fit: cover;
  padding-left: 0;
  transition: transform 0.2s ease-in-out;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* --- Стили для приветствия --- */
.welcome {
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.welcome.fade-out {
  opacity: 0;
  transform: translateY(-30px);
}

.welcome h2 {
  color: #ffffff;
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  transition: opacity 0.4s cubic-bezier(.4,0,.2,1), transform 0.4s cubic-bezier(.4,0,.2,1);
  transition-delay: 0.1s;
  right: auto;
}

.welcome h2 .animated-word {
  display: inline-block;
  opacity: 0;
  animation: revealWord 1s ease-out forwards;
  transform: translateY(25px);
}

.welcome h2 .animated-word:nth-child(1) { animation-delay: 0.1s; }
.welcome h2 .animated-word:nth-child(2) { animation-delay: 0.3s; }
.welcome h2 .animated-word:nth-child(3) { animation-delay: 0.5s; }
.welcome h2 .animated-word:nth-child(4) { animation-delay: 0.7s; }

@keyframes revealWord {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Pre-chat state --- */

.chat-area.pre-chat {
  justify-content: center;
}

.chat-area.pre-chat .chat-header {
  display: none;
}

.chat-area.pre-chat .chat-messages {
  flex-grow: 0;
  overflow: visible; /* Allow seeing shadows/glows */
}

.chat-area.pre-chat .welcome {
  margin-bottom: 16px !important;
  margin-top: 230px !important; /* Уменьшен отступ сверху */
}

.chat-area.pre-chat .welcome h2 {
  font-size: 64px; /* Больше размер */
  margin-bottom: 8px !important;
  margin-top: 0 !important;
}

.chat-area.pre-chat .grok-logo-placeholder {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.chat-area.pre-chat .prompt-bar {
  background: transparent;
  border-top: none;
  padding: 0;
  justify-content: center;
  transition: background-color 0.5s ease-in-out;
}

.chat-area.pre-chat .prompt-wrapper {
  max-width: 800px; /* Limit width of prompt area */
  margin-bottom: 300px; /* Увеличен отступ снизу, чтобы поднять выше */
}

.chat-area.pre-chat .prompt-inner textarea.form-control {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0; /* Убираем боковые отступы */
  padding: 0 !important; /* Убираем внутренние отступы от Bootstrap */
  color: #111 !important;
  background: transparent !important;
  padding-right: 5px !important;
}

.chat-area.pre-chat button[type="submit"] {
  position: absolute;
  right: 24px;
  top: 27%;
  transform: translateY(-50%);
  margin-left: 0;
}

.welcome h2, .welcome h2 .animated-word {
  color: #111 !important;
}

.suggestion-chips { display: none !important; }

.chat-area.pre-chat .file-upload-inline label,
.chat-area.pre-chat .detailed-response-toggle .fa-lightbulb,
.chat-area.pre-chat .btn.btn-link,
.chat-area.pre-chat .fa-paperclip,
.chat-area.pre-chat .fa-arrow-up {
  color: #222;
  background: none !important;
}

.chat-area.pre-chat button[type="submit"] {
  background: #f3f3f3 !important;
  color: #222 !important;
  border-radius: 50% !important;
  width: 33px !important;
  height: 33px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: none;
  margin-left: 10px;
  transition: background 0.2s;
}

.chat-area.pre-chat button[type="submit"]:hover {
  background: #e0e0e0 !important;
}

/* Suggestion chips */
.suggestion-chips {
  display: none; /* Hidden by default */
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-area.pre-chat .suggestion-chips {
  display: flex; /* Visible in pre-chat state */
}

.suggestion-chips .chip {
  background: rgba(43,43,43,0.6) !important;
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  transition: background-color 0.2s, border-color 0.2s, transform 0.9s, opacity 0.2s;
  opacity: 0;
  transform: translateY(25px) scale(0.95);
  animation: chipFadeIn 0.7s cubic-bezier(.4,0,.2,1) forwards;
}
.suggestion-chips .chip:nth-child(1) { animation-delay: 0.1s; }
.suggestion-chips .chip:nth-child(2) { animation-delay: 0.3s; }
.suggestion-chips .chip:nth-child(3) { animation-delay: 0.5s; }
@keyframes chipFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.suggestion-chips .chip:hover {
  background-color: rgba(58,58,58,0.9) !important;
  border-color: #555;
  /* transform: scale(1.06) !important; */
  opacity: 1;
}

/* --- Custom Tooltip Styles --- */
.custom-tooltip {
    position: fixed; /* Use fixed to position relative to viewport */
    background-color: #2c2f33;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1080; /* Higher than other elements */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    max-width: 250px;
    text-align: left;
    pointer-events: none; /* Prevent tooltip from blocking mouse events */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.custom-tooltip strong {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: #fff;
}

.custom-tooltip p {
    margin: 0;
    font-size: 13px;
    color: #b9bbbe;
    line-height: 1.4;
}

/* Loading dots animation */
.loading-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background-color: #222;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.24s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.12s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0;
  }
  40% {
    transform: scale(1.0);
    opacity: 1;
  }
}

/* Smooth animation for streaming text chunks */
.stream-chunk {
    display: inline;
    animation: fadeIn 0.4s ease-in-out;
}

/* User Avatar in Header */
.user-avatar {
    position: relative; /* Необходимо для позиционирования псевдоэлемента */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none; /* Убираем рамку */
    background: #f0f0f0;
    cursor: pointer;
    transition: transform 0.3s ease; /* Убираем box-shadow из transition */
    animation: topFadeIn 0.5s ease-in-out backwards;
    z-index: 1; /* Убедимся, что аватар выше свечения */
}

.user-avatar::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgb(75, 140, 255) 0%, rgb(30, 100, 255) 50%, rgb(13, 80, 200) 100%);
    border-radius: 50%;
    filter: blur(5px); /* Уменьшаем свечение */
    z-index: -1; /* Помещаем свечение за аватаром */
    transition: filter 0.3s ease, transform 0.3s ease;
    opacity: 0.7; /* Уменьшаем свечение */
}

.user-avatar svg {
    width: 100%;
    height: 100%;
    transition: all 0.2s;
    position: relative;
    top: 7px; /* Смещаем иконку вниз, чтобы она выходила за край */
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-avatar:hover::after {
    transform: scale(1.1);
    filter: blur(8px); /* Уменьшаем свечение при наведении */
}

.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1020;
  transition: opacity 0.2s;
}
.sidebar-overlay.d-none {
  display: none;
  opacity: 0;
  pointer-events: none;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* === Profile Menu === */
.profile-menu {
  display: none;
  position: absolute;
  top: 65px; /* Adjust as needed */
  right: 20px;
  background-color: #ffffff !important;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 9999 !important;
  width: 280px;
  padding: 8px;
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
}
.profile-menu.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.profile-menu .profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 15px;
  background-color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-menu .profile-avatar svg {
  width: 24px;
  height: 24px;
  fill: #f0f0f0;
}
.profile-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: #222;
  text-align: left;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
}
.profile-btn:hover, .profile-btn:focus {
  background-color: #f0f0f0;
  outline: none;
  text-decoration: none;
  color: #222;
}
.profile-btn i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: #222;
}
.profile-btn:hover i {
  color: #222;
}
.profile-menu-separator {
  height: 1px;
  margin: 8px 0;
  background-color: #e5e5e5;
}
.user-avatar {
    position: relative; /* Для позиционирования псевдоэлемента */
}

@keyframes topFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#toggleSidebarBtn,
#newChatCollapsedBtn,
#botCommandsBtn,
.user-avatar {
  opacity: 0;
  animation: topFadeIn 0.7s cubic-bezier(.4,0,.2,1) forwards;
}
#toggleSidebarBtn { animation-delay: 0.1s; }
#newChatCollapsedBtn { animation-delay: 0.3s; }
#botCommandsBtn { animation-delay: 0.5s; }
.user-avatar { animation-delay: 0.7s; }

@keyframes promptFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sidebar .nav-link i {
  color: inherit !important;
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
  color: #ffffff !important;
}

.chat-history-label {
  position: absolute;
  left: 0;
  width: 100%;
  top: 44%; /* чуть выше */
  transform: translateY(-50%);
  opacity: 0.6;
  color: #222; /* Черный текст */
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}
.chat-history-label i {
  margin-bottom: 4px;
  font-size: 1.5em;
}

.header-controls {
  position: absolute;
  top: 18px;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1022;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-controls .user-avatar {
  position: static;
  top: auto;
  right: auto;
}

#toggleSidebarBtn, #newChatCollapsedBtn, #botCommandsBtn, .user-avatar {
  opacity: 0;
  animation: topFadeIn 0.7s cubic-bezier(.4,0,.2,1) forwards;
}
#toggleSidebarBtn { animation-delay: 0.1s; }
#newChatCollapsedBtn { animation-delay: 0.3s; }
#botCommandsBtn { animation-delay: 0.5s; }
.header-controls .user-avatar { animation-delay: 0.7s; }

/* Убираю абсолют у .user-avatar вне header-controls */
.chat-header .user-avatar {
  position: static;
  top: auto;
  right: auto;
}

.welcome-logo {
  display: block;
  margin: 0 auto 32px;
  height: 100px;
  width: 100px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transform: translateY(25px);
  animation: revealWord 1s ease-out forwards;
  transition: opacity 0.4s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1), filter 0.3s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}

.welcome-logo:hover {
  transform: scale(1.05) translateY(25px);
  filter: drop-shadow(0 0 15px rgba(0, 110, 200, 0.7));
}

.welcome-logo.is-hiding {
  opacity: 0 !important;
  transform: translateY(-50px) !important;
}

.welcome h2.is-hiding {
  opacity: 0;
}

/* --- Стили для карточек-подсказок на главном экране --- */
.suggestion-cards-container {
  display: flex;
  flex-direction: column; /* Rows will be stacked vertically */
  align-items: center;   /* Center rows horizontally */
  gap: 10px;             /* Gap between rows */
  margin-top: 40px;
  width: 100%;
  max-width: 520px;      /* Set a max-width for the entire block */
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(25px);
  animation: chipFadeIn 0.8s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: 1s; /* Appear after title */
}

.suggestion-card-row {
  display: flex;
  justify-content: center;
  gap: 10px; /* Gap between cards in a row */
  width: 100%;
}

.suggestion-card {
  display: flex;
  align-items: center;
  flex: 1; /* Each card takes up equal space in the row */
  min-width: 0; /* Important for flex items */
  padding: 16px 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); /* For Safari */
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  text-align: left;
  box-shadow: 0 10px 30px rgb(11 26 43 / 20%);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2));
}

.suggestion-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 10px 30px rgba(65, 137, 220, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2));
}

.suggestion-card .card-icon {
  font-size: 1.4rem;
  color: #215597; /* A deep sky blue */
  margin-right: 14px;
  width: 28px;
  text-align: center;
  transition: color 0.3s ease, transform 0.3s ease;
}

.suggestion-card:hover .card-icon {
    color: #215597; /* Brighter blue on hover */
    transform: scale(1.1);
}

.suggestion-card .card-text {
  display: flex;
  flex-direction: column;
}

.suggestion-card .card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  word-wrap: break-word; /* Ensure long words or titles wrap */
  word-break: break-all; /* Force break long words */
  line-height: 1.2; /* Adjust line height for wrapped titles */
}

.suggestion-card .card-description {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.3;
  word-wrap: break-word; /* Ensure long descriptions wrap */
}

/* Стили для неактивной карточки */
.suggestion-card.disabled {
  background: linear-gradient(145deg, rgba(245, 245, 245, 0.4), rgba(245, 245, 245, 0.1));
  border-color: rgba(200, 200, 200, 0.5);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

.suggestion-card.disabled:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(145deg, rgba(245, 245, 245, 0.4), rgba(245, 245, 245, 0.1));
}

.suggestion-card.disabled .card-icon {
  color: #999;
}

.suggestion-card.disabled .card-title {
  color: #777;
}

.suggestion-card.disabled .card-description {
  color: #999;
}

/* === Адаптивные стили для мобильных устройств === */
@media (max-width: 992px) {
  .suggestion-cards-container {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
    .welcome-logo {
        width: 100px; /* Уменьшаем ширину */
        height: 100px; /* Уменьшаем высоту */
        margin-bottom: 20px; /* Уменьшаем отступ */
    }

    .chat-area.pre-chat .welcome h2 {
        font-size: 1.8rem; /* Уменьшаем шрифт заголовка */
        margin-bottom: 25px;
    }

    .chat-area.pre-chat .prompt-wrapper {
        max-width: 95%;
        margin-bottom: 20vh; /* Используем vh для более гибкого отступа */
    }

    .suggestion-cards-container {
        gap: 15px;
        margin-top: 24px;
        padding: 0 15px; /* Add some padding */
    }

    .suggestion-card-row {
        gap: 15px; /* Match container gap */
    }

    .suggestion-card {
        padding: 12px 16px; /* Adjust padding for smaller cards */
    }
    .suggestion-card .card-title {
        font-size: 0.9rem; /* Smaller title */
    }
    .suggestion-card .card-description {
        font-size: 0.75rem; /* Smaller description */
    }
}

/* === Стили для переключателя развернутого ответа === */
.detailed-response-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 0 8px; /* Небольшой отступ */
    cursor: pointer;
}

.detailed-response-toggle .fa-lightbulb {
    color: #8e8e8e;
    transition: color 0.3s, text-shadow 0.3s;
    font-size: 1rem;
}

/* The switch - a classic toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    margin: 0;
    left: -8px
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50; /* Green */
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* Change icon color when checked */
#detailedResponseToggle:checked ~ .fa-lightbulb {
    color: #FFC107; /* Yellow */
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.8);
}
/* === Конец стилей для переключателя === */

.detailed-response-toggle i.fa-lightbulb {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.detailed-response-toggle i.glowing {
    color: #87CEEB; /* Яркий синий цвет для "включенной" лампочки */
    text-shadow:
        0 0 5px rgba(135, 206, 235, 0.8),
        0 0 10px rgba(135, 206, 235, 0.6),
        0 0 20px rgba(135, 206, 235, 0.4),
        0 0 40px rgba(135, 206, 235, 0.2);
}

/* Глобальные стили для контейнера ввода */
.prompt-inner {
  background: #fff !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 28px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 10px 20px !important;
  position: relative;
}

.prompt-inner textarea.form-control {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #111 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  resize: none;
  font-size: 1rem;
  min-height: 24px;
  max-height: 220px; /* Allow more vertical space */
  overflow-y: auto; /* Show scrollbar when max-height is reached */
}

.prompt-inner button[type="submit"] {
  background: #f0f0f0 !important;
  color: #333 !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: none;
  transition: background 0.2s;
  padding: 0;
}

.prompt-inner button[type="submit"] i {
  font-size: 1.1em !important;
}

.prompt-inner button[type="submit"]:hover {
  background: #e0e0e0 !important;
}

.prompt-inner textarea.form-control::placeholder {
  color: #b0b0b0 !important;
  opacity: 1;
}

.prompt-inner .file-upload-inline label,
.prompt-inner .detailed-response-toggle .fa-lightbulb,
.prompt-inner .btn.btn-link,
.prompt-inner .fa-paperclip,
.prompt-inner .fa-arrow-up,
.prompt-inner .fa-microphone {
  color: #555;
  background: none !important;
  transition: color 0.2s;
}
.prompt-inner .file-upload-inline label:hover,
.prompt-inner .detailed-response-toggle .fa-lightbulb:hover {
  color: #111;
}

.attachment-icon {
  width: 22px;
  height: 22px;
  vertical-align: bottom; /* To align with text field */
}

/* Старые стили ниже будут перезаписаны или удалены */
.chat-area.pre-chat .prompt-bar {
  background: transparent;
  border-top: none;
  padding: 0;
  justify-content: center;
  transition: background-color 0.5s ease-in-out;
}

.chat-area.pre-chat .prompt-wrapper {
  max-width: 800px; /* Limit width of prompt area */
  margin-bottom: 300px; /* Увеличен отступ снизу, чтобы поднять выше */
}

/* Удаляем дублирующиеся стили, которые теперь глобальные */
/* .chat-area.pre-chat .prompt-inner { ... } */
/* .chat-area.pre-chat .prompt-inner textarea.form-control { ... } */
/* .chat-area.pre-chat button[type="submit"] { ... } */
/* .chat-area.pre-chat .file-upload-inline label { ... } */

#docForm {
  gap: 8px; /* Расстояние между элементами в строке ввода */
}

#docForm .d-flex.align-items-center {
  gap: 8px; /* Расстояние между элементами в строке ввода */
}

.prompt-inner button[type="submit"] {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
}

.prompt-inner textarea.form-control {
    padding: 0 !important; /* Убираем лишний отступ и гарантируем применение */
}

.detailed-response-toggle {
    margin-top: 0; /* Убираем лишний отступ, теперь используем gap */
}

#toolsDropdownBtn:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Добавляем плавный переход для иконки лампочки */
.tools-dropdown-menu .dropdown-item i.fa-lightbulb {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.tools-dropdown-menu .glowing {
  color: #FFC107 !important;
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
}

.tools-dropdown-menu .dropdown-item.image-mode-glowing .fa-image {
  color: #9333ea; /* Purple */
  text-shadow: 0 0 8px rgba(147, 51, 234, 0.6);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

#toolsDropdownBtn.audio-mode-active i.fa-sliders {
  color: #b91c1c;
  text-shadow: 0 0 8px rgba(185,28,28,0.5);
}

.tools-dropdown-menu .dropdown-item {
  transition: background 0.25s cubic-bezier(.4,0,.2,1), color 0.18s;
}
.tools-dropdown-menu .dropdown-item:active,
.tools-dropdown-menu .dropdown-item.active,
.tools-dropdown-menu .dropdown-item:focus {
  background: rgba(30, 144, 255, 0.13) !important; /* Полупрозрачный голубой */
  color: #111 !important;
  outline: none !important;
  box-shadow: none !important;
}

.think-longer-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #fff;
  color: #222;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 14px 32px 14px 22px;
  font-size: 1.08rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1), transform 0.5s cubic-bezier(.4,0,.2,1);
}
.think-longer-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.think-longer-toast.hide {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-20px);
}
.think-longer-toast .toast-bulb {
  color: #FFC107;
  font-size: 1.3em;
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
  transition: color 0.3s, text-shadow 0.3s;
}
.think-longer-toast.off {
  background: #f3f3f3;
  color: #888;
}
.think-longer-toast.off .toast-bulb {
  color: #bbb;
  text-shadow: none;
}

/* Анимация для меню инструментов */
.tools-dropdown-menu {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(.4,0,.2,1), transform 0.28s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
  top: 110%;
  bottom: auto;
}

.tools-dropdown-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tools-dropdown-menu.open-up {
    top: auto !important;
    bottom: 110% !important;
}

.tools-dropdown-menu.open-down {
    top: 110% !important;
    bottom: auto !important;
}

.prompt-bar .tools-dropdown {
  margin-right: 0.05rem !important; /* Уменьшаем отступ справа, было mr-2 (0.5rem) */
}

.prompt-bar .tools-dropdown button {
  transform: translateY(2px); /* Смещаем иконку чуть ниже */
}

.prompt-bar .file-upload-inline {
  /* Возможно, понадобится подстроить и этот элемент */
}

.message-content {
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
}

/* Стили для сгенерированного изображения в чате */
.generated-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    margin-top: 10px;
    border: 1px solid #eee;
    object-fit: cover;
    display: block;
}

.chat-message.ai-message .ai-response {
    color: #333; /* Slightly darker text for better readability */
    white-space: pre-wrap;
}

.think-longer-toast .toast-bulb.glowing {
  color: #FFC107;
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
}

#imageModeToast .toast-icon {
  color: #9333ea; /* Purple 600 from Tailwind palette */
  text-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
  font-size: 1.1em;
  margin-right: 12px;
}

#audioModeToast .toast-icon {
  color: #dc3545; /* Red */
  text-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
  font-size: 1.1em;
  margin-right: 12px;
}

#toolsDropdownBtn i.fa-sliders {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

#toolsDropdownBtn.image-mode-active i.fa-sliders {
  color: #9333ea;
  text-shadow: 0 0 8px rgba(147, 51, 234, 0.6);
}

#toolsDropdownBtn.audio-mode-active i.fa-sliders {
  color: #dc3545; /* Red */
  text-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
}

.image-loader {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: transparent;
  border-radius: 12px;
  color: #333;
}

.image-loader .loader-icon {
  color: #9333ea; /* Purple */
  font-size: 1.2rem;
  margin-right: 12px;
  animation: pulse-sparkle 1.8s infinite ease-in-out;
}

.image-loader span {
  font-weight: 500;
  font-size: 1rem;
  animation: fade-text 1.8s infinite ease-in-out;
}

.tools-dropdown-menu .profile-menu-separator {
  margin: 6px 0;
}

.tools-dropdown-menu .model-select {
  padding-left: 12px;
  padding-right: 12px;
}

.tools-dropdown-menu .model-select i.fa-check {
  width: 16px; /* for alignment */
  margin-right: 12px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.tools-dropdown-menu .model-select.active i.fa-check {
  opacity: 1;
}

/* === Model Selector Styles === */
.model-selector-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-left: -1px;
}

.model-selector-btn {
  background-color: transparent;
  border: none;
  border-radius: 8px;
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 8px 4px 0;
  transition: background-color 0.2s, color 0.2s;
  gap: 6px;
}

.model-selector-btn:hover {
  background-color: transparent;
  color: #111;
}

.model-selector-btn:focus {
  outline: none;
  box-shadow: none !important;
}

.model-selector-btn .fa-chevron-up {
  transition: transform 0.3s ease;
  font-size: 0.7em;
}

.model-selector-btn.open .fa-chevron-up {
  transform: rotate(180deg);
}

.model-selector-menu {
  position: absolute;
  bottom: 110%; /* Show above the button */
  left: 0;
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 1010;
  width: 220px;
  padding: 8px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(.4,0,.2,1), transform 0.28s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}

.model-selector-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.model-selector-menu .model-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: #333;
  text-align: left;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
  font-weight: 500;
}

.model-selector-menu .model-option:hover {
  background-color: #f0f0f0;
  color: #111;
}

.model-selector-menu .model-option.active {
  background-color: #e6f3ff;
  color: #007bff;
  font-weight: 700;
}

/* Стили для кнопки "Выйти" */
.profile-btn[data-action="logout"] {
  background-color: rgba(220, 53, 69, 0.08);
  color: #dc3545; /* Красный цвет текста */
}

.profile-btn[data-action="logout"] i {
  color: inherit; /* Наследуем красный цвет от родителя */
}

.profile-btn[data-action="logout"]:hover,
.profile-btn[data-action="logout"]:focus {
  background-color: rgba(220, 53, 69, 0.15); /* Более темный фон при наведении */
  color: #a71d2a; /* Более темный текст при наведении */
}

.tool-sub-button {
  font-weight: 500;
  font-size: 0.85rem !important;
  padding: 6px !important;
  background-color: #fff !important;
  border: 1px solid #e5e5e5 !important;
  color: #333 !important;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  text-decoration: none;
}
.tool-sub-button:hover {
  background-color: #f0f0f0 !important;
  border-color: #e0e0e0 !important;
  color: #111 !important;
  text-decoration: none;
}

/* === Audio Player Styles === */
.audio-player-wrapper {
    margin-top: 8px;
    background-color: #f7f7f7;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e9e9e9;
}

.audio-player-wrapper audio {
    width: 100%;
    height: 40px;
    outline: none;
}

/* Customizing the audio player controls */
.audio-player-wrapper audio::-webkit-media-controls-panel {
    background-color: #f7f7f7;
    border-radius: 12px;
}

.audio-player-wrapper audio::-webkit-media-controls-play-button,
.audio-player-wrapper audio::-webkit-media-controls-mute-button {
    color: #333;
    border-radius: 50%;
}
.audio-player-wrapper audio::-webkit-media-controls-play-button:hover,
.audio-player-wrapper audio::-webkit-media-controls-mute-button:hover {
    background-color: #e9e9e9;
}

.audio-player-wrapper audio::-webkit-media-controls-current-time-display,
.audio-player-wrapper audio::-webkit-media-controls-time-remaining-display {
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.audio-player-wrapper audio::-webkit-media-controls-timeline {
    background-color: #e0e0e0;
    border-radius: 6px;
    margin: 0 10px;
}

.audio-player-wrapper audio::-webkit-media-controls-volume-slider {
     background-color: #e0e0e0;
     border-radius: 6px;
}

/* === Audio Choice Modal Styles === */
#audioChoiceModal .modal-content {
  background-color: #ffffff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 16px;
}

#audioChoiceModal .modal-header {
  border-bottom: none;
  padding: 8px 16px;
  position: relative;
}

#audioChoiceModal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: #ffffff;
  width: 100%;
  text-align: center;
}

#audioChoiceModal .modal-header .close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 2rem;
  font-weight: 300;
  color: #888;
  text-shadow: none;
  opacity: 1;
  transition: color 0.2s;
}
#audioChoiceModal .modal-header .close:hover {
    color: #111;
}


#audioChoiceModal .modal-body {
  padding: 8px 16px 24px;
  text-align: center;
}

#audioChoiceModal .modal-body p {
  color: #666;
  margin-bottom: 24px;
}

.audio-choice-btn {
  background: #f0f0f0;
  border: 1px solid #e5e5e5;
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s ease;
}

.audio-choice-btn:hover {
  transform: translateY(-2px);
  background: #e9e9e9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  color: #111;
}

.audio-choice-btn:not(:last-child) {
  margin-bottom: 12px;
}

.modal-backdrop.show {
    opacity: 0.5;
}

@keyframes fade-text {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.audio-loader {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: transparent;
  border-radius: 12px;
  color: #333;
}

.audio-loader .loader-icon {
  color: #dc3545; /* Red */
  font-size: 1.2rem;
  margin-right: 12px;
  animation: pulse-sparkle 1.8s infinite ease-in-out;
}

.audio-loader span {
  font-weight: 500;
  font-size: 1rem;
  animation: fade-text 1.8s infinite ease-in-out;
}

.tools-dropdown-menu .profile-menu-separator {
  margin: 6px 0;
}

#attached-file-display {
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
  max-width: 100%; /* Let it take full width */
}

/* Styles for when it holds a file (text, pdf, etc.) */
#attached-file-display.has-file {
  background-color: #e9ecef;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.85rem;
  color: #333;
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  overflow: hidden;
}

#attached-file-display.has-file span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#attached-file-display.has-file .remove-file-btn {
  margin-left: auto;
  cursor: pointer;
  color: #888;
  transition: color 0.2s;
  flex-shrink: 0;
}

#attached-file-display.has-file .remove-file-btn:hover {
  color: #333;
}

/* Styles for when it holds an image thumbnail */
#attached-file-display.has-image {
  padding: 0;
  background: transparent;
  display: flex;
  flex-wrap: wrap;
  gap: 10px; /* Расстояние между превью */
}

.attached-image-container,
.attached-file-preview {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.attached-image-thumbnail {
  height: 72px;
  width: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

/* НОВЫЕ СТИЛИ: Фон для иконки файла */
.file-icon-background {
  height: 72px;
  width: 72px;
  background-color: #f0f2f5;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px; /* Размер иконки файла */
  color: #555;
}

/* Общий стиль для кнопки удаления на всех превью */
.attached-image-container .remove-file-btn,
.attached-file-preview .remove-file-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background-color: #333;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.attached-image-container .remove-file-btn:hover,
.attached-file-preview .remove-file-btn:hover {
  transform: scale(1.1);
  background-color: #000;
}

.web-search-loader {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: transparent;
  border-radius: 12px;
  color: #333;
}
.web-search-loader .loader-icon {
  color: #007bff; /* Синий */
  font-size: 1.2rem;
  margin-right: 12px;
  /* animation: web-spin 1.2s linear infinite; */
}
.web-search-loader span {
  font-weight: 500;
  font-size: 1rem;
  animation: fade-text 1.8s infinite ease-in-out;
}
@keyframes web-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.deep-search-loader {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: transparent;
  border-radius: 12px;
  color: #333;
}
.deep-search-loader .loader-icon {
  color: #28a745; /* Зеленый */
  font-size: 1.2rem;
  margin-right: 12px;
  /* animation: web-spin 1.2s linear infinite; */
}
.deep-search-loader span {
  font-weight: 500;
  font-size: 1rem;
  animation: fade-text 1.8s infinite ease-in-out;
}

.loading-dots.yellow-dots span {
  background: #FFC107;
}

/* --- Серые иконки по умолчанию, чёрные при наведении --- */
#toggleSidebarBtn .custom-toggle-icon,
#newChatCollapsedBtn i {
    color: #000000;
    border-color: #000000;
    transition: color 0.2s, border-color 0.2s;
}
#toggleSidebarBtn:hover .custom-toggle-icon,
#newChatCollapsedBtn:hover i {
    color: #111;
    border-color: #111;
}

.custom-toggle-icon {
    border: 2.5px solid #000;
    transition: border-color 0.2s;
}
#toggleSidebarBtn:hover .custom-toggle-icon {
    border-color: #111;
}

#toggleSidebarBtn:hover .custom-toggle-icon::before {
    background-color: #111;
}

.copy-image-container .check-icon {
    opacity: 0;
    transform: scale(0.5);
    font-size: 1.1em; /* Make checkmark slightly larger */
    color: #4CAF50; /* Green check */
}

.copy-image-container.copied .copy-icon {
    opacity: 0;
    transform: scale(0.5);
}

.copy-image-container.copied .check-icon {
    opacity: 1;
    transform: scale(1);
}

.image-wrapper {
    position: relative;
    display: inline-block; /* To wrap the image size */
    max-width: 100%;
    vertical-align: top; /* Fix alignment issue */
}

.copy-image-container {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.image-wrapper:hover .copy-image-container {
    opacity: 1;
    transform: scale(1);
}

.copy-image-container .copy-icon,
.copy-image-container .check-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.copy-image-container .copy-icon {
    opacity: 1;
    transform: scale(1);
}

.copy-image-container .check-icon {
    opacity: 0;
    transform: scale(0.5);
    font-size: 1.1em; /* Make checkmark slightly larger */
    color: #4CAF50; /* Green check */
}

.copy-image-container.copied .copy-icon {
    opacity: 0;
    transform: scale(0.5);
}

.copy-image-container.copied .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* === NEW: Styles for image block with actions below === */
.ai-image-block {
    display: inline-flex; /* Use inline-flex to wrap content */
    flex-direction: column;
    align-items: flex-start; /* Align actions to the left */
    max-width: 100%; /* Ensure it doesn't overflow the message bubble */
}

.ai-image-block .generated-image {
    /* The image itself keeps its original style */
    border: 1px solid #eee;
    border-radius: 12px;
}

.image-actions {
    display: flex;
    align-items: center;
    gap: 4px; /* Smaller gap between icons */
    padding: 8px 4px; /* Vertical padding and slight horizontal padding */
    background-color: transparent; /* No background */
    border: none; /* No border */
}

.image-action-btn {
    background-color: transparent;
    color: #6c757d; /* Grey icon color */
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* For stacking icons */
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none; /* For the 'a' tag */
}

.image-action-btn:hover {
    background-color: #f0f0f0; /* Light grey background on hover */
    color: #212529; /* Darker icon on hover */
    text-decoration: none;
}

.image-action-btn .copy-icon,
.image-action-btn .check-icon,
.image-action-btn .spinner-icon,
.image-action-btn .share-icon,
.image-action-btn .download-icon,
.image-action-btn .send-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 1rem;
}

/* Полупрозрачные иконки Telegram */
.image-action-btn .send-icon {
    opacity: 0.6;
    color: #229ED9;
}

.image-action-btn:hover .send-icon {
    opacity: 0.8;
}

/* Default state for all icons inside the button */
.image-action-btn .copy-icon,
.image-action-btn .share-icon,
.image-action-btn .download-icon { opacity: 1; transform: scale(1); }

.image-action-btn .check-icon { opacity: 0; transform: scale(0); color: #28a745; }
.image-action-btn .spinner-icon { opacity: 0; transform: scale(0); }


/* State: Copying */
.image-action-btn.copying .copy-icon,
.image-action-btn.copying .check-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.copying .spinner-icon {
    opacity: 1;
    transform: scale(1);
}

/* State: Copied */
.image-action-btn.copied .copy-icon,
.image-action-btn.copied .spinner-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.copied .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* === NEW: States for Download Button === */
/* State: Downloading */
.image-action-btn.downloading .download-icon,
.image-action-btn.downloading .check-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.downloading .spinner-icon {
    opacity: 1;
    transform: scale(1);
}

/* State: Downloaded */
.image-action-btn.downloaded .download-icon,
.image-action-btn.downloaded .spinner-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.downloaded .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* === NEW: States for Share Button === */
/* State: Sharing */
.image-action-btn.sharing .share-icon,
.image-action-btn.sharing .check-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.sharing .spinner-icon {
    opacity: 1;
    transform: scale(1);
}

/* State: Shared */
.image-action-btn.shared .share-icon,
.image-action-btn.shared .spinner-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.shared .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* === NEW: States for Telegram Button === */
/* State: Sending */
.image-action-btn.sending .send-icon,
.image-action-btn.sending .check-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.sending .spinner-icon {
    opacity: 1;
    transform: scale(1);
}

/* State: Sent */
.image-action-btn.sent .send-icon,
.image-action-btn.sent .spinner-icon {
    opacity: 0;
    transform: scale(0);
}
.image-action-btn.sent .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* === NEW: Styles for Audio Block === */
.ai-audio-block {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px; /* Space between player and button */
    margin-top: 8px; /* Add some space above the audio block */
}

.ai-audio-block audio {
    max-width: 100%;
    min-width: 280px; /* Give the player a decent minimum width */
}

/* === NEW: Action Toasts for Image Operations === */
.action-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #fff;
    color: #222;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    padding: 12px 24px;
    font-size: 1rem; /* Slightly smaller than other toasts */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 15px; /* A bit more gap */
    z-index: 100000; /* On top of everything */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(.4,0,.2,1), transform 0.4s cubic-bezier(.4,0,.2,1);
}

.action-toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.action-toast.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
}

.action-toast .toast-icon {
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(0,0,0,0.1);
}

/* Specific icon colors for each action toast */
#imageCopyToast .toast-icon {
    color: #007bff; /* Blue */
}

#imageDownloadToast .toast-icon {
    color: #28a745; /* Green */
}

#imageShareToast .toast-icon {
    color: #6f42c1; /* Indigo */
}

/* --- Анимация стриминга текста --- */
@keyframes fadeInStream {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stream-chunk {
  display: inline-block; /* Необходимо для transform */
  animation: fadeInStream 0.4s ease forwards;
}

/* Voice input styles */
#mic-btn {
    color: #6c757d;
    transition: color 0.2s ease-in-out;
}

#mic-btn:hover {
    color: #343a40;
}

#mic-btn:focus {
    outline: none;
    box-shadow: none;
}

.equalizer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
    margin-right: 8px;
}

.equalizer-bar {
    width: 4px;
    height: 100%;
    margin: 0 1px;
    background-color: #007bff;
    border-radius: 2px;
    height: 5%;
    transition: height 0.1s ease-out;
}

.equalizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.equalizer-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.equalizer-bar:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes equalize {
    0% {
        height: 5%;
    }
    50% {
        height: 100%;
    }
    100% {
        height: 5%;
    }
}

/* Voice input styles */
.mic-wrapper {
    position: relative;
    width: 24px; /* Ширина иконки */
    height: 24px; /* Высота иконки */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mic-wrapper #mic-btn,
.mic-wrapper #equalizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
}

/* Изначально иконка видна, а эквалайзер скрыт */
.mic-wrapper #mic-btn {
    opacity: 1;
    transform: scale(1);
}

.mic-wrapper #equalizer {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none; /* Не кликабельный, когда скрыт */
}

/* Когда идет запись, показываем эквалайзер и прячем иконку */
.mic-wrapper.recording #mic-btn {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

.mic-wrapper.recording #equalizer {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Стили для загрузчика аудио от пользователя */
.audio-upload-loader {
  display: flex;
  align-items: center;
  gap: 15px; /* Немного увеличим отступ */
  color: #222; /* Явно задаем цвет текста */
  font-style: normal; /* Убираем курсив */
  padding: 2px 0; /* Небольшой вертикальный отступ для центровки */
  max-width: 100%; /* Let it take full width */
}

.audio-upload-loader span {
    font-weight: 600; /* Делаем текст жирным */
    animation: fade-text 1.8s infinite ease-in-out; /* Применяем анимацию */
}

.celestial-loader {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.celestial-loader .celestial-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border: 2px solid #87CEEB; /* Небесно-голубой цвет */
    border-radius: 50%;
    opacity: 0;
    animation: celestial-pulse 2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
    box-shadow: 0 0 10px rgba(135, 206, 235, 0.6), inset 0 0 8px rgba(135, 206, 235, 0.4);
}

.celestial-loader .celestial-circle:nth-child(2) {
    animation-delay: 0.65s;
}

.celestial-loader .celestial-circle:nth-child(3) {
    animation-delay: 1.3s;
}

@keyframes celestial-pulse {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Стили для контейнера загрузчика без фона */
.user-loader-message {
    margin-left: auto;
    padding: 10px 15px;
    max-width: 70%;
}

/* НОВАЯ ОБЕРТКА ДЛЯ ПРЕВЬЮ И НАЗВАНИЯ */
.file-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px; /* Расстояние между превью и текстом */
}

.attached-image-container,
.attached-file-preview {
  position: relative;
  display: inline-block;
  vertical-align: top;
  background-color: #f0f2f5;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px; /* Размер иконки файла */
  color: #555;
}

/* НОВЫЙ СТИЛЬ: Название файла под превью */
.attached-file-name {
  font-size: 12px;
  color: #555;
  max-width: 72px; /* Та же ширина, что и у превью */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* --- Стили для превью файлов внутри сообщения пользователя --- */
.message-attachment-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px; /* Отступ, если есть и текст, и файлы */
}

.user-message .file-preview-wrapper {
  /* Стили для обертки внутри сообщения остаются теми же, что и в панели ввода */
}



/* --- НОВЫЕ СТИЛИ ДЛЯ ИНДИКАТОРА ЧТЕНИЯ ДОКУМЕНТА --- */
.document-reading-text {
  color: #6c757d; /* Приглушенный цвет текста */
  animation: blink-animation 2.5s infinite ease-in-out;
  display: block; /* Чтобы можно было применить margin */
  margin-left: -10px; /* Сдвигаем влево, компенсируя отступ для аватара */
  padding-left: 12px; /* Небольшой отступ слева для красоты */
}

@keyframes blink-animation {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* --- НОВЫЕ СТИЛИ ДЛЯ ИНДИКАТОРА РЕЖИМА ИЗОБРАЖЕНИЯ --- */
.image-mode-indicator-content {
  background-color: #f3e8ff; /* Светло-фиолетовый */
  border: 1px solid #e9d5ff;
  color: #6b21a8; /* Темно-фиолетовый */
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex; /* Чтобы блок был по ширине контента */
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

.image-mode-indicator-content .remove-mode-btn {
  cursor: pointer;
  transition: color 0.2s;
  font-size: 1rem;
  padding: 2px;
}

.image-mode-indicator-content .remove-mode-btn:hover {
  color: #4c1d95; /* Еще темнее при наведении */
}

/* --- НОВЫЕ СТИЛИ ДЛЯ ИНДИКАТОРА АУДИО-РЕЖИМОВ --- */
.audio-mode-indicator-content {
  background-color: #ffeaea; /* Светло-красный */
  border: 1px solid #ffb3b3;
  color: #b91c1c; /* Темно-красный */
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

.audio-mode-indicator-content i {
  color: #b91c1c;
  transition: color 0.2s;
}
.audio-mode-indicator-content .remove-mode-btn {
  color: #b91c1c;
}
.audio-mode-indicator-content .remove-mode-btn:hover {
  color: #7f1d1d;
}

.user-message .image-mode-indicator-content,
.user-message .audio-mode-indicator-content {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  margin: 0 auto 8px auto;
}


/* === НОВЫЕ СТИЛИ ДЛЯ КОНТЕЙНЕРА СООБЩЕНИЯ ПОЛЬЗОВАТЕЛЯ === */
.user-message-container {
    /* Убираем flex-контейнер, чтобы дочерние элементы вели себя как обычно */
    margin-left: auto; /* Сдвигаем весь блок вправо */
    max-width: 85%; /* Та же ширина, что и у .chat-message */
    margin-bottom: 15px;
}

.mode-indicator-wrapper {
    text-align: right; /* Выравниваем плашку по правому краю */
    margin-bottom: 8px; /* Отступ между плашкой и сообщением */
}

/* У сообщения внутри контейнера убираем лишние отступы, так как они на контейнере */
.user-message-container .chat-message {
    margin-bottom: 0;
    margin-top: 0;
    /* margin-left: auto; остается, чтобы оно выровнялось вправо внутри своего родителя (.user-message-container) */
}

/* === Стили для списка чатов и кнопки удаления === */
.chat-item {
  position: relative;
  /* Убедимся, что справа есть место для кнопки */
  padding-right: 65px !important; /* Увеличиваем отступ для двух иконок */
  display: flex;
  align-items: center;
  gap: 6px; /* уменьшенное пространство между иконкой и текстом */
}

/* Добавляем стили для обрезки текста в названии чата */
.chat-item > span {
    display: block;        /* текст занимает всю доступную ширину */
    flex: 1 1 auto;        /* растягиваем, чтобы перенос сохранял отступ */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-chat-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  opacity: 1; /* Крестик виден всегда */
  transition: color 0.2s ease-in-out;
  padding: 5px;
  cursor: pointer;
  font-size: 1.1rem;
}

.delete-chat-btn:hover {
  color: #dc3545 !important; /* Красный цвет при наведении */
}


/* === Стили для модального окна удаления === */
#deleteChatModal .modal-content {
  background-color: #ffffff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 16px;
}

#deleteChatModal .modal-header {
  border-bottom: none;
  padding: 8px 16px;
  position: relative;
}

#deleteChatModal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: #111;
  width: 100%;
  text-align: center;
}

#deleteChatModal .modal-header .close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 2rem;
  font-weight: 300;
  color: #888;
  text-shadow: none;
  opacity: 1;
  transition: color 0.2s;
}
#deleteChatModal .modal-header .close:hover {
    color: #111;
}

#deleteChatModal .modal-body {
  padding: 8px 16px 24px;
  text-align: center;
  color: #333;
}

#deleteChatModal .modal-footer {
    border-top: none;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px 16px;
}

#deleteChatModal .modal-footer .btn {
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    transition: all 0.2s ease;
}

#deleteChatModal .modal-footer .btn-secondary {
    background-color: #e9ecef;
    color: #495057;
}

#deleteChatModal .modal-footer .btn-secondary:hover {
    background-color: #d6d8db;
}

#deleteChatModal .modal-footer .btn-danger {
    background-color: #dc3545;
    color: #fff;
}

#deleteChatModal .modal-footer .btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* === Стили для модального окна подписки (копируем и адаптируем от #deleteChatModal) === */
#subscriptionModal .modal-content {
  background-color: #ffffff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 16px;
}

#subscriptionModal .modal-header {
  border-bottom: none;
  padding: 8px 16px;
  position: relative;
  justify-content: center;
}

#subscriptionModal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: #111;
  width: 100%;
  text-align: center;
}

#subscriptionModal .modal-body {
  padding: 8px 16px 24px;
  text-align: center;
  color: #333;
}

#subscriptionModal .modal-footer {
    border-top: none;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px 16px;
}

#subscriptionModal .modal-footer .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
}

#subscriptionModal .modal-footer .btn-primary {
    background-color: #007bff;
    color: #fff;
}
#subscriptionModal .modal-footer .btn-primary:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#subscriptionModal .modal-footer .btn-secondary {
    background-color: #e9ecef;
    color: #495057;
}

#subscriptionModal .modal-footer .btn-secondary:hover {
    background-color: #d6d8db;
}

/* === Стили для модального окна пустого ввода === */
#emptyInputModal .modal-content {
  background-color: #ffffff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 16px;
}

#emptyInputModal .modal-body {
  padding: 24px 16px;
  text-align: center;
  color: #333;
  font-size: 1.1rem;
  font-weight: 500;
}

#emptyInputModal .modal-footer {
    border-top: none;
    display: flex;
    justify-content: center;
    padding: 0 16px 16px;
}

#emptyInputModal .modal-footer .btn {
    padding: 10px 32px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    transition: all 0.2s ease;
    background-color: #007bff;
    color: #fff;
}

#emptyInputModal .modal-footer .btn:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.tools-dropdown-menu .model-select.active i.fa-check {
  opacity: 1;
}

.tools-dropdown-menu .model-select.active {
  color: #111;
  font-weight: 600;
}

.tools-dropdown-menu .model-select.disabled {
  color: #adb5bd !important;
  cursor: not-allowed;
  background-color: transparent !important;
}

.tools-dropdown-menu .model-select.disabled:hover {
    color: #adb5bd !important;
}

.tools-dropdown-menu .model-select.disabled .fa-check {
    visibility: hidden;
}

/* Стили для кнопки "Выйти" */
.profile-btn[data-action="logout"] {
  background-color: rgba(220, 53, 69, 0.08);
  color: #dc3545; /* Красный цвет текста */
}

.profile-btn[data-action="logout"] i {
  color: inherit; /* Наследуем красный цвет от родителя */
}

.profile-btn[data-action="logout"]:hover,
.profile-btn[data-action="logout"]:focus {
  background-color: rgba(220, 53, 69, 0.15); /* Более темный фон при наведении */
  color: #a71d2a; /* Более темный текст при наведении */
}

/* === Model Choice Modal Styles === */
#modelChoiceModal .modal-content {
  background-color: #ffffff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  padding: 16px;
}

#modelChoiceModal .modal-header {
  border-bottom: none;
  padding: 8px 16px;
  position: relative;
}

#modelChoiceModal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: #fff;
  width: 100%;
  text-align: center;
}

#modelChoiceModal .modal-header .close {
  position: absolute;
  top: -6px;
  right: 16px;
  font-size: 2rem;
  font-weight: 300;
  color: #bbb;
  text-shadow: none;
  opacity: 1;
  transition: color 0.2s;
}
#modelChoiceModal .modal-header .close:hover {
  color: #dc3545;
}

#modelChoiceModal .modal-body {
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.model-choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.model-choice-btn:not(.disabled) {
    background: linear-gradient(145deg, #e6f7ff, #f0faff);
    border-color: #cceeff;
}

.model-choice-btn:hover:not(.disabled) {
    transform: translateY(-4px) scale(1.03);
    background: linear-gradient(145deg, #d9f2ff, #e6f9ff);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.15);
    color: #111;
    text-decoration: none;
}

.model-choice-btn .model-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.model-choice-btn .model-name {
    font-weight: 600;
    font-size: 1rem;
    color: #222;
}

.model-choice-btn .model-description {
    font-size: 0.85rem;
    color: #666;
}

.model-choice-btn i {
    font-size: 1rem;
    color: #007bff; /* Blue for the checkmark */
}

.model-choice-btn.active {
    border-color: #007bff;
    background-color: #e6f3ff;
}

.model-choice-btn.active .model-name {
    color: #0056b3;
}

.model-choice-btn.active .model-description {
    color: #0069d9;
}

.model-choice-btn i.fa-check {
    opacity: 0;
}

.model-choice-btn.active i.fa-check {
    opacity: 1;
}

.model-choice-btn.disabled {
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #e9ecef;
    opacity: 0.7;
}

.model-choice-btn.disabled:hover {
    transform: none;
    box-shadow: none;
    background: #f8f9fa;
}

.model-choice-btn.disabled .model-name,
.model-choice-btn.disabled .model-description {
    color: #6c757d;
}

.model-choice-btn.disabled i.fa-lock {
    color: #6c757d;
}

@keyframes fade-text {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* --- Стили нового эквалайзера --- */
.modern-equalizer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 28px;
    height: 24px;
    cursor: pointer;
}

.modern-equalizer-bar {
    width: 3px;
    background-color: #8E8E93; /* Спокойный серый цвет по умолчанию */
    border-radius: 3px;
    transition: height 0.2s ease-out, background-color 0.3s ease-in-out;
}

/* Статичный вид "иконки" */
.modern-equalizer-bar:nth-child(1),
.modern-equalizer-bar:nth-child(7) { height: 30%; }

.modern-equalizer-bar:nth-child(2),
.modern-equalizer-bar:nth-child(6) { height: 50%; }

.modern-equalizer-bar:nth-child(3),
.modern-equalizer-bar:nth-child(5) { height: 75%; }

.modern-equalizer-bar:nth-child(4) { height: 100%; }


/* --- Старые стили эквалайзера (удаляем или комментируем) --- */
/*
.mic-wrapper #mic-btn {
    opacity: 1;
    transform: scale(1);
}

.mic-wrapper #equalizer {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none; 
}

.mic-wrapper.recording #mic-btn {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

.mic-wrapper.recording #equalizer {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.equalizer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
    margin-right: 8px;
}

.equalizer-bar {
    width: 4px;
    height: 100%;
    margin: 0 1px;
    background-color: #007bff;
    border-radius: 2px;
    height: 5%;
    transition: height 0.1s ease-out;
}
*/

/* Voice input styles */
#mic-btn {
    color: #6c757d;
    transition: color 0.2s ease-in-out;
    transform: scale(1);
}

/* Когда идет запись, показываем эквалайзер и прячем иконку */
.mic-wrapper.recording .modern-equalizer-bar {
   /* Стили для анимации будут управляться через JS, но можно добавить базовый цвет */
   background-color: #5856D6; /* Начальный цвет анимации */
}

/* Стили для загрузчика аудио от пользователя */
.audio-upload-loader {
  display: flex;
  align-items: center;
  gap: 15px; /* Немного увеличим отступ */
  color: #222; /* Явно задаем цвет текста */
  font-style: normal; /* Убираем курсив */
  padding: 2px 0; /* Небольшой вертикальный отступ для центровки */
  max-width: 100%; /* Let it take full width */
}

.audio-upload-loader span {
    font-weight: 600; /* Делаем текст жирным */
    animation: fade-text 1.8s infinite ease-in-out; /* Применяем анимацию */
}

.celestial-loader {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.celestial-loader .celestial-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border: 2px solid #87CEEB; /* Небесно-голубой цвет */
    border-radius: 50%;
    opacity: 0;
    animation: celestial-pulse 2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
    box-shadow: 0 0 10px rgba(135, 206, 235, 0.6), inset 0 0 8px rgba(135, 206, 235, 0.4);
}

.celestial-loader .celestial-circle:nth-child(2) {
    animation-delay: 0.65s;
}

.celestial-loader .celestial-circle:nth-child(3) {
    animation-delay: 1.3s;
}

@keyframes celestial-pulse {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Стили для контейнера загрузчика без фона */
.user-loader-message {
    margin-left: auto;
    padding: 10px 15px;
    max-width: 70%;
}

/* НОВАЯ ОБЕРТКА ДЛЯ ПРЕВЬЮ И НАЗВАНИЯ */
.file-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px; /* Расстояние между превью и текстом */
}

.task-management-section {
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    margin-top: 40px;
    border-radius: .25rem;
}

.task-management-section .list-group-item {
    border-left: none !important;
}

.task-management-section .tasks-btn-blue {
    border-left-color: #007bff; /* Blue */
}

.task-management-section .editor-btn {
    border-left-color: #E83E8C; /* Pink */
}

.task-management-section .notes-btn {
    border-left-color: #ffc107; /* Yellow */
}

.task-management-section .calendar-btn-green {
    border-left-color: #dc3545; /* Red */
}

.task-management-section .finance-btn-gold {
    border-left-color: #28a745; /* Green */
}

/* Voice Input Styles */
#voiceInputBtn {
  color: #6c757d;
  padding: 0.375rem 0.5rem;
  transition: color 0.2s ease-in-out;
  position: relative;
  width: 38px; /* Fixed width to prevent layout shifts */
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#voiceInputBtn:hover {
    color: #343a40;
}

.voice-icon-mic {
  display: block;
}

.voice-icon-equalizer {
  display: none;
  align-items: center;
  height: 15px;
}

#voiceInputBtn.recording .voice-icon-mic {
  display: none;
}

#voiceInputBtn.recording .voice-icon-equalizer {
  display: flex;
}

.voice-icon-equalizer span {
  width: 3px;
  height: 5px;
  background-color: #007bff;
  display: inline-block;
  margin: 0 1px;
  animation: equalize 0.8s infinite ease-in-out;
}

.voice-icon-equalizer span:nth-child(2) {
  animation-delay: 0.2s;
}
.voice-icon-equalizer span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes equalize {
  0%, 100% {
    height: 5px;
  }
  50% {
    height: 15px;
  }
}

.voice-visualizer-container {
  height: 40px;
  padding: 5px 0;
  margin-bottom: 5px;
  background-color: rgba(248, 249, 250, 0.5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#voiceVisualizer {
  width: 100%;
  height: 30px;
}

/* Transcription Loader Styles */
.transcribing-message {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-radius: 12px;
  margin: 8px 0;
  max-width: 70%;
  align-self: flex-start;
  color: #6c757d;
  font-style: italic;
}

.transcribing-message .loader {
  width: 15px;
  height: 15px;
  border: 2px solid #ced4da;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


#toolsDropdownBtn:focus {
    box-shadow: none;
}

#promptTasksBtn,
#toolsDropdownBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 40px;
    color: #000;
    left: 7px;
    top: 1px;
}

#promptTasksBtn:hover,
#toolsDropdownBtn:hover {
    color: #333;
    text-decoration: none;
}

.tools-dropdown-menu .dropdown-item i.fa-lightbulb {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

#promptTasksBtn .fa-clipboard-list {
    transform: translateY(1.3px);
    display: inline-block;
}

#promptTasksBtn:focus {
    outline: none !important;
    box-shadow: none !important;
}

#toolsDropdownBtn:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* === Универсальный класс для выравнивания иконок в prompt === */
.icon-btn,
.prompt-inner i,
.prompt-inner svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    width: 25px;
    height: 22px;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* Для svg-иконки скрепки */
.attachment-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-bottom: 0 !important;
}

/* Сдвиг кнопки инструментов чуть правее */
#toolsDropdownBtn.icon-btn {
    margin-left: 6px;
}

/* --- Prompt icons toggle and group --- */
.prompt-icons-group {
  width: 0;
  min-width: 0;
  max-width: 0;
  margin-right: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
  transition: width 0.3s, min-width 0.3s, max-width 0.3s, margin-right 0.3s, opacity 0.3s, transform 0.3s;
}
.prompt-inner.icons-expanded .prompt-icons-group {
  width: auto;
  min-width: 120px; /* или подберите под ваши иконки */
  max-width: 300px;
  margin-right: 8px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  overflow: visible;
}

.prompt-icons-toggle {
  transition: transform 0.3s;
  z-index: 2;
}
.prompt-inner.icons-expanded .prompt-icons-toggle i {
  transform: rotate(180deg);
}
.prompt-icons-toggle i {
  transform: rotate(0deg);
  transition: transform 0.3s;
}
/* --- End prompt icons toggle --- */

/* --- Prompt icons toggle and group (дополнение) --- */
.prompt-icons-toggle {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  color: #222;
  padding: 0;
}
.prompt-icons-toggle:focus {
  outline: none !important;
  box-shadow: none !important;
}
.prompt-inner.icons-expanded .prompt-icons-toggle {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.prompt-inner.icons-expanded .prompt-icons-toggle:focus {
  outline: none !important;
  box-shadow: none !important;
}
.prompt-inner.icons-expanded .prompt-icons-toggle i {
  color: #222;
}
/* Если используются две иконки, можно скрыть одну из них, но у нас одна иконка, просто переворачиваем */

/* --- Убираем подчеркивание под стрелкой --- */
.prompt-icons-toggle i {
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
  background: none !important;
  line-height: 1 !important;
  margin-bottom: 0 !important;
}

/* --- Убираем подчеркивание под стрелкой во всех состояниях --- */
.prompt-icons-toggle,
.prompt-icons-toggle:focus,
.prompt-icons-toggle:active,
.prompt-icons-toggle:hover {
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: none !important;
}
.prompt-icons-toggle i,
.prompt-icons-toggle:focus i,
.prompt-icons-toggle:active i,
.prompt-icons-toggle:hover i {
  text-decoration: none !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

/* --- Красная шапка и белый футер для модального окна удаления --- */
#deleteChatModal .modal-header.bg-danger,
#deleteChatModal .modal-header {
  background-color: #dc3545 !important;
  color: #fff;
  border-bottom: none;
}
#deleteChatModal .modal-footer {
  background: none !important;
  background-color: #fff !important;
}

#deleteChatModal .modal-header .modal-title {
  color: #fff !important;
}

.prompt-inner {
    background: #fff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 28px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px 20px !important;
    position: relative;
}

.prompt-icons-toggle { pointer-events: auto !important; }

/* Убрать лишний padding-right у textarea в prompt bar */
.prompt-inner textarea.form-control {
  padding-right: 0 !important;
}

/* Убрать gap между textarea и кнопками, если есть */
.d-flex.align-items-center.w-100 {
  gap: 8px !important; /* Устанавливаем или убеждаемся, что gap есть и равен 8px */
}

/* Оставить только небольшой margin-left у первой кнопки, если нужно */
#voiceInputBtn {
  /* margin-left: 8px !important; */ /* Удален, так как gap теперь управляет отступами */
}

/* У кнопки отправки margin-left убрать */
.prompt-inner button[type="submit"] {
  margin-left: 0 !important;
}

#chat-list-container {
  max-height: none !important;
  overflow-y: auto;
  /* Кастомный синий скроллбар */
}
#chat-list-container::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
#chat-list-container::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom right, #4d7fff 0%, #1a56ff 100%);
  border-radius: 6px;
}
#chat-list-container::-webkit-scrollbar-track {
  background: #f5f7fa;
  border-radius: 6px;
  box-shadow: inset 0 0 2px 2px #e0e7ef;
}
#chat-list-container {
  scrollbar-width: thin;
  scrollbar-color: #1a56ff #f5f7fa;
}

.tools-dropdown-menu.open-right {
  left: 110% !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
}

.prompt-inner.icons-expanded .prompt-icons-toggle i {
  transform: rotate(90deg);
  transition: transform 0.3s;
}

.tasks-btn-blue {
    /* background: rgba(37, 99, 235, 0.12) !important; */
    color: #444 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.tasks-btn-blue i {
    color: #444 !important;
    transition: color 0.2s;
}
.tasks-btn-blue:hover, .tasks-btn-blue:focus {
    background: #2563eb !important;
    color: #fff !important;
    text-decoration: none;
}
.tasks-btn-blue:hover i, .tasks-btn-blue:focus i {
    color: #fff !important;
}

.notes-btn {
    /* background: rgba(251, 191, 36, 0.13) !important; */
    color: #444 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.notes-btn i {
    color: #444 !important;
    transition: color 0.2s;
}
.notes-btn:hover, .notes-btn:focus {
    background: #fbbf24 !important;
    color: #fff !important;
    text-decoration: none;
}
.notes-btn:hover i, .notes-btn:focus i {
    color: #fff !important;
}

.calendar-btn {
    /* background: rgba(239, 68, 68, 0.13) !important; */
    color: #444 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.calendar-btn i {
    color: #444 !important;
    transition: color 0.2s;
}
.calendar-btn:hover, .calendar-btn:focus {
    background: #ef4444 !important;
    color: #fff !important;
    text-decoration: none;
}
.calendar-btn:hover i, .calendar-btn:focus i {
    color: #fff !important;
}

.finance-btn {
    /* background: rgba(34, 197, 94, 0.13) !important; */
    color: #444 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.finance-btn i {
    color: #444 !important;
    transition: color 0.2s;
}
.finance-btn:hover, .finance-btn:focus {
    background: #22c55e !important;
    color: #fff !important;
    text-decoration: none;
}
.finance-btn:hover i, .finance-btn:focus i {
    color: #fff !important;
}

.prompt-inner .prompt-icons-toggle i {
  transform: rotate(0deg); /* по умолчанию влево */
  transition: transform 0.3s;
}

.prompt-inner.icons-expanded .prompt-icons-toggle i {
  transform: rotate(180deg); /* открыто — вправо */
}

.sidebar-search-input {
  background: #f3f3f3;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  color: #333;
  font-size: 0.98rem;
  padding: 8px 14px;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sidebar-search-input:focus {
  border-color: #bdbdbd;
  box-shadow: 0 0 0 2px #e0e0e0;
  background: #f7f7f7;
  color: #222;
}

.sidebar-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-search-icon {
  position: absolute;
  left: 14px;
  color: #b0b0b0;
  font-size: 1.1em;
  pointer-events: none;
  z-index: 2;
}
.sidebar-search-input {
  padding-left: 36px;
}

.bookmark-icon {
    position: absolute;
    top: 50%;
    right: 40px; /* Позиционируем слева от кнопки удаления */
    transform: translateY(-50%);
    color: #bbb;
    /* margin-left: 8px; - Больше не нужен */
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1.1em;
}
.bookmark-icon.bookmarked {
    color: #42d3ff !important;
}
.bookmark-icon.bookmarked:hover {
    color: #42d3ff !important;
}
.bookmark-icon:hover:not(.bookmarked) {
    color: #888;
}

.sidebar-fav-filter-icon {
    position: absolute;
    left: 10px;
    color: #bbb;
    font-size: 1.1em;
    cursor: pointer;
    z-index: 3;
    transition: color 0.2s;
}
.sidebar-fav-filter-icon.active {
    color: #42d3ff;
}
.sidebar-search-input {
    padding-left: 56px;
}
.sidebar-search-icon {
    left: 32px;
}

/* === Цвета для активных инструментов === */
.prompt-icons-group .icon-btn i,
.prompt-icons-group .icon-btn svg {
    color: #b0b0b0 !important;
    transition: color 0.2s;
}
#webSearchBtn.active i { color: #007bff !important; }
#thinkLongerBtn.active i { color: #FFC107 !important; }
#createImageBtn.active i { color: #9333ea !important; }
#textToAudioBtn.active i,
#audioToTextBtn.active i { color: #dc3545 !important; }

#webSearchBtn.active.special-green i,
#thinkLongerBtn.active.special-green i {
    color: #28a745 !important;
}

/* Убираем синюю обводку у всех кнопок инструментов */
.prompt-icons-group .icon-btn:focus,
.prompt-icons-group .icon-btn:active,
.prompt-icons-group .icon-btn {
    outline: none !important;
    box-shadow: none !important;
}

#emptyInputModal .modal-footer {
    background: none !important;
}

.profile-btn[data-action="support"] i {
    color: #229ED9 !important;
}

.profile-btn[data-action="logout"] {
    color: #888 !important;
    background: none !important;
    transition: color 0.2s, background 0.2s;
}
.profile-btn[data-action="logout"]:hover, .profile-btn[data-action="logout"]:focus {
    color: #fff !important;
    background: #dc3545 !important;
}
.profile-btn[data-action="logout"] i {
    color: #888 !important;
    transition: color 0.2s;
}
.profile-btn[data-action="logout"]:hover i, .profile-btn[data-action="logout"]:focus i {
    color: #fff !important;
}

.prompt-icons-group .icon-btn,
.prompt-icons-group .icon-btn:focus,
.prompt-icons-group .icon-btn:hover {
    text-decoration: none !important;
    box-shadow: none !important;
}

/* --- Action Toast: Telegram отправка изображения --- */
#imageTelegramToast {
    background: linear-gradient(90deg, #e3f2fd 60%, #ffffff 100%);
    color: #1976d2;
    border: 1.5px solid #90caf9;
    box-shadow: 0 4px 24px rgba(33, 150, 243, 0.10);
    font-weight: 600;
}
#imageTelegramToast .toast-icon {
    color: #229ED9;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(33, 150, 243, 0.18);
    margin-right: 10px;
    filter: drop-shadow(0 0 4px #b3e5fc);
}
#imageTelegramToast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1.04);
    box-shadow: 0 6px 32px rgba(33, 150, 243, 0.13);
    border-color: #42a5f5;
}
#imageTelegramToast.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px) scale(0.98);
}

/* --- Action Toast: Telegram отправка аудио --- */
#audioTelegramToast {
    background: linear-gradient(90deg, #e3f2fd 60%, #ffffff 100%);
    color: #1976d2;
    border: 1.5px solid #90caf9;
    box-shadow: 0 4px 24px rgba(33, 150, 243, 0.10);
    font-weight: 600;
}
#audioTelegramToast .toast-icon {
    color: #229ED9;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(33, 150, 243, 0.18);
    margin-right: 10px;
    filter: drop-shadow(0 0 4px #b3e5fc);
}
#audioTelegramToast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1.04);
    box-shadow: 0 6px 32px rgba(33, 150, 243, 0.13);
    border-color: #42a5f5;
}
#audioTelegramToast.hide {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px) scale(0.98);
}

#deleteAllChatsModal .modal-footer {
    background: #fff !important;
}

.notes-btn {
    /* background: rgba(251, 191, 36, 0.13) !important; */
    color: #000000 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.notes-btn:hover, .notes-btn:focus {
    background: #fbbf24 !important;
    color: #fff !important;
    text-decoration: none;
}

.calendar-btn {
    /* background: rgba(239, 68, 68, 0.13) !important; */
    color: #000000 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.calendar-btn:hover, .calendar-btn:focus {
    background: #ef4444 !important;
    color: #fff !important;
    text-decoration: none;
}

.finance-btn {
    /* background: rgba(34, 197, 94, 0.13) !important; */
    color: #000000 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.finance-btn:hover, .finance-btn:focus {
    background: #22c55e !important;
    color: #fff !important;
    text-decoration: none;
}

/* Исправление для кликабельности кнопок в модальных окнах */
.modal,
.modal-content,
.audio-choice-btn {
    pointer-events: auto !important;
}

#clearAllChatsBtn .fa-trash {
    color: #dc3545 !important; /* Красный Bootstrap */
    transition: color 0.2s;
}
#clearAllChatsBtn:hover .fa-trash,
#clearAllChatsBtn:focus .fa-trash {
    color: #a71d2a !important; /* Темнее при наведении */
}

#clearAllChatsBtn,
.clear-history-btn {
  color: #888 !important;
  font-weight: 400 !important;
  text-align: center;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 6px 18px 6px 18px;
  margin: 0;
  transition: color 0.2s;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none !important;
  margin-top: 5px;
}
#clearAllChatsBtn:hover,
.clear-history-btn:hover,
#clearAllChatsBtn:focus,
.clear-history-btn:focus {
  color: #555 !important;
  text-decoration: underline !important;
  background: none !important;
}

/* Toast Notifications */
#toast-container {
    position: absolute; /* Changed from fixed to absolute */
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-left: 5px solid #4CAF50; /* Default to success */
    pointer-events: auto;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.success {
    border-left-color: #4CAF50; /* Green for success */
}
.toast-notification.success .fas {
    color: #4CAF50;
}

.toast-notification.error {
    border-left-color: #f44336; /* Red for error */
}

.toast-notification.error .fas {
    color: #f44336;
}

.toast-notification .fas {
    font-size: 1.2em;
}

.clear-history-btn {
    border: none;
    border-bottom: 2px solid #e0e0e0;
    background: none;
    box-shadow: none;
    outline: none;
    margin-top: 18px;
    padding-bottom: 6px;
    text-align: center;
    width: 100%;
    font-weight: 500;
    font-size: 1.08em;
    display: block;
    color: #888 !important;
    border-radius: 0;
    transition: none;
    cursor: pointer;
}

.sidebar-add-plus {
  margin-left: auto;;
  color: #b0b0b0;
  font-size: 1.1em;
  transition: color 0.2s, transform 0.18s;
  /* pointer-events: none;  убираем, чтобы кнопка была кликабельна */
  background: none;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  cursor: pointer;
  margin-right: -45px !important;
}
.tasks-btn-blue:hover .sidebar-add-plus,
.notes-btn:hover .sidebar-add-plus {
  color: #fff;
}
.sidebar-add-plus:hover, .sidebar-add-plus:focus {
  transform: scale(1.25);
  color: #fff;
}

.sidebar-controls {
    padding: 5px 16px 15px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 10px;
}

#deleteAllChatsModal .modal-footer {
    background: #fff !important;
}

.notes-btn {
    /* background: rgba(251, 191, 36, 0.13) !important; */
    color: #000000 !important;
    border-radius: 0;
    font-weight: 400 !important;
    transition: background 0.2s, color 0.2s;
}
.notes-btn:hover, .notes-btn:focus {
    background: #fbbf24 !important;
    color: #fff !important;
    text-decoration: none;
}

#clearAllChatsBtn:focus,
.clear-history-btn:focus {
  color: #333 !important;
  text-decoration: none !important;
  background-color: #f0f0f0 !important;
}

/* Toast Notifications */
#toast-container {
    position: absolute; /* Changed from fixed to absolute */
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-left: 5px solid #4CAF50; /* Default to success */
    pointer-events: auto;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.success {
    border-left-color: #4CAF50; /* Green for success */
}
.toast-notification.success .fas {
    color: #4CAF50;
}

.toast-notification.error {
    border-left-color: #f44336; /* Red for error */
}

.toast-notification.error .fas {
    color: #f44336;
}

.toast-notification .fas {
    font-size: 1.2em;
}

.clear-history-btn {
  color: #6c757d !important;
  font-weight: 500 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 8px 12px;
  margin: 0 auto;
  transition: color 0.2s, background-color 0.2s;
  font-size: 0.9rem;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  width: 100%;
  justify-content: center;
}
.clear-history-btn:hover,
.clear-history-btn:focus {
    color: #343a40 !important;
    text-decoration: none !important;
    background-color: #f0f0f0 !important;
}

.task-management-section .list-group-item {
    transition: background-color 0.2s ease-in-out;
}

.task-management-section .tasks-btn-blue:hover {
    background-color: rgba(0, 123, 255, 0.15); /* Blue */
}

.task-management-section .editor-btn:hover {
    background-color: rgba(232, 62, 140, 0.15); /* Pink */
}

.task-management-section .notes-btn:hover {
    background-color: rgba(255, 193, 7, 0.15); /* Yellow */
}

.task-management-section .calendar-btn-green:hover {
    background-color: rgba(220, 53, 69, 0.15); /* Red */
}

.task-management-section .finance-btn-gold:hover {
    background-color: rgba(40, 167, 69, 0.15); /* Green */
}

.card-description {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
  word-wrap: break-word; /* Ensure long descriptions wrap */
}

@media (max-width: 600px) {
  .suggestion-card-row {
    gap: 15px; /* Match container gap */
  }

  .suggestion-card {
    padding: 12px 16px; /* Adjust padding for smaller cards */
  }
  .suggestion-card .card-title {
    font-size: 0.9rem; /* Smaller title */
  }
  .suggestion-card .card-description {
    font-size: 0.75rem; /* Smaller description */
  }
}

/* --- Override: unified hover effect for Tasks and Notes --- */
.tasks-btn-blue:hover,
.tasks-btn-blue:focus {
  background-color: rgba(0, 123, 255, 0.15) !important; /* Полупрозрачный синий */
  color: #222 !important;
}
.tasks-btn-blue:hover i,
.tasks-btn-blue:focus i {
  color: #222 !important;
}

.notes-btn:hover,
.notes-btn:focus {
  background-color: rgba(255, 193, 7, 0.15) !important; /* Полупрозрачный жёлтый */
  color: #222 !important;
}
.notes-btn:hover i,
.notes-btn:focus i {
  color: #222 !important;
}

/* --- Layout tweak: clear history button next to tasks menu --- */
.sidebar-controls {
  padding-bottom: 0 !important;
}
.task-management-section {
  margin-top: 0 !important;
}
#chat-list-container {
  max-height: none !important;
}

/* --- Жирная иконка домика в хедере --- */
#newChatCollapsedBtn img[alt="Главная"] {
  filter: drop-shadow(0 0 0 #000) contrast(1.2);
  stroke-width: 3px;
}
#newChatCollapsedBtn .fa-home, #newChatCollapsedBtn i.fa-home {
  font-weight: 900 !important;
  stroke-width: 3px;
}

/* --- Scroll fix: apply only in active chat, not in welcome screen --- */
.chat-area:not(.pre-chat) .chat-messages {
    min-height: 0;           /* allow flex child to shrink, so scrolling works */
    -webkit-overflow-scrolling: touch; /* smooth scroll on mobile */
}

/* --- Scroll fix: enable scrollbar on inner wrapper (active chat only) --- */
.chat-area:not(.pre-chat) .chat-inner {
    max-height: 100%;          /* respect parent height */
    overflow-y: auto;          /* real scrolling here */
    min-height: 0;             /* allow shrink */
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
    scrollbar-width: none;     /* Firefox hide bar */
}
.chat-area:not(.pre-chat) .chat-inner::-webkit-scrollbar {
    display: none;             /* Chrome, Safari hide bar */
}


/* --- Custom overrides: sidebar layout adjustments (moved tasks up, remove line) --- */
.sidebar .task-management-section {
    margin-top: 40px !important; /* небольшой отступ сверху */
}

.sidebar-controls {
    border-bottom: none !important; /* убираем нижнюю серую линию */
    margin-bottom: 0 !important;    /* убираем дополнительный отступ */
}

/* === Modern Sidebar Redesign === */

/* 1. Main Navigation Section */
.task-management-section {
  padding: 0 12px; /* Add horizontal padding to the container */
  margin-top: 45px !important;
}

.task-management-section .list-group-item {
  border-radius: 8px !important;
  margin-bottom: 4px;
  padding: 12px 16px !important;
  font-weight: 500 !important;
  color: #344054 !important; /* Dark grey text */
  border: none !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.task-management-section .list-group-item i {
  color: #667085 !important; /* Medium grey icon */
  font-size: 1rem;
  width: 20px;
  text-align: center;
  margin-right: 12px !important;
  transition: color 0.2s ease;
}

/* Remove all specific color classes */
.tasks-btn-blue, .notes-btn, .editor-btn, .calendar-btn-green, .finance-btn-gold,
.tasks-btn-blue:hover, .notes-btn:hover, .editor-btn:hover, .calendar-btn-green:hover, .finance-btn-gold:hover {
  background: transparent !important;
}

.task-management-section .list-group-item:hover {
  background-color: #F9FAFB !important; /* Very light grey on hover */
  color: #1D2939 !important; /* Darker text on hover */
  text-decoration: none;
}

.task-management-section .list-group-item:hover i {
  color: #1D2939 !important;
}


/* 2. Search Bar */
.sidebar-search-messages {
    padding: 16px 16px 8px 16px !important;
}
.sidebar-search-input {
  background: #F9FAFB !important;
  border: 1px solid #F9FAFB !important;
  border-radius: 8px !important;
  color: #1D2939 !important;
  font-size: 0.9rem !important;
  font-weight: 500;
  padding: 10px 16px 10px 38px !important;
  box-shadow: none !important;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.sidebar-search-input:focus {
  border-color: #D0D5DD !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px #F2F4F7 !important;
}
.sidebar-search-input::placeholder {
    color: #667085;
    font-weight: 400;
}
.sidebar-search-input-wrapper {
  position: relative;
}
.sidebar-search-icon {
  left: 14px !important;
  color: #98A2B3 !important;
  font-size: 1rem !important;
}

.sidebar-fav-filter-icon {
    position: absolute;
    right: 10px !important;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    color: #98A2B3;
    font-size: 1rem !important;
    cursor: pointer;
    z-index: 3;
    transition: color 0.2s;
}
.sidebar-fav-filter-icon.active {
    color: #007bff; /* Keep blue for active filter */
}
.sidebar-search-input {
    padding-left: 38px !important;
    padding-right: 38px !important;
}


/* 3. Chat History List */
.chat-list {
    padding: 0 12px;
}
.chat-list .chat-item {
  border-radius: 8px !important;
  margin-bottom: 2px;
  padding: 10px 16px !important;
  padding-right: 70px !important; /* Make space for icons */
  border-bottom: 1px solid #F2F4F7; /* Subtle separator */
  transition: background-color 0.2s ease;
}
.chat-list .chat-item:last-child {
    border-bottom: none; /* No separator for the last item */
}

.chat-list .chat-item:hover {
  background-color: #F9FAFB !important;
}

/* Style for the currently active chat item */
.chat-list .chat-item.active {
    background-color: #F5F7FA !important;
    border: 1px solid transparent !important;
    border-bottom: 1px solid #E4E8EE !important;
}
.chat-list .chat-item.active .chat-title {
    color: #1D2939 !important;
    font-weight: 600;
}
.chat-list .chat-item.active .chat-icon {
    color: #2563EB !important;
}

.chat-list .chat-item .bookmark-icon,
.chat-list .chat-item .delete-chat-btn {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease, color 0.2s ease;
}
.chat-list .chat-item:hover .bookmark-icon,
.chat-list .chat-item:hover .delete-chat-btn {
    opacity: 1;
    visibility: visible;
}

.delete-chat-btn {
  right: 16px !important;
  color: #98A2B3 !important;
}
.delete-chat-btn:hover {
  color: #D92D20 !important; /* Red on hover */
}
.bookmark-icon {
    right: 44px !important;
    color: #98A2B3 !important;
}
.bookmark-icon:hover {
    color: #007bff !important;
}
.bookmark-icon.bookmarked,
.bookmark-icon.bookmarked:hover {
    color: #007bff !important;
}

/* 4. Clear History Button */
.sidebar-controls {
    padding: 8px 12px !important; /* Make the container smaller */
    border-top: 1px solid #F2F4F7; /* Add separator line back */
    margin-top: auto;
    margin-bottom: 0 !important;
}
.clear-history-btn {
  background-color: transparent !important;
  color: #667085 !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important; /* Smaller font */
  border-radius: 8px !important;
  padding: 8px 10px !important; /* Smaller padding */
  transition: all 0.2s ease !important;
  width: 100%;
  justify-content: center; /* Align content to the center */
  gap: 10px !important;
}
.clear-history-btn i {
  color: #98A2B3 !important;
  font-size: 0.9rem; /* Smaller icon */
  transition: color 0.2s ease;
}
.clear-history-btn:hover {
  background-color: #FEF3F2 !important;
  color: #D92D20 !important;
  text-decoration: none !important;
}
.clear-history-btn:hover i {
    color: #D92D20 !important;
}

/* === Sidebar Nav Enhancements === */
.task-management-section .list-group-item {
    position: relative;
    overflow: hidden; /* for left accent bar */
}
/* Left accent bar for active item */
.task-management-section .list-group-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2563EB; /* blue accent */
}

/* Hover subtle elevation */
.task-management-section .list-group-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

/* Icon subtle scale on hover */
.task-management-section .list-group-item:hover i {
    transform: scale(1.05);
}
.task-management-section .list-group-item i {
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Search input refinement */
.sidebar-search-input {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.sidebar-search-input:focus {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 0 0 4px rgba(37,99,235,0.15) !important;
}

/* Remove default blue focus border from chat items */
.chat-list .chat-item:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}
.chat-list .chat-item.active:focus {
    border-color: transparent !important;
}

/* === Sidebar Search Focus — modern blue outline === */
.sidebar-search-input:focus {
    border-color: #2563EB !important;              /* vivid blue border */
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important; /* subtle 2-px glow */
}

/* Remove blue background from active nav list items */
.task-management-section .list-group-item.active,
.task-management-section .list-group-item.active:focus,
.task-management-section .list-group-item.active:hover {
    background-color: #ffffff !important; /* White background */
    border-color: transparent !important; /* Remove blue border */
    color: #1D2939 !important;            /* Dark text */
}

/* === Glassmorphism Sidebar Final Overrides === */
.sidebar-search-input {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
.sidebar-search-input:focus {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.60) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.40) !important;
}
.sidebar-search-input::placeholder {
  color: rgba(255, 255, 255, 0.80) !important;
}
.sidebar-search-icon,
.sidebar-fav-filter-icon {
  color: #ffffff !important;
}
.sidebar-fav-filter-icon.active {
  color: #ffffff !important;
}

/* Chat list */
.chat-list .chat-item {
  color: #ffffff !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}
.chat-list .chat-item:hover,
.chat-list .chat-item.active {
  background: rgba(255, 255, 255, 0.15) !important;
}
.chat-list .chat-item i,
.chat-list .chat-item .bookmark-icon,
.chat-list .chat-item .delete-chat-btn,
.chat-history-label i {
  color: #ffffff !important;
}
.chat-list .chat-item .bookmark-icon.bookmarked {
  color: #ffd700 !important; /* gold for bookmarked */
}

/* Nav list links and icons */
.task-management-section .list-group-item,
.task-management-section .list-group-item i,
.sidebar .nav-link {
  color: #ffffff !important;
}
.task-management-section .list-group-item:hover,
.task-management-section .list-group-item.active {
  background: rgba(255, 255, 255, 0.15) !important;
}
.task-management-section .list-group-item.active::before {
  background: rgba(255, 255, 255, 0.90) !important;
}

/* === Adjust icon default colors and hover === */
.sidebar .nav-link i,
.task-management-section .list-group-item i,
.chat-list .chat-item i,
.sidebar-controls .clear-history-btn i {
  color: rgba(255, 255, 255, 0.75) !important;
  transition: color 0.2s ease;
}
.sidebar .nav-link:hover i,
.sidebar .nav-link.active i,
.task-management-section .list-group-item:hover i,
.task-management-section .list-group-item.active i,
.chat-list .chat-item:hover i,
.chat-list .chat-item.active i,
.sidebar-controls .clear-history-btn:hover i {
  color: #ffffff !important;
}

/* Clear history button text */
.sidebar-controls .clear-history-btn {
  color: #ffffff !important;
}
.sidebar-controls .clear-history-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Footer glassmorphism */
.sidebar-footer {
  background: rgba(13, 110, 253, 0.20) !important;
  backdrop-filter: blur(14px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
  overflow: visible !important; /* allow icons to float outside */
}
/* Let floating icons cover entire sidebar */
.sidebar-footer #floating-icons-container {
  position: fixed !important;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Active chat item icon & title white */
.chat-list .chat-item.active .chat-icon,
.chat-list .chat-item.active .chat-title {
  color: #ffffff !important;
}

/* Clear history text white */
.sidebar-controls .clear-history-btn span {
  color: #ffffff !important;
}

/* Ensure nav list item hover keeps white text */
.task-management-section .list-group-item:hover,
.task-management-section .list-group-item:hover i {
  color: #ffffff !important;
}

/* Bookmark icon colour */
.bookmark-icon.bookmarked,
.bookmark-icon.bookmarked:hover {
  color: #ffffff !important;
}

/* Force bookmarked icon white, override gold */
.chat-list .chat-item .bookmark-icon.bookmarked,
.chat-list .chat-item:hover .bookmark-icon.bookmarked {
  color: #ffffff !important;
}

/* === Fix: Make clear-history panel always visible === */
.sidebar-controls {
    position: sticky !important; /* stay inside sidebar but stick to bottom */
    bottom: 2px !important;     /* height of footer so it sits right above */
    z-index: 3 !important;       /* above floating icons */
}

/* --- Ensure icon + caption are always visible in clear history button --- */
.sidebar-controls .clear-history-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}
.sidebar-controls .clear-history-btn i {
    font-size: 1rem !important;
}

/* === Toast container reposition to top center === */
#toastContainer {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* Toast base style (mirrors existing but generic) */
.toast {
  background-color: #fff;
  color: #333;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: auto;
  max-width: 320px; /* prevent excessive width/height */
  max-height: 65px;      /* let height fit content */
  flex-wrap: nowrap; /* keep content on one line */
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Success variant (green) already defaulted via JS maybe) */
.toast-success {
  border-left: 4px solid #28a745;
}

/* === New: Danger (red) variant === */
.toast-danger {
  border-left: 4px solid #dc3545;
  background: #fef2f2; /* light red */
  color: #b71c1c;
}
.toast-danger .fas {
  color: #dc3545;
}

.ai-text-actions {
    padding: 4px 4px 0 4px; /* меньший отступ сверху */
}

.text-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 0 4px;
    background: transparent;
    margin-top: -22px;
    margin-left: -10px;
}

/* Гарантируем, что текст пользователя тоже не выходит */
.user-text-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
 }

/* --- FIX: режим-индикатор не должен закрывать остальные элементы --- */
#image-mode-indicator,
#audio-mode-indicator {
    pointer-events: none; /* пропуск кликов мимо */
}
#image-mode-indicator .image-mode-indicator-content,
#audio-mode-indicator .audio-mode-indicator-content {
    pointer-events: auto; /* клики работают только по самому контенту */
}

/* --- Fix: Align send button in pre-chat when attachments are present --- */
.chat-area.pre-chat .prompt-inner button[type="submit"] {
  position: static !important;  /* remove absolute positioning */
  right: auto !important;
  top: auto !important;
  transform: none !important;
}

/* Стили для модального окна команд бота */
#botCommandsModal .modal-content {
  border-radius: 15px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

#botCommandsModal .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
}

#botCommandsModal .modal-title {
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
}

#botCommandsModal .modal-header .close {
  color: white;
  opacity: 0.8;
  font-size: 1.5rem;
  transition: opacity 0.3s ease;
}

#botCommandsModal .modal-header .close:hover {
  opacity: 1;
  color: white;
}

#botCommandsModal .modal-body {
  padding: 20px;
  background: transparent;
}

.bot-command-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bot-command-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bot-command-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.bot-command-item .command-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.bot-command-item .command-icon i {
  color: white;
  font-size: 18px;
}

.bot-command-item .command-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bot-command-item .command-name {
  font-weight: 600;
  font-size: 1rem;
  color: white;
  margin-bottom: 4px;
}

.bot-command-item .command-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.3;
}

/* NEW: Scroll navigation buttons */
.scroll-nav-btn {
  position: fixed;
  left: 20px;
  width: 35px;
  height: 35px;
  background: linear-gradient(135deg, rgba(24, 135, 255, 0.7), rgba(79, 164, 255, 0.37));
  border-radius: 50%;
  display: none; /* Изначально скрыты */
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: scale(0.8);
  border: none;
  backdrop-filter: blur(10px);
  pointer-events: none; /* Отключаем взаимодействие когда скрыты */
}

.scroll-nav-btn.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto; /* Включаем взаимодействие когда показаны */
}

.scroll-nav-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(24, 135, 255, 0.3);
  background: linear-gradient(135deg, rgba(24, 135, 255, 0.8), rgba(79, 164, 255, 0.5));
}

.scroll-nav-btn:active {
  transform: scale(0.95);
}

.scroll-to-top,
.scroll-to-bottom {
  bottom: 140px; /* Одинаковая позиция для обеих стрелок */
}

/* Анимация появления */
@keyframes scrollBtnFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.scroll-nav-btn.fade-in {
  animation: scrollBtnFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Анимация исчезновения */
@keyframes scrollBtnFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
}

.scroll-nav-btn.fade-out {
  animation: scrollBtnFadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .scroll-nav-btn {
    left: 15px;
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  
  .scroll-to-top,
  .scroll-to-bottom {
    bottom: 140px;
  }
}

body, html, #app {
  height: 100%;
  margin: 0;
  display: flex;
}

#app {
  width: 100%;
}