/* left-sidebar.css — COMPACT & CLEAN */

#notify-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background-color: var(--bg-body);
    
    /* НОВОЕ: Скролл только внутри списка */
    flex: 1;            /* Занимает все свободное место под заголовком */
    overflow-y: auto;   /* Полоса прокрутки теперь ТОЛЬКО ТУТ */
    overflow-x: hidden;
    min-height: 0;      /* Хак для Firefox/Flexbox */
}

/* Карточка уведомления */
.n-item {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 9px 10px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 72px;
    flex: 0 0 auto;
    box-sizing: border-box;
    --notif-accent: var(--accent-blue);
    --notif-accent-rgb: 56, 189, 248;
}

.n-item.is-removing {
    min-height: 0 !important;
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
    pointer-events: none;
    overflow: hidden;
}

/* Ховер */
.n-item:hover {
    /* NOTIFICATION COLOR EXPERIMENT: hover follows the notification type accent. */
    border-color: var(--notif-accent);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

/* Активное */
.n-item.highlight {
    border-left: 3px solid var(--notif-accent);
    background: linear-gradient(90deg, rgba(var(--notif-accent-rgb), 0.08) 0%, transparent 100%);
    padding-left: 7px; /* Компенсация бордера */
}

.n-item.soft-refresh {
    animation: notifSoftRefresh 520ms ease-out;
}

@keyframes notifSoftRefresh {
    0% {
        box-shadow: inset 0 0 0 1px rgba(var(--notif-accent-rgb), 0.3), 0 0 0 rgba(var(--notif-accent-rgb), 0);
        background: linear-gradient(90deg, rgba(var(--notif-accent-rgb), 0.1) 0%, transparent 100%);
    }
    100% {
        box-shadow: inset 0 0 0 1px rgba(var(--notif-accent-rgb), 0.08), 0 0 0 rgba(var(--notif-accent-rgb), 0);
        background: transparent;
    }
}

/* --- ПРАВЫЙ ВЕРХНИЙ УГОЛ (БЕЙДЖ АНКЕТЫ) --- */
.n-bot-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 6px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.n-bot-name {
    font-size: 10px;
    color: #cbd5e1; /* Сделали светлее (было muted) */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.n-bot-avatar {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

/* --- ЛЕВАЯ КОЛОНКА (Клиент + Время) --- */
.n-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 42px; /* Фикс ширина */
    flex-shrink: 0;
    gap: 5px;
    min-height: 54px;
}

.n-avatar-wrapper {
    position: relative;
    width: 38px;  /* Чуть меньше */
    height: 38px;
    flex: 0 0 38px;
}

.n-client-avatar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.n-type-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-light);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    z-index: 2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ВРЕМЯ (Под фото) */
.n-time {
    font-size: 10px;
    color: #eef2f7;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    line-height: 1.15;
    flex: 0 0 auto;
}

/* --- ЦЕНТР (Текст) --- */
.n-center-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding-right: 60px; /* Отступ справа, чтобы текст не наезжал на бейдж бота */
    min-width: 0;
}

.n-client-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.n-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 28px;
}

.n-item-mail {
    --notif-accent: #f59e0b;
    --notif-accent-rgb: 245, 158, 11;
    overflow: hidden;
}

.n-item-mail::after {
    content: "\f0e0";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 14px;
    bottom: -8px;
    font-size: 58px;
    line-height: 1;
    color: rgba(245, 158, 11, 0.08);
    pointer-events: none;
    transform: rotate(-8deg);
}

.n-item-mail .n-text {
    display: block;
    max-height: 28px;
    overflow: hidden;
}

.n-paid-inside-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 18px;
    margin: 1px 0 3px;
    padding: 0 6px;
    border-radius: 5px;
    border: 1px solid rgba(56, 189, 248, 0.42);
    background: rgba(56, 189, 248, 0.11);
    color: #7dd3fc;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.45px;
    box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.25);
}

.n-paid-inside-badge i {
    font-size: 9px;
}

.n-item.has-paid-action[data-notif-action="passive"] {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.n-item.reminder-item {
    align-items: center;
}

.n-item.reminder-item .n-center-col {
    padding-right: 10px;
}

.n-item.reminder-item .n-right-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0;
    padding-right: 0;
}

.n-item.reminder-item .n-text {
    max-height: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.n-item-mail .n-center-col {
    justify-content: center;
}

.n-item-mail .n-client-name {
    font-size: 11px;
    margin-bottom: 4px;
}

.n-item-mail .n-text {
    font-size: 15px;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: 0.3px;
    line-height: 1.1;
    display: block;
    max-height: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

#btn-refresh-notif {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: 0.2s;
    margin-left: auto; /* Прижимает кнопку вправо */
}
#btn-refresh-notif:hover { color: var(--accent-blue); }
#btn-refresh-notif.spinning i {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


.n-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: var(--text-muted);
    gap: 8px;
}
.n-empty-state i { font-size: 24px; opacity: 0.3; }
.n-empty-state div { font-size: 12px; font-weight: 600; }


.notif-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.notif-header-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: 0.2s;
}

.notif-header-btn:hover {
    color: var(--accent-blue);
    background: rgba(51, 65, 85, 0.55);
}

.alike-header-btn {
    color: #c08497;
}

.alike-header-btn:hover {
    color: #f0a8bd;
    background: rgba(190, 92, 120, 0.12);
}

.alike-modal-overlay {
    z-index: 6100;
}

.alike-modal-card {
    width: min(1120px, calc(100vw - 48px));
    max-height: min(680px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: #172235;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.62);
    overflow: hidden;
}

.alike-modal-header,
.alike-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.alike-modal-header small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 11px;
}

.alike-modal-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e8b4c3;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.alike-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    overflow: auto;
}

.alike-column {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.alike-column span {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.65px;
}

.alike-column textarea {
    min-height: 360px;
    resize: vertical;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 9px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
}

.alike-column textarea:focus {
    border-color: rgba(232, 180, 195, 0.72);
    box-shadow: 0 0 0 2px rgba(190, 92, 120, 0.12);
}

.alike-modal-footer {
    border-top: 1px solid var(--border-light);
    border-bottom: none;
}

#alike-version-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

#alike-save-btn {
    border: 1px solid rgba(232, 180, 195, 0.48);
    border-radius: 8px;
    padding: 9px 14px;
    background: rgba(190, 92, 120, 0.16);
    color: #f4c5d2;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.7px;
}

#alike-save-btn:hover {
    background: rgba(190, 92, 120, 0.26);
}

#alike-save-btn:disabled {
    cursor: wait;
    opacity: 0.55;
}

@media (max-width: 900px) {
    .alike-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .alike-column textarea {
        min-height: 220px;
    }
}

.notif-settings-wrap {
    position: relative;
}

.notif-settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    transform: none;
    width: 176px;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
    z-index: 30;
}

.notif-settings-menu.show {
    display: flex;
}

.notif-settings-item,
.notif-settings-check {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-sizing: border-box;
}

.notif-settings-item {
    border: none;
    background: transparent;
    cursor: pointer;
}

.notif-settings-item i,
.notif-settings-check i {
    width: 14px;
    text-align: center;
    color: #94a3b8;
    flex: 0 0 14px;
}

.notif-settings-item:hover,
.notif-settings-check:hover {
    background: rgba(51, 65, 85, 0.55);
}

.notif-settings-sound strong {
    margin-left: auto;
    font-size: 10px;
    letter-spacing: 0.6px;
    color: var(--accent-blue);
}

.notif-settings-check {
    cursor: pointer;
    position: relative;
}

.notif-settings-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.notif-settings-checkmark {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    transition: 0.2s ease;
}

.notif-settings-checkmark::after {
    content: '';
    width: 7px;
    height: 4px;
    border-left: 2px solid #020617;
    border-bottom: 2px solid #020617;
    transform: rotate(-45deg) scale(0);
    transition: 0.16s ease;
    margin-top: -1px;
}

.notif-settings-check input:checked + .notif-settings-checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.notif-settings-check input:checked + .notif-settings-checkmark::after {
    transform: rotate(-45deg) scale(1);
}
