/* ======= Базовые стили и анимации ======= */
.container {
    max-width: 100%;
    margin: 0;
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes rotateLens {
    0%   { transform: rotate(0deg)   translateX(0px) translateY(0px); }
    25%  { transform: rotate(10deg)  translateX(5px) translateY(3px); }
    50%  { transform: rotate(0deg)   translateX(0px) translateY(5px); }
    75%  { transform: rotate(-10deg) translateX(-5px) translateY(3px);}
    100% { transform: rotate(0deg)   translateX(0px) translateY(0px); }
}

@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(255, 45, 117, 0.2); }
    70%  { box-shadow: 0 8px 0 4px rgba(255, 45, 117, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 45, 117, 0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ======= Компоненты плиток ======= */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin: 20px 0 40px;
    transition: all 0.4s ease;
    width: 100%;
}

.tile {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-small);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.tile:hover {
    background: var(--card-hover);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.tile:active {
    transform: translateY(-2px);
}

.tile.disabled {
    opacity: 0.7;
    position: relative;
    background: var(--bg-primary);
    transition: all 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.tile.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-small);
    background: var(--card-bg);
    animation: pulse-glow 2s infinite;
}

.tile-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.upgrade-hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-secondary);
    z-index: 2;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tile.disabled:hover .upgrade-hint {
    opacity: 1;
}

/* ======= Компоненты чата ======= */
/* Новые стили для фиксированного скроллбара */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.messages {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    /* Кастомизация скроллбара */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(255, 255, 255, 0.05);
}

/* Стили для скроллбара в Webkit-браузерах */
.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #00e6ff;
}

.user-msg, .bot-msg {
    max-width: 85%;
    padding: 18px 30px;
    border-radius: 18px;
    animation: fadeIn 0.4s ease forwards;
    opacity: 0;
    position: relative;
    line-height: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-msg {
    background: linear-gradient(90deg, var(--message-gradient-dark), var(--message-gradient-light));
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-msg {
    background: var(--card-hover);
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 85%;
}

.bot-msg ul{
    padding-left: 20px;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-secondary);
    font-style: italic;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 3px;
    animation: pulse 1.5s infinite;
}

.chat-form-bg{
    position: sticky;
    background: var(--bg-third);
    bottom: 0;
    border-top-right-radius: 20px;
    border-top-left-radius: 20px;
}

.chat-form-wrapper {
    padding: 10px;
    border-radius: 20px;
    background: var(--chat-form);
    transition: padding 0.4s ease;
}

.chat-form {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.chat-input {
    width: 100%;
    padding: 16px 60px 16px 20px;
    border-radius: 14px;
    font-size: 1rem;
    background: var(--chat-input);
    color: var(--text-primary);
    min-height: 56px;
    outline: none;
    resize: none;
    overflow-y: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2);
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.send-button {
    position: absolute;
    right: 10px;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.send-button:hover {
    background: #00e6ff;
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.98);
}

/* ======= Результаты поиска ======= */
.search-results {
    margin-top: 15px;
    margin-bottom: 15px;
    border-left: 2px solid var(--accent-primary);
    padding-left: 15px;
}

.results-header {
    cursor: pointer;
    padding: 12px 15px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    transition: all 0.3s ease;
}

.results-header:hover {
    background: rgba(0, 210, 255, 0.15);
}

.results-count {
    font-weight: 600;
    color: var(--accent-primary);
}

.results-list {
    margin-top: 15px;
    display: none;
    gap: 12px;
}

.result-item {
    background: var(--result-item);
    border-radius: 14px;
    padding: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    min-height: 86px;
}

.result-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.result-name {
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
}

.result-name a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    flex: 1;
}

.result-name a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.result-price {
    color: var(--accent-primary);
    font-weight: 600;
    margin-left: 10px;
    background: rgba(0, 210, 255, 0.1);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.result-shop {
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
}

.result-shop[data-domain="Wildberries"] {
    background: rgba(170, 0, 170, 0.15);
    color: #ff55ff;
    border-color: rgba(170, 0, 170, 0.2);
}

.result-shop[data-domain="Citilink"] {
    background: rgba(255, 69, 0, 0.15);
    color: #ff4d00;
    border-color: rgba(255, 76, 0, 0.2);
}

.result-shop[data-domain="DNS"] {
    background: rgba(255, 128, 0, 0.15);
    color: #ff8900;
    border-color: rgba(255, 135, 0, 0.2);
}

.result-shop[data-domain="Ozon"] {
    background: rgba(0, 42, 255, 0.15);
    color: #008dff;
    border-color: rgba(0, 82, 255, 0.2);
}

.result-shop[data-domain="YandexMarket"] {
    background: rgba(166, 0, 64, 0.15);
    color: #ff0000;
    border-color: rgba(221, 48, 13, 0.2);
}

.result-shop[data-domain="OnlineTrade"] {
    background: rgba(194, 77, 0, 0.15);
    color: #ff723c;
    border-color: rgba(221, 93, 13, 0.2);
}

/* ======= Анализ требований ======= */
.analysis-container {
    margin-top: 15px;
    border-left: 2px solid var(--accent-secondary);
}

.analysis-header {
    cursor: pointer;
    padding: 12px 15px;
    background: rgba(255, 45, 117, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    transition: all 0.3s ease;
}

.analysis-header:hover {
    background: rgba(255, 45, 117, 0.15);
}

.analysis-content {
    margin-top: 15px;
    display: none;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-section {
    margin-bottom: 20px;
}

.analysis-section h4 {
    color: var(--accent-secondary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.analysis-section ul {
    padding-left: 20px;
}

.analysis-section li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.rotating-lens {
    display: inline-block;
    animation: rotateLens 1.5s linear infinite;
}

/* ======= Боковая панель ======= */
.chat-layout {
    display: flex;
    position: relative;
    gap: 25px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - var(--header-height));
    animation: fadeIn 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.chat-sidebar {
    position: fixed;
    bottom: 10px;
    left: 0;
    width: 280px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-small);
    height: calc(100vh - var(--header-height) - 40px);
    transition: left 0.3s ease;
    align-self: flex-start;
    z-index: 1000;
    animation: slideInLeft 0.5s ease-out;
}

.chat-sidebar.collapsed {
    left: -300px;
}

.top-buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px;
    position: relative;
}

.chat-sidebar.collapsed .new-chat-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    left: 10px;
}

.chat-sidebar.collapsed .new-chat-btn span {
    font-size: 1.5rem;
}

.chat-sidebar.collapsed .new-chat-btn .btn-text {
    display: none;
}

.collapse-btn {
    background: var(--accent-secondary);
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 96, 96, 0.3);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.collapse-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--hover-color-secondary);
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.chat-sidebar.collapsed .collapse-icon {
    transform: rotate(180deg);
}

.chat-list, .tariff-info {
    transition: opacity 0.1s ease;
}

.chat-sidebar.collapsed .chat-list,
.chat-sidebar.collapsed .tariff-info {
    opacity: 0;
    pointer-events: none;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 900;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.new-chat-btn {
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
    font-size: 1rem;
}

.new-chat-btn span {
    font-size: 1.4rem;
    font-weight: 700;
}

.new-chat-btn:hover {
    background: #00e6ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--hover-color);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.chat-layout::-webkit-scrollbar {
    width: 6px;
}

.chat-layout::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-layout::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

#filler{
    width: 280px;
    transition: width 0.3s ease;
}

#filler.collapsed{
    width: 70px;
}

.chat-item {
    background: var(--border-light);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
    animation: slideIn 0.3s ease;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.chat-item.active {
    background: rgba(0, 210, 255, 0.15);
    border-color: rgba(0, 210, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 210, 255, 0.1);
}

.chat-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 40px;
    font-size: 0.95rem;
}

.chat-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.chat-item:hover .chat-actions {
    opacity: 1;
}

.chat-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.chat-action-btn.delete:hover {
    background: rgba(255, 85, 85, 0.2);
    color: #ff5555;
}

.chat-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 800px;
    margin: 0 auto;
}

/* ======= Тарифная информация ======= */
.tariff-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    animation: fadeIn 0.5s ease;
}

.tariff-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-light);
}

.tariff-header h4 {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.tariff-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.tariff-status.active {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.tariff-status.inactive {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.tariff-name {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1rem;
    text-align: center;
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.tariff-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.feature-label {
    flex: 1;
    color: var(--text-secondary);
}

.feature-value {
    font-weight: 500;
}

.available {
    color: #28a745;
    font-weight: 600;
}

.unavailable {
    color: #dc3545;
    font-weight: 600;
}

.no-tariff {
    text-align: center;
    padding: 10px 0;
}

.no-tariff p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.upgrade-btn {
    display: block;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    color: white !important;
    padding: 8px 15px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

/* ======= Вспомогательные элементы ======= */
.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.new-chat-btn.hide {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

/* ======= Флеш-сообщения ======= */
.flash-messages {
    max-width: 900px;
    margin: 0 auto 25px auto;
}

.flash {
    padding: 15px 20px;
    border-radius: 14px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flash:before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
}

.flash-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.flash-success:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.flash-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.flash-error:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc3545'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

@keyframes coinDeduction {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); color: #ff2d75; }
    100% { transform: scale(1); }
}

.coin-deduction {
    animation: coinDeduction 0.6s ease;
}

.chat-actions {
    display: flex;
    gap: 15px;
}

footer {
    display: none;
}

.chat-sidebar.collapsed{
    position: fixed;
}
.chat-sidebar.collapsed .collapse-btn{
    position: fixed;
    left: 280px;
    bottom: 50%;
    padding: 20px 8px 20px 25px;
}

.chat-sidebar.collapsed .collapse-btn:hover{
    left: 288px;
    transform: translateY(0);
}

#filler.collapsed {
    width: 0;
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: var(--bg-secondary);
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.modal-header h4 {
  margin: 0;
  font-size: 1.2rem;
}

.close-modal {
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #333;
}

.modal-body p {
  margin-bottom: 20px;
  font-size: 1rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: #333;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

/* Гарантируем правильное отображение Markdown элементов */
.bot-msg h1, .bot-msg h2, .bot-msg h3 {
    font-weight: bold;
}

.bot-msg h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #eee;
    line-height: 3;
}

.bot-msg h2 {
    font-size: 1.5em;
    line-height: 2.5;
}

.bot-msg h3 {
    font-size: 1.3em;
    line-height: 2;
}

.bot-msg p {
    line-height: 1.6;
}


.bot-msg strong {
    font-weight: bold;
}

.bot-msg em {
    font-style: italic;
}

.bot-msg ol {
    line-height: 0.7;
    margin-bottom: 15px;
}

.bot-msg ul {
    line-height: 0.2;
    margin-bottom: 10px;
}

.bot-msg li{
    line-height: 1.3;
}

.bot-msg blockquote {
    border-left: 4px solid #ddd;
    padding-left: 15px;
    color: #666;
}

.bot-msg pre {
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: auto;
    margin: 0;
}

.bot-msg code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Специфичные стили для списков рекомендаций */
.bot-msg .recommendation-item {
    border-bottom: 1px solid #eee;
}

.bot-msg .recommendation-header {
    display: flex;
    align-items: center;
}

.bot-msg .recommendation-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 10px;
}

.bot-msg .recommendation-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.bot-msg .recommendation-price {
    font-weight: bold;
    color: #e44d26;
    margin: 0;
}

.bot-msg .recommendation-features {
    margin-left: 15px;
}

.bot-msg .recommendation-conclusion {
    background-color: #f8f9fa;
    border-left: 3px solid #4a6fa5;
    border-radius: 0 4px 4px 0;
}

/* Стиль для сырого текста перед форматированием */
.bot-msg .unformatted-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    line-height: 1.2;
}

/* Гарантирует, что текст не будет разбиваться на части */
.bot-msg {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.bot-msg {
    word-break: break-word;
}

.bot-msg .unformatted-text {
    display: inline; /* Чтобы текст шел непрерывно с отформатированными элементами */
}

/* Прогресс-бар сборки */
.build-progress {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.progress-icon {
    font-size: 20px;
    margin-right: 10px;
}

.progress-title {
    font-weight: 600;
    font-size: 16px;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4361ee;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    margin-top: 5px;
    font-size: 13px;
    color: #6c757d;
}

.component-search {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
}

.search-message {
    font-weight: bold;
}

.thoughts-container {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.toggle-thoughts {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.toggle-thoughts:hover {
    background-color: #0056b3;
}

.selection-message {
    margin-top: 10px;
    color: #28a745;
}

/* Добавляем после существующих стилей .input-container */

/* Стили для ряда с инструментами */
.tools-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.tool-buttons {
    display: flex;
    gap: 10px;
}

.tool-btn {
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    background: var(--tool-btn-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-btn:hover {
    background: var(--tool-btn-hover);
    transform: translateY(-2px);
}

.tool-btn.active {
    background: var(--accent-primary);
    color: #000;
    border-color: rgba(0, 210, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 210, 255, 0.2);
}

.tool-btn.active:hover {
    background: #00e6ff;
}

/* Добавляем в конец файла */

/* Обновленные стили для боковых подсказок */
/* Убираем старые псевдоэлементы */
.tool-btn::after, .tool-btn::before {
    display: none !important;
}

/* Новые стили для кастомных подсказок */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.custom-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    text-align: center;
    line-height: 1.1;
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    border: 6px solid transparent;
    transform: translateY(-50%);
}

/* Подсказка слева для кнопки поиска */
.custom-tooltip.left {
    right: calc(100% + 15px);
}

.custom-tooltip.left::before {
    left: 100%;
    border-left-color: rgba(0, 0, 0, 0.85);
}

/* Подсказка справа для кнопки сборки */
.custom-tooltip.right {
    left: calc(100% + 15px);
}

.custom-tooltip.right::before {
    right: 100%;
    border-right-color: rgba(0, 0, 0, 0.85);
}

/* Анимация появления */
@keyframes tooltipAppear {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Показываем подсказку при наведении на контейнер */
.tooltip-container:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
    animation: tooltipAppear 0.3s ease forwards;
}

.custom-tooltip {
    transition: all 0.3s ease 0.2s; /* Задержка 0.2s */
}

.tooltip-container:hover .custom-tooltip {
    transition-delay: 0s; /* Убираем задержку при наведении */
}

/* Для узких экранов - обе подсказки слева */
@media (max-width: 1200px) {
    .custom-tooltip {
        right: auto !important;
        left: calc(100% + 15px) !important;
    }

    .custom-tooltip::before {
        left: auto !important;
        right: 100% !important;
        border-left-color: transparent !important;
        border-right-color: rgba(0, 0, 0, 0.85) !important;
    }
}

/* Для мобильных устройств скроем tooltips */
@media (hover: none) {
    .custom-tooltip {
        display: none;
    }
}

/* Для мобильных устройств без hover скроем tooltips */
@media (hover: none) {
    .tool-btn::after,
    .tool-btn::before {
        display: none;
    }
}

/* Улучшенные стили кнопок */
.tool-btn {
    padding: 10px 18px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    background: var(--tool-btn-bg);
    transition: all 0.2s ease;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tool-btn.active {
    background: var(--accent-primary);
    color: #000;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

/* Адаптация для маленьких экранов */
@media (max-width: 480px) {
    .tool-btn {
        font-size: 0.9rem;
    }

    .tool-btn::after {
        font-size: 13px;
    }
    .chat-input {
        padding: 8px 30px 8px 10px;
    }
}

/* Добавляем переменные для цветов в корневые стили */
:root {
    --tool-btn-bg: rgba(255, 255, 255, 0.08);
    --tool-btn-hover: rgba(255, 255, 255, 0.12);
}

/* ======= Адаптивные стили ======= */
@media (max-width: 1200px) {
    .chat-layout {
        gap: 15px;
    }
    .chat-sidebar {
        width: 250px;
        padding: 10px;
    }
}

@media (max-width: 992px) {
    .chat-main {
        width: 100%;
        padding-right: 10px;
    }
}

@media (max-width: 768px) {
    .tiles {
        grid-template-columns: 1fr;
    }
    .user-msg, .bot-msg {
        max-width: 90%;
    }
    .chat-sidebar {
        padding: 15px;
    }
    .chat-item {
        padding: 12px 14px;
    }
    .new-chat-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .chat-form {
        flex-direction: column;
    }
    .send-button {
        right: 5px;
    }
    .chat-name {
        font-size: 0.9rem;
    }
    .chat-action-btn {
        width: 26px;
        height: 26px;
    }
    .chat-actions {
        align-self: flex-end;
    }
}

@media (hover: hover) {
  .chat-actions {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .chat-item:hover .chat-actions {
    opacity: 1;
    visibility: visible;
  }
}

/* Для мобильных устройств */
@media (hover: none) {
  .chat-name-container {
    position: relative;
    padding-right: 40px; /* Оставляем место для кнопки меню */
      opacity: 1;
      flex-direction: row;
  }

  .chat-actions {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
    flex-direction: column; /* Вертикальное расположение кнопок */
    gap: 5px;
  }

  .chat-item.actions-visible .chat-actions {
    display: flex;
    flex-direction: row;
    right: -50px;
  }

  /* Индикатор меню */
  .chat-name-container::after {
    content: '⋯';
    position: absolute;
    right: -50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--text-secondary);
  }

  .chat-item.actions-visible .chat-name-container::after {
    content: '';
  }
}

/* Стили для недоступных функций */
.tool-btn.disabled {
    position: relative;
    opacity: 0.7;
    background: rgba(220, 53, 69, 0.15) !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
    color: var(--text-secondary) !important;
    box-shadow: none;
}

.tool-btn.disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.tool-btn.disabled .tool-icon {
    filter: grayscale(100%);
}

/* Стили для предупреждений в подсказках */
.tooltip-warning {
    color: #ff6b6b;
    font-weight: 600;
    margin-top: 8px;
    display: block;
    font-size: 0.9em;
}

/* Иконка предупреждения */
.warning-icon {
    display: inline-block;
    margin-right: 5px;
    color: #ff6b6b;
}

/* Стили для кликабельной подсказки */
.tooltip-link {
    display: block;
    margin-top: 8px;
    color: #4da6ff;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

.tooltip-link:hover {
    color: #80c1ff;
}

.little-comment{
    text-align: center;
    font-size: 0.8em;
}

.check-icon {
    color: #4CAF50;
    font-weight: bold;
}

.cross-icon {
    color: #F44336;
    font-weight: bold;
}

/* Добавьте в css/pricing.css */
.pricing-container {
    transition: box-shadow 0.5s ease;
}

.pricing-container.highlight {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
    animation: pulse 2s ease;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(66, 153, 225, 0); }
    100% { box-shadow: 0 0 0 0 rgba(66, 153, 225, 0); }
}

.analysis-container {
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgba(255, 45, 117, 0.1);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.2rem;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.analysis-content {
    display: none;
    padding: 20px;
}

.analysis-container.collapsed .analysis-content {
    display: block;
}

.analysis-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--border-light-strong);
}

.analysis-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-title {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.1rem !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "•";
    color: #4299e1;
    font-size: 1.5rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    background: var(--custom-card);
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    border-left: 3px solid #4299e1;
}

.spec-name {
    color: var(--text-primary);
    font-weight: 500;
    min-width: 50px;
}

.spec-value {
    color: var(--text-primary);
    font-weight: 600;
}

.value-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.value-list li {
    background: var(--chat-form);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
    box-shadow: var(--shadow-small);
}

.value-list li:hover {
    background: var(--chat-form);
    transform: translateY(-2px);
}

.nested-item {
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.nested-item:last-child {
    border-bottom: none;
}

.nested-key {
    font-weight: 600;
    color: #4a5568;
    display: inline-block;
    min-width: 100px;
}

/* Стили для длинных текстовых значений */
.spec-item.long-text {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
}

.spec-item.long-text .spec-name {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
    width: 100%;
}

.spec-item.long-text .spec-value {
    padding-top: 8px;
    width: 100%;
    line-height: 1.5;
}

/* Адаптивная ширина карточек */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Перенос длинных слов */
.spec-value {
    word-wrap: break-word;
    overflow-wrap: break-word;
}


.toggle-icon {
    font-size: 1rem;
}

.section-title::before {
    content: "•";
    color: #4299e1;
    font-size: 1.2rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    gap: 12px;
}


.nested-item {
    padding: 5px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.85rem;
}

.nested-item:last-child {
    border-bottom: none;
}

.nested-key {
    font-weight: 600;
    color: #4a5568;
    display: inline-block;
    min-width: 80px;
}

/* Стили для длинных текстов */
.spec-item.long-text {
    flex-direction: column;
    padding: 12px;
}

.spec-item.long-text .spec-name {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
    width: 100%;
    min-width: 100%;
}

.spec-item.long-text .spec-value {
    padding-top: 6px;
    width: 100%;
    line-height: 1.4;
    min-width: 100%;
}

/* Адаптация для очень узких экранов */
@media (max-width: 360px) {
    .analysis-header {
        padding: 12px;
    }

    .header-title {
        font-size: 0.9rem;
    }

    .analysis-content {
        padding: 12px;
    }

    .spec-name, .spec-value {
        font-size: 0.85rem;
    }

    .nested-key {
        min-width: 70px;
        font-size: 0.8rem;
    }

    .value-list li {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

/* Ландшафтная ориентация */
@media (min-width: 480px) and (max-width: 767px) {
    .specs-grid {
        grid-template-columns: repeat(auto-fill, minmax(48%, 1fr));
    }
}