﻿/* =============================================
   NOTA NOTIFY — UI Kit
   ============================================= */

/* --- Кнопка-колокольчик --- */
#nota-noti-trigger {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    z-index: 19999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #888;
}

#nota-noti-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    color: #444;
}

#nota-noti-trigger.has-unread {
    color: #333;
}

#nota-noti-trigger .bubble {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #c0392b;
    color: #fff;
    font: 600 9px/1 sans-serif;
    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.25);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* --- Модалка --- */
#nota-modal {
    width: 500px;
    max-width: calc(100vw - 32px);
    height: 520px;
    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;
}

/* --- Шапка --- */
.nota-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    font: 600 10px/1 var(--font3, sans-serif);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #aaa;
    flex-shrink: 0;
}

.nota-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;
}

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

/* --- Вкладки --- */
#nota-modal-tabs {
    display: flex;
    padding: 12px 20px 0;
    gap: 4px;
    flex-shrink: 0;
    border-bottom: 1px solid #ebebeb;
}

.nota-tab-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font: 500 11px/1 var(--font3, sans-serif);
    color: #bbb;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.2s, background 0.2s;
    position: relative;
    bottom: -1px;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    user-select: none;
    white-space: nowrap;
}

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

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

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

.nota-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;
}

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

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

/* --- Список уведомлений --- */
#nota-modal-list {
    overflow-y: auto;
    flex-grow: 1;
    padding: 4px 0;
}

#nota-modal-list::-webkit-scrollbar { width: 3px; }
#nota-modal-list::-webkit-scrollbar-track { background: transparent; }
#nota-modal-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 10px;
}

.nt-list-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 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-sender {
    font: 600 12px/1 var(--font3, sans-serif);
    color: #333;
}

.nt-list-item-text {
    font: 400 11px/1.4 var(--font1, 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 var(--font1, sans-serif);
    color: #ccc;
}

/* --- Футер (TG) --- */
#nota-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 var(--font3, 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 var(--font3, sans-serif);
    color: #aaa;
    text-align: center;
    padding: 4px 0;
}

.tg-status-instruction {
    font: 400 11px/1.6 var(--font1, 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;
}

/* --- Шапка модалки (с кнопкой настроек) --- */
.nota-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

#nota-settings-btn {
    font-size: 14px !important;
}

#nota-markread-btn {
    font-size: 13px !important;
}

/* --- Панель настроек --- */
.nt-settings {
    padding: 16px 24px 8px;
}

.nt-settings-header {
    display: grid;
    grid-template-columns: 1fr 120px 120px;
    gap: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 4px;
}

.nt-settings-header-cell {
    font: 500 9px/1 var(--font3, 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 120px 120px;
    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 var(--font3, 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-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;
}

#nota-markread-btn {
    font-size: 13px !important;
    opacity: 0.4;
}

#nota-markread-btn:hover {
    opacity: 1 !important;
}

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

/* --- @-саджест --- */
#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;
}

#mention-suggest::-webkit-scrollbar { width: 3px; }
#mention-suggest::-webkit-scrollbar-track { background: transparent; }
#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 var(--font3, sans-serif);
    color: #333;
}

.mention-item div:last-child {
    margin-top: 3px;
    font: 400 8px/1 var(--font3, sans-serif);
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Браузерное уведомление --- */
#browser-notice {
    position: fixed;
    bottom: 25px;
    right: 80px;
    width: 270px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px 16px;
    color: #333;
    display: none;
    font-family: var(--font1, sans-serif);
    z-index: 999999;
    pointer-events: all;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    animation: ntSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.nt-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;
}

.nt-close:hover {
    color: #666;
}

.nt-title {
    font: 500 9px/1 var(--font3, sans-serif);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bbb;
    margin-bottom: 7px;
}

.nt-text {
    font: 400 11px/1.5 var(--font1, sans-serif);
    color: #444;
    margin-bottom: 10px;
    padding-right: 16px;
}

.nt-link {
    display: inline-block;
    padding: 4px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font: 500 9px/1 var(--font3, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    pointer-events: auto;
}

.nt-link:hover {
    background: #eee;
    color: #333;
}
