﻿/* ==========================================================
   NOTA NOTIFY — UI Kit (Финальная отшлифованная версия)
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;500&display=swap');

/* --- @-плашки в постах (упоминания) — перенесено из JS-инжекта --- */
.nt-at {
    font-family: 'Roboto Slab', serif !important;
    font-size: 0.9em;
    background: var(--cover2);
    border: 1px solid var(--borders);
    border-radius: 4px;
    padding: 1px 6px 2px;
    text-decoration: none !important;
    color: inherit !important;
    display: inline-block;
    line-height: 1.4;
}

/* --- Триггер «уведомления» в меню навигации --- */
#nota-noti-trigger {
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s ease;
    color: var(--links); /* cite: 1 */
}

#nota-noti-trigger:hover {
    opacity: 0.75;
    color: var(--accent); /* cite: 2 */
}

/* Красный треугольник-индикатор у уведомления при наличии непрочитанных */
#nota-noti-trigger.has-unread {
    color: #b83131 !important;
}

#nota-noti-trigger .bubble {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #b83131;
    color: #ffffff;
    font: 600 9px/1 var(--font), sans-serif; /* cite: 1 */
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

/* --- Оверлей и Модальное окно --- */
#nota-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
}

#nota-modal {
    width: 600px;
    max-width: calc(100vw - 32px);
    height: 720px;
    max-height: 90vh;
    background: var(--pun); /* cite: 1 */
    border: 1px solid var(--borders); /* cite: 1 */
    border-radius: 8px; /* cite: 3 */
    padding: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text1); /* cite: 1 */
}

/* --- Шапка модалки --- */
.nota-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    font-family: var(--font-accent), sans-serif; /* cite: 1 */
    font-weight: 400; /* cite: 1 */
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase; /* cite: 1 */
    letter-spacing: 1.5px;
    color: var(--text2); /* cite: 1 */
    flex-shrink: 0;
}

.nota-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nota-modal-header-actions span {
    cursor: pointer;
    line-height: 1;
    color: var(--text2); /* cite: 1 */
    font-family: Arial, sans-serif;
    font-weight: 300;
    transition: color 0.15s;
}

.nota-modal-header-actions span:hover {
    color: var(--links); /* cite: 2 */
}

#nota-settings-btn { font-size: 14px !important; }
#nota-markread-btn, #nota-admin-btn { font-size: 13px !important; opacity: 0.5; }
#nota-markread-btn:hover, #nota-admin-btn:hover { opacity: 1 !important; }

/* --- Табы / Вкладки (Фикс размеров иконок верхнего ряда) --- */
#nota-modal-tabs {
    display: flex;
    flex-wrap: wrap;
    padding: 12px 20px 8px;
    gap: 4px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--borders); /* cite: 1 */
}

.nota-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-family: var(--font-accent), sans-serif; /* cite: 1 */
    font-weight: 400; /* cite: 1 */
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase; /* cite: 1 */
    color: var(--text2); /* cite: 1 */
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    border: 1px solid transparent;
    background: transparent;
    user-select: none;
    white-space: nowrap;
}

.nota-tab-btn i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    display: inline-block;
}

.nota-tab-btn:hover {
    color: var(--accent); /* cite: 2 */
}

.nota-tab-btn.active {
    color: var(--text1); /* cite: 1 */
    background: var(--cover2); /* cite: 1 */
    border-color: var(--borders); /* cite: 1 */
}

.nota-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cover2); /* cite: 2 */
    border-radius: 6px;
    padding: 1px 5px;
    font-size: 9px;
    min-width: 16px;
    color: var(--text1); /* cite: 1 */
    font-family: var(--font), sans-serif; /* cite: 1 */
}

.nota-tab-btn.active .nota-tab-count {
    background: var(--borders); /* cite: 1 */
    color: var(--text1); /* cite: 1 */
}

.nota-tab-count.unread-badge {
    background: #b83131 !important;
    color: #ffffff !important;
}

/* --- Списки и скроллбар --- */
#nota-modal-list, #nota-settings-panel {
    overflow-y: auto;
    flex-grow: 1;
    padding: 4px 0;
}

#nota-modal-list::-webkit-scrollbar, 
#nota-settings-panel::-webkit-scrollbar { 
    width: 4px; 
}

#nota-modal-list::-webkit-scrollbar-track, 
#nota-settings-panel::-webkit-scrollbar-track { 
    background: transparent; 
}

#nota-modal-list::-webkit-scrollbar-thumb, 
#nota-settings-panel::-webkit-scrollbar-thumb {
    background: var(--borders); /* cite: 1 */
    border-radius: 10px;
}

/* --- Четкое разделение строчек и уменьшение текста описания --- */
.nt-list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--borders);
    text-decoration: none;
    transition: background 0.15s;
    color: var(--text1); /* cite: 1 */
    background: rgba(255, 255, 255, 0.15);
    margin: 4px 10px;
    border-radius: 8px;
}

.nt-list-item:hover {
    background: var(--cover2); /* cite: 1 */
}

.nt-list-item.unread {
    background: var(--cover2); /* cite: 2 */
    border-left: 4px solid #b83131;
    padding-left: 16px;
}

.nt-list-item.unread .nt-list-item-sender {
    color: #b83131;
}

.nt-list-item-sender {
    font-family: var(--font), sans-serif; /* cite: 1 */
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    text-transform: none;
    color: var(--text1); /* cite: 1 */
    letter-spacing: 0.3px;
}

.nt-list-item-text {
    font-family: var(--font), sans-serif; /* cite: 1 */
    font-weight: 400;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text2); /* cite: 1 */
    white-space: normal;
}

.nt-empty {
    padding: 32px 20px;
    text-align: center;
    font: 400 12px/1.5 var(--font), sans-serif; /* cite: 1 */
    color: var(--text2); /* cite: 1 */
}

/* --- Панель настроек (Фикс разных размеров значков/тоглов справа) --- */
.nt-settings { 
    padding: 16px 24px 8px; 
}

.nt-settings-header { 
    display: grid; 
    grid-template-columns: 1fr 90px 90px 90px;
    gap: 0; 
    padding-bottom: 8px; 
    border-bottom: 1px solid var(--borders); /* cite: 1 */
    margin-bottom: 4px; 
}

.nt-settings-header-cell { 
    font-family: var(--font-accent), sans-serif; /* cite: 1 */
    font-weight: 400; 
    font-size: 10px; 
    line-height: 1; 
    text-transform: uppercase; /* cite: 1 */
    letter-spacing: 1px; 
    color: var(--text2); /* cite: 1 */
    text-align: center; 
}

.nt-settings-header-cell:first-child {
    text-align: left;
}

.nt-col-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.nt-col-toggle:hover {
    color: var(--links); /* cite: 2 */
}

.nt-settings-row { 
    display: grid; 
    grid-template-columns: 1fr 90px 90px 90px;
    align-items: center; 
    padding: 12px 0; 
    border-bottom: 1px solid var(--borders); /* cite: 1 */
    gap: 0; 
}

.nt-settings-row:last-child { 
    border-bottom: none; 
}

.nt-settings-label { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-family: var(--font-accent), sans-serif; /* cite: 1 */
    font-weight: 400; 
    font-size: 12px; 
    line-height: 1; 
    text-transform: uppercase; /* cite: 1 */
    color: var(--text1); /* cite: 1 */
}

.nt-settings-label i { 
    font-size: 13px; 
    color: var(--text2); /* cite: 1 */
    width: 16px; 
    text-align: center; 
}

/* Фикс выравнивания ячеек со значками переключателей */
.nt-settings-cell { 
    display: flex; 
    justify-content: center; 
    align-items: center;
}

/* Фикс структуры и неизменности размеров тоглов */
.nt-toggle { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    user-select: none; 
    width: 32px;
    height: 18px;
}

.nt-toggle input { 
    display: none; 
}

.nt-toggle-track { 
    display: block; 
    width: 32px !important; 
    height: 18px !important; 
    background: var(--borders); /* cite: 1 */
    border-radius: 9px !important; 
    position: relative; 
    transition: background 0.2s; 
    flex-shrink: 0; 
}

.nt-toggle-track::after { 
    content: ''; 
    position: absolute; 
    top: 3px; 
    left: 3px; 
    width: 12px !important; 
    height: 12px !important; 
    background: var(--text2); /* cite: 3 */
    border-radius: 50% !important; 
    transition: transform 0.2s; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); 
}

.nt-toggle input:checked + .nt-toggle-track { 
    background: var(--links); /* cite: 2 */
}

.nt-toggle input:checked + .nt-toggle-track::after { 
    transform: translateX(14px); 
}

.nt-settings-divider {
    border-top: 1px solid var(--borders); /* cite: 1 */
    margin: 4px 0;
}

.nt-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 8px;
}

.nt-btn {
    font-family: var(--font-accent), sans-serif;
    font-weight: 400;
    font-size: 11px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--borders);
    background: var(--cover2);
    color: var(--text1);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.nt-btn:hover {
    background: var(--links);
    color: var(--text2);
}

.nt-btn-danger {
    border-color: #b83131;
    color: #b83131;
}

.nt-btn-danger:hover {
    background: #b83131;
    color: #fff;
}

/* --- Компактная интеграция с Telegram (Футер модалки уменьшен) --- */
#nota-modal-tg-footer { 
    padding: 10px 20px; 
    border-top: 1px solid var(--borders); /* cite: 1 */
    flex-shrink: 0; 
    background: rgba(0,0,0,0.02);
}

.tg-btn-connect { 
    width: 100%; 
    padding: 7px 14px; /* Уменьшены внутренние отступы */
    background: var(--cover2); /* cite: 1 */
    border: 1px solid var(--borders); /* cite: 1 */
    border-radius: 6px; 
    color: var(--text1); /* cite: 1 */
    font-family: var(--font-accent), sans-serif; /* cite: 1 */
    font-weight: 400; 
    text-transform: uppercase; /* cite: 1 */
    font-size: 10px; /* Уменьшен размер шрифта кнопки */
    letter-spacing: 0.8px; 
    cursor: pointer; 
    transition: background 0.2s, color 0.2s; 
}

.tg-btn-connect:hover:not(:disabled) { 
    background: var(--borders); /* cite: 1 */
    color: var(--text1); /* cite: 1 */
}

.tg-status-linked { 
    font-family: var(--font-accent), sans-serif; /* cite: 1 */
    font-weight: 400; 
    text-transform: uppercase; /* cite: 1 */
    font-size: 10px; 
    color: var(--text2); /* cite: 1 */
    text-align: center; 
    padding: 2px 0; 
}

/* Уменьшенный и аккуратный текст описания */
.tg-status-instruction { 
    font: 400 10px/1.4 var(--font), sans-serif; /* cite: 1 */
    color: var(--text2); /* cite: 1 */
    text-align: center; 
    max-width: 90%;
    margin: 0 auto;
}

.tg-code { 
    display: inline-block; 
    background: var(--cover2); /* cite: 2 */
    border: 1px solid var(--borders); /* cite: 1 */
    border-radius: 4px; 
    padding: 2px 8px; 
    font-family: monospace; 
    font-size: 12px; /* Более компактный код */
    color: var(--text1); /* cite: 1 */
    letter-spacing: 1.5px; 
    margin-top: 4px; 
}

/* --- Notice Stream, Admin Panel & Suggest Box --- */
#nota-notice-stream .browser-notice-item { background: var(--pun) !important; border: 1px solid var(--borders) !important; border-radius: 8px !important; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important; color: var(--text1) !important; } /* cite: 1, 3 */
#nota-notice-stream .browser-notice-item b { font-family: var(--font), sans-serif !important; } /* cite: 1 */
#nota-notice-stream .browser-notice-item .nt-topic-link { font-family: var(--font-accent), sans-serif !important; font-weight: 400 !important; text-transform: uppercase !important; color: var(--links) !important; letter-spacing: 0.5px; } /* cite: 1, 2 */
#nota-notice-stream .browser-notice-item .nt-topic-link:hover { color: var(--accent) !important; } /* cite: 2 */
#nota-notice-stream .browser-notice-item .nt-close { color: var(--text2) !important; font-family: Arial, sans-serif !important; } /* cite: 1 */
#nota-notice-stream .browser-notice-item .nt-close:hover { color: var(--text1) !important; } /* cite: 1 */

#nota-admin-panel { padding: 12px 16px; }
.nt-admin-sec-title { font-family: var(--font-accent), sans-serif; font-weight: 400; text-transform: uppercase; color: var(--text1); margin: 6px 0 8px; display: flex; align-items: center; gap: 6px; } /* cite: 1 */
.nt-admin-addbar { display: flex; gap: 6px; margin-bottom: 8px; }
#nt-imp-input, #nt-bc-text { width: 100%; box-sizing: border-box; border: 1px solid var(--borders); border-radius: 6px; background: var(--cover2); color: var(--text1); padding: 7px 9px; font: 400 12px/1.4 var(--font), sans-serif; resize: vertical; } /* cite: 1 */
#nt-imp-add, #nt-bc-send { border: none; border-radius: 6px; background: var(--accent); color: var(--text2); cursor: pointer; padding: 7px 12px; font-family: var(--font-accent), sans-serif; font-weight: 400; text-transform: uppercase; white-space: nowrap; } /* cite: 1, 3 */
#nt-imp-add:hover, #nt-bc-send:hover { background: var(--links); color: var(--text1); } /* cite: 1 */
.nt-imp-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--borders); font: 400 12px/1.3 var(--font), sans-serif; } /* cite: 1 */
.nt-imp-row a { color: var(--text1); text-decoration: none; } /* cite: 1 */
.nt-imp-row a:hover { text-decoration: underline; color: var(--links); } /* cite: 2 */
.nt-imp-del { cursor: pointer; color: var(--links); font-size: 16px; padding: 0 4px; } /* cite: 2 */
.nt-forumsub-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; border: 1px solid var(--borders); border-radius: 6px; background: var(--cover2); color: inherit; cursor: pointer; padding: 5px 11px; font-family: var(--font-accent), sans-serif; font-weight: 400; text-transform: uppercase; vertical-align: middle; } /* cite: 1 */

#mention-suggest { display: none; position: absolute; z-index: 9999; background: var(--pun); border: 1px solid var(--borders); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); min-width: 190px; max-height: 200px; overflow-y: auto; padding: 4px 0; } /* cite: 1, 3 */
.mention-item { padding: 7px 12px; cursor: pointer; transition: background 0.15s; }
.mention-item:hover { background: var(--cover2); } /* cite: 1 */
.mention-item div:first-child { font-family: var(--font-accent), sans-serif; font-weight: 400; text-transform: uppercase; color: var(--text1); } /* cite: 1 */
.mention-item div:last-child { margin-top: 3px; font-family: var(--font-accent), sans-serif; font-weight: 400; text-transform: uppercase; color: var(--text2); letter-spacing: 0.5px; } /* cite: 1 */

/* --- Точечное прочтение строки в модалке (галочка) --- */
.nt-list-item { position: relative; }
.nt-list-item-read {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #bbb;
    font-size: 11px;
    transition: color 0.15s, background 0.15s;
}
.nt-list-item.unread .nt-list-item-read { display: flex; }
.nt-list-item-read:hover { color: #fff; background: var(--links); }

/* --- Ползунок громкости звука --- */
.nt-volume-cell { grid-column: 2 / 5; justify-content: stretch; }
.nt-volume-cell input[type="range"] { width: 100%; accent-color: var(--links); cursor: pointer; }

/* --- Ссылка «Отключить» рядом со статусом привязки TG --- */
#nota-tg-unlink-btn { margin-left: 6px; color: #c0392b; text-decoration: underline; cursor: pointer; }

:root:has(body[data-contrast="3"]) #nota-modal { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5); }