﻿/* =============================================
   MARKET NOTIFY — UI Kit (generic, white-label)
   Иконки — FontAwesome с фолбэком: не полагаемся на CSS-переменную --fa
   (грабля: на «голых» форумах она может быть не определена).
   ============================================= */

/* Грабля themurmur.ru (2026-07-08): форум подключает FA6 через
   v4-font-face.min.css + fontawesome.min.css. Реальный @font-face там
   зарегистрирован только под legacy-именем "FontAwesome" (v4-совместимость).
   А классы fa-solid/fa-regular из fontawesome.min.css по умолчанию просят
   font-family: var(--fa-style-family, "Font Awesome 6 Free") — этого шрифта
   нет, поэтому глиф не резолвится → квадрат-тофу. Юникод-контент (::before)
   при этом подставляется верно, ломается только font-family. Принудительно
   перекрываем на реально загруженное имя семейства внутри модалки. */
#mn-modal .fa-solid,
#mn-modal .fa-regular,
#mn-modal .fa-brands {
    font-family: "FontAwesome" !important;
    font-weight: normal !important;
    font-style: normal;
}

#mn-noti-trigger {
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#mn-noti-trigger:hover { opacity: 0.75; }

#mn-noti-trigger.has-unread { color: #c0392b; }

#mn-noti-trigger .bubble {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #c0392b;
    color: #fff;
    font: 600 9px/1 sans-serif;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}

#mn-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
}

#mn-modal {
    width: 600px;
    max-width: calc(100vw - 32px);
    height: 720px;
    max-height: 90vh;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #333;
}

.mn-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    font: 600 10px/1 sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #aaa;
    flex-shrink: 0;
}

.mn-modal-header span {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #999;
    font-family: Arial, sans-serif;
    font-weight: 300;
    transition: color 0.15s;
}

.mn-modal-header span:hover { color: #333; }

#mn-modal-tabs {
    display: flex;
    flex-wrap: wrap;
    padding: 12px 20px 8px;
    gap: 4px;
    flex-shrink: 0;
    border-bottom: 1px solid #ebebeb;
}

.mn-tab-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    font: 500 11px/1 sans-serif;
    color: #bbb;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    border: 1px solid transparent;
    background: transparent;
    user-select: none;
    white-space: nowrap;
}

.mn-tab-btn i { font-size: 12px; }

.mn-tab-btn:hover { color: #666; }

.mn-tab-btn.active {
    color: #333;
    background: #fff;
    border-color: #ebebeb;
}

.mn-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 1px 5px;
    font-size: 8px;
    min-width: 16px;
    color: #999;
    font-family: sans-serif;
}

.mn-tab-btn.active .mn-tab-count { background: #e8e8e8; color: #666; }

.mn-tab-count.unread-badge { background: #c0392b !important; color: #fff !important; }

#mn-modal-list { overflow-y: auto; flex-grow: 1; padding: 4px 0; }
#mn-modal-list::-webkit-scrollbar { width: 3px; }
#mn-modal-list::-webkit-scrollbar-track { background: transparent; }
#mn-modal-list::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }

#mn-settings-panel { overflow-y: auto; flex-grow: 1; }
#mn-settings-panel::-webkit-scrollbar { width: 3px; }
#mn-settings-panel::-webkit-scrollbar-track { background: transparent; }
#mn-settings-panel::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }

#mn-admin-panel { overflow-y: auto; flex-grow: 1; padding: 14px 20px; }
#mn-admin-panel::-webkit-scrollbar { width: 3px; }
#mn-admin-panel::-webkit-scrollbar-track { background: transparent; }
#mn-admin-panel::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }

#mn-admin-btn { cursor: pointer; font-size: 14px; line-height: 1; }

.nt-admin-section-title {
    font: 600 10px/1 sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 10px 0 8px;
}

.nt-imp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font: 400 12px/1.3 sans-serif;
    color: #333;
}
.nt-imp-row:last-child { border-bottom: none; }
.nt-imp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-imp-remove { cursor: pointer; color: #bbb; font-size: 16px; line-height: 1; flex-shrink: 0; }
.nt-imp-remove:hover { color: #c0392b; }

.nt-admin-btn {
    width: 100%;
    margin-top: 10px;
    padding: 9px;
    border: none;
    border-radius: 6px;
    background: rgb(var(--acc1, 90, 158, 111));
    color: #fff;
    font: 600 11px/1 sans-serif;
    cursor: pointer;
    transition: opacity 0.15s;
}
.nt-admin-btn:hover { opacity: 0.85; }
.nt-admin-btn:disabled { background: #ddd; color: #999; cursor: not-allowed; opacity: 1; }

.nt-admin-textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font: 400 12px/1.4 sans-serif;
    color: #333;
}

.nt-forumsub-btn {
    display: inline-block;
    margin: 8px 0;
    padding: 7px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font: 600 11px/1 sans-serif;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nt-forumsub-btn:hover { background: #f5f5f5; }
/* Зелёный — семантический сигнал «подписан», не акцент темы (см. §review). */
.nt-forumsub-btn.subscribed { background: #eafaf0; border-color: #a8dfba; color: #2e7d32; }
.nt-forumsub-btn.subscribed:hover { background: #dff3e6; }

.nt-list-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 40px 11px 20px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    transition: background 0.15s;
    color: #333;
}

.nt-list-item:last-child { border-bottom: none; }
.nt-list-item:hover { background: #fafafa; }

.nt-list-item-read {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    color: #999;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.nt-list-item:hover .nt-list-item-read { opacity: 1; }
.nt-list-item-read:hover { background: #e8f5e9; color: #2e7d32; }

.nt-list-item-sender { font: 600 12px/1 sans-serif; color: #333; }

.nt-list-item-text {
    font: 400 11px/1.4 sans-serif;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nt-empty { padding: 32px 20px; text-align: center; font: 400 11px/1.5 sans-serif; color: #ccc; }

#mn-modal-tg-footer { padding: 12px 20px; border-top: 1px solid #ebebeb; flex-shrink: 0; }

.tg-btn-connect {
    width: 100%;
    padding: 9px 16px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    font: 500 10px/1 sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tg-btn-connect:hover:not(:disabled) { background: #eee; color: #333; }
.tg-btn-connect:disabled { opacity: 0.5; cursor: default; }

.tg-status-linked {
    font: 400 10px/1 sans-serif;
    color: #aaa;
    text-align: center;
    padding: 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#mn-tg-unlink-btn {
    cursor: pointer;
    text-decoration: underline;
    color: #999;
}
#mn-tg-unlink-btn:hover { color: #c0392b; }
.tg-status-instruction { font: 400 11px/1.6 sans-serif; color: #999; text-align: center; }

.tg-code {
    display: inline-block;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 3px 10px;
    font-family: monospace;
    font-size: 14px;
    color: #333;
    letter-spacing: 2px;
    margin-top: 6px;
}

.mn-modal-header-actions { display: flex; align-items: center; gap: 10px; }
.mn-modal-header-actions span {
    cursor: pointer;
    line-height: 1;
    color: #999;
    font-family: Arial, sans-serif;
    font-weight: 300;
    transition: color 0.15s;
}
.mn-modal-header-actions span:hover { color: #333; }

#mn-settings-btn { font-size: 14px !important; }
#mn-markread-btn { font-size: 13px !important; opacity: 0.4; }
#mn-markread-btn:hover { opacity: 1 !important; }

.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 #ebebeb;
    margin-bottom: 4px;
}

.nt-settings-header-cell {
    font: 500 9px/1 sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bbb;
    text-align: center;
}
.nt-settings-header-cell:first-child { text-align: left; }

.nt-settings-row {
    display: grid;
    grid-template-columns: 1fr 90px 90px 90px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 0;
}
.nt-settings-row:last-child { border-bottom: none; }

.nt-settings-label { display: flex; align-items: center; gap: 8px; font: 500 11px/1 sans-serif; color: #444; }
.nt-settings-label i { font-size: 13px; color: #aaa; width: 16px; text-align: center; }

.nt-settings-cell { display: flex; justify-content: center; }

.nt-col-toggle { cursor: pointer; user-select: none; transition: color 0.15s; }
.nt-col-toggle:hover { color: rgb(var(--acc1, 90, 158, 111)); }

.nt-volume-cell { display: flex; align-items: center; padding: 0 4px; }
.nt-volume-cell input[type="range"] {
    width: 100%;
    accent-color: rgb(var(--acc1, 90, 158, 111));
}

#nt-toggle-all-btn { margin-top: 4px; }
#nt-toggle-all-btn.nt-btn-danger { background: #c0392b; }

.nt-toggle { display: flex; align-items: center; gap: 0; cursor: pointer; user-select: none; }
.nt-toggle input { display: none; }

.nt-toggle-track {
    display: inline-block;
    width: 32px;
    height: 18px;
    background: #ddd;
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

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

.nt-toggle input:checked + .nt-toggle-track { background: #5a9e6f; }
.nt-toggle input:checked + .nt-toggle-track::after { transform: translateX(14px); }
.nt-toggle-disabled .nt-toggle-track { opacity: 0.3; cursor: default; }

.nt-list-item.unread { background: #fafbff; border-left: 3px solid #c0392b; padding-left: 17px; }
.nt-list-item.unread .nt-list-item-sender { color: #111; }

.nt-settings-divider { border-top: 1px solid #ebebeb; margin: 4px 0; }

#mn-mention-suggest {
    display: none;
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    min-width: 190px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}
#mn-mention-suggest::-webkit-scrollbar { width: 3px; }
#mn-mention-suggest::-webkit-scrollbar-track { background: transparent; }
#mn-mention-suggest::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 10px; }

.mention-item { padding: 7px 12px; cursor: pointer; transition: background 0.15s; }
.mention-item:hover { background: #f5f5f5; }
.mention-item div:first-child { font: 500 11px/1 sans-serif; color: #333; }

#mn-notice-stream {
    position: fixed;
    bottom: 25px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.mn-notice-closeall {
    pointer-events: all;
    cursor: pointer;
    align-self: flex-end;
    padding: 5px 10px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    font: 500 10px/1 sans-serif;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.mn-notice-closeall:hover { opacity: 1; }

.mn-notice {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 270px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 30px 12px 12px;
    color: #333;
    font-family: sans-serif;
    pointer-events: all;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    animation: mnSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mn-notice-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #eee;
}

.mn-notice-body { flex: 1; min-width: 0; }

.mn-notice-text { font: 400 11px/1.5 sans-serif; color: #444; margin-bottom: 6px; }

.mn-notice-link {
    display: inline-block;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font: 500 9px/1 sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.mn-notice-link:hover { background: #eee; color: #333; }

.mn-notice-agg {
    position: absolute;
    top: 10px;
    right: 30px;
    font: 600 10px/1 sans-serif;
    color: #c0392b;
}

.mn-notice-close {
    position: absolute;
    top: 10px;
    right: 12px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #ccc;
    font-family: Arial, sans-serif;
    font-weight: 300;
    transition: color 0.15s;
}
.mn-notice-close:hover { color: #666; }
