* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none !important;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mainApp {
    display: flex;
}

/* Цвет фона */
.sidebar {
    width: 280px;
    background-color: #243342;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 10;
}

/* Блок под прозрачный логотип */
.logo-container img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    object-position: center;

    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.menu {
    display: flex;
    flex-direction: column;
    margin-top: 1.3rem;
    gap: 8px;
}

/* Ссылки меню */
.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #8fa0b5;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Стили для SVG-иконок */
.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: stroke 0.2s ease;
}

/* Эффект при наведении */
.menu-item:hover {
    background-color: #202d38;
    color: #ffffff;
}

/* Активный пункт (Диалоги) */
.menu-item.active {
    background-color: #19242f;
    color: #ffffff;
}

/* Перенести всё что ниже в отдельный css */
.sidebar-dialogs {
    width: 280px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    /* border-right: 1px solid #e1e8ed; */
    height: 100%;
    --panel-width: 280px;
}

.sidebar-dialogs-top {
    flex-direction: column;
    margin: 1rem;
}

.search-input {
    width: 100%;
    background-color: #1e2d42;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

/* Эффект фокуса при клике */
.search-input:focus {
    border-color: #2db9f59c;
    background-color: #24354f;
}

/* Цвет текста-подсказки */
.search-input::placeholder {
    color: #64748b;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.container {
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid #ccc;
    padding: 20px;
    width: 320px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.inside-container {
    display: grid;
    background: white;
    padding: 1.5rem;
    gap: 12px;
    border-radius: 6px;
}

h3 {
    margin: 0 0 10px 0;
    text-align: center;
    color: #2c3e50;
}

.input-signin {
    background: rgb(255, 255, 230);
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    font-size: 16px;
    outline: none;
}

.input-signin:focus {
    border-color: #3498db;
}

.btn-signin {
    padding: .7rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.btn-signin:hover {
    background: #2980b9;
}

.link-toggle {
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
    text-decoration: none;
    cursor: pointer;
}

.link-toggle:hover {
    text-decoration: underline;
}

.profile-box {
    padding: 20px;
    background: #243342;
    border-bottom: 1px solid #1a252f;
}

.profile-box h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    word-break: break-all;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

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

.channels-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 150px);
}

/* --- СИНХРОНИЗАЦИЯ И ФИКСИРОВАННАЯ ВЫСОТА ПЛАШЕК КЛИЕНТОВ --- */

.channel-item {
    height: 52px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    border-left: 4px solid transparent;
    transition: background-color 0.4s ease, border-left 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}

/* Верхний этаж: Индикатор и Имя клиента стоят в одну линию */
.channel-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

/* Нижний этаж: Источник рекламы с аккуратным затуханием */
.channel-source-row {
    font-size: 11px;
    opacity: 0.7;
    width: 100%;
    overflow: hidden;
}

/* Общее правило защиты от вылезания длинных названий */
.channel-title-row .client-name,
.channel-source-row span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-item:hover {
    background: #34495e !important;
    border-left: 4px solid #bdc3c7;
    transition: background-color 0.15s ease, border-left 0.15s ease;
}

/* Выделение компании, с которой чат ОТКРЫТ прямо сейчас */
.channel-item.active {
    background: #34495e !important;
    border-left: 4px solid #3498db;
    font-weight: bold;
}

.channel-item.active:hover {
    background: #3e566f !important;
    border-left: 4px solid #3498db;
}

.channel-item.disabled {
    color: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Пульсирующая подсветка для НЕПРОЧИТАННЫХ чатов (слегка скорректируем приоритет) */
.channel-item.unread {
    background: #2980b9 !important;
    border-left: 4px solid #2ecc71;
    font-weight: bold;
    animation: pulseGlow 1.8s infinite ease-in-out;
}

.channel-item.unread:hover {
    background: #5dade2 !important;
    box-shadow: 0 0 12px rgba(93, 173, 226, 0.8);
}

/* .chat-input-bar button,
#btnSendMessage {
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
} */

/* .chat-input-bar button:hover,
#btnSendMessage:hover {
    background: #2980b9 !important;
} */

.chat-input-bar button:active,
#btnSendMessage:active {
    background: #1f618d !important;
    transform: scale(0.96);
}

/* --- СТИЛИ ДЛЯ КНОПКИ НАСТРОЕК В САЙДБАРЕ --- */

.btn-settings-panel {
    background: #34495e;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.btn-settings-panel:hover {
    background: #4e6a85;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-settings-panel:active {
    background: #2c3e50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: scale(0.97);
}

/* --- КЛАСС ДЛЯ ПЛАВНОГО ПОЯВЛЕНИЯ ПОП-АПА --- */
.settings-modal-show {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* --- СТИЛИ ДЛЯ КНОПОК ВНУТРИ ПОП-АПА НАСТРОЕК --- */

.btn-save-inline {
    background: #2ecc71 !important;
    color: white !important;
    border: none !important;
    padding: 0 14px !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    font-size: 15px !important;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
}

.btn-save-inline:hover {
    background: #27ae60 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-save-inline:active {
    background: #219653 !important;
    transform: scale(0.93);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-close-modal {
    background: #e74c3c !important;
    color: white !important;
    border: none !important;
    padding: 8px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
}

.btn-close-modal:hover {
    background: #c0392b !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-close-modal:active {
    background: #962d22 !important;
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* --- СТИЛИ ДЛЯ КАНАЛОВ В КОНСТРУКТОРЕ ССЫЛОК --- */

.generated-link-item {
    background: #2c3e50;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    border: 1px solid #34495e;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.generated-link-item:hover {
    background: #34495e;
    border-color: #3498db;
}

.generated-link-item:active {
    background: #1a252f;
}

/* --- СТИЛИ ДЛЯ СИНЕЙ КНОПКИ "+ ДОБАВИТЬ" В КОНСТРУКТОРЕ --- */

#btnCreateChannel {
    background: #3498db !important;
    color: white !important;
    border: none !important;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
}

/* Мягкий Hover (наведение мыши) */
#btnCreateChannel:hover {
    background: #2980b9 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

/* Эффект Active (интерактивный клик) */
#btnCreateChannel:active {
    background: #1f618d !important;
    transform: scale(0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* --- ИНТЕРАКТИВНОСТЬ ОСНОВНОЙ ССЫЛКИ В ПОП-АПЕ --- */

#slugStatus {
    cursor: pointer !important;
    transition: opacity 0.25s ease;
}

#slugStatus:hover {
    opacity: 0.8;
}

#slugStatus.is-fading {
    opacity: 0;
    pointer-events: none;
}

/* --- ИНТЕРАКТИВНЫЕ СТИЛИ ДЛЯ ПОЛЕЙ ВВОДА (INPUT HOVER & FOCUS) --- */

#settingsModal input[type="text"] {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

#settingsModal input[type="text"]:hover {
    border-color: #3498db !important;
    background-color: #3d566e !important;
}

#settingsModal input[type="text"]:focus {
    border-color: #2ecc71 !important;
    background-color: #1a252f !important;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.5) !important;
}

/* --- ИНТЕРАКТИВНЫЕ СТИЛИ ДЛЯ ГЛАВНОГО ИНПУТА ЧАТА (МЕНЕДЖЕР И ГОСТЬ) --- */

#inpMessage {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

/* 1. Эффект Hover — подсвечиваем синим только если инпут не в состоянии ошибки */
#inpMessage:hover {
    border-color: #3498db;
    background-color: #f7f9fa;
}

/* 2. Эффект Focus — зажигаем белым и даем синее неоновое свечение */
#inpMessage:focus {
    border-color: #3498db;
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4);
}

/* --- СТИЛИ КРЕСТИКА УДАЛЕНИЯ (DELETE CROSS) --- */

.delete-cross-btn {
    opacity: 0;
    pointer-events: none;
    color: #95a5a6;
    font-size: 16px;
    font-weight: normal !important;
    cursor: pointer;
    transition: opacity 0.2s ease, color 0.2s ease, transform 0.1s ease;
    padding: 0 6px;
    margin-left: 10px;
    line-height: 1;
    display: inline-block;
}

/* Эффект Hover на родителя — крестик плавно появляется */
.generated-link-item:hover .delete-cross-btn,
.channel-item:hover .delete-cross-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Наведение на сам крестик — он горит предупреждающим красным */
.delete-cross-btn:hover {
    color: #e74c3c !important;
    transform: scale(1.15);
    /* Изящное микро-увеличение */
}

/* Окно подтверждения удаления (включение плавности) */
.delete-modal-show {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* --- БЛОКИРОВКА БЕЛОГО ФОНА ПРИ АВТОЗАПОЛНЕНИИ БРАУЗЕРА --- */

#settingsModal input:-webkit-autofill,
#settingsModal input:-webkit-autofill:hover,
#settingsModal input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 0 0px 1000px #34495e inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

button,
input,
textarea,
button:focus,
input:focus,
.btn-save-inline:focus,
.btn-close-modal:focus,
#btnCreateChannel:focus {
    outline: none !important;
}

@keyframes pulseGlow {
    0% {
        background-color: #2980b9;
        box-shadow: 0 0 5px rgba(41, 128, 185, 0.4), inset 0 0 8px rgba(46, 204, 113, 0.3);
    }

    50% {
        background-color: #3498db;
        box-shadow: 0 0 10px rgba(52, 152, 219, 0.7), inset 0 0 15px rgba(46, 204, 113, 0.6);
        /* Уменьшили радиус размытия для идеального UX */
    }

    100% {
        background-color: #2980b9;
        box-shadow: 0 0 5px rgba(41, 128, 185, 0.4), inset 0 0 8px rgba(46, 204, 113, 0.3);
    }
}

/* --- АНИМАЦИЯ ЯРКОЙ ВСПЫШКИ ДЛЯ НОВОЙ ССЫЛКИ --- */

@keyframes neonFlashSuccess {
    0% {
        background: #2c3e50;
        box-shadow: 0 0 0 rgba(46, 204, 113, 0);
        border-color: #34495e;
    }

    30% {
        background: #27ae60;
        box-shadow: 0 0 15px #2ecc71, inset 0 0 10px #2ecc71;
        border-color: #2ecc71;
    }

    100% {
        background: #2c3e50;
        box-shadow: 0 0 0 rgba(46, 204, 113, 0);
        border-color: #34495e;
    }
}

.new-link-just-added {
    animation: neonFlashSuccess 1.4s ease-in-out 3;
}