/* ===== FENIXFINE NOTIFICATIONS ===== */

/* ===== КОЛОКОЛЬЧИК ===== */
.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-bell-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text);
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.notif-bell-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25);
}

/* ===== БЕЙДЖ ===== */
.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: var(--primary);
    color: #fff;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-card);
    z-index: 1;
    animation: notif-pop 0.3s ease;
}

@keyframes notif-pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== ДРОПДАУН ===== */
.notif-dropdown {
    position: absolute !important;
    top: calc(100% + 12px) !important;
    right: 0 !important;
    width: 380px !important;
    max-height: 520px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255,255,255,0.06) !important;
    z-index: 2000 !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: notif-drop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notif-dropdown.open {
    display: flex !important;
}

@keyframes notif-drop {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== ШАПКА ===== */
.notif-header {
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg,
        rgba(211, 47, 47, 0.08) 0%,
        rgba(211, 47, 47, 0.03) 100%) !important;
    border-bottom: 2px solid var(--border) !important;
    position: relative !important;
    overflow: hidden !important;
}

.notif-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--primary-dark),
        var(--primary),
        var(--primary-light),
        var(--primary));
    background-size: 200% auto;
    animation: notif-gradient 3s linear infinite;
}

@keyframes notif-gradient {
    from { background-position: 0% center; }
    to   { background-position: 200% center; }
}

.notif-header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 18px 10px !important;
}

.notif-title {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    letter-spacing: -0.02em !important;
}

.notif-header-actions {
    padding: 0 18px 14px !important;
    display: flex !important;
    gap: 8px !important;
}

.notif-read-all {
    flex: 1 !important;
    font-size: 0.82rem !important;
    color: var(--primary) !important;
    background: rgba(211, 47, 47, 0.08) !important;
    border: 1px solid rgba(211, 47, 47, 0.25) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    padding: 9px 14px !important;
    transition: all var(--transition) !important;
    text-align: center !important;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.1) !important;
}

.notif-read-all:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.35) !important;
}

/* ===== СПИСОК ===== */
.notif-list {
    overflow-y: auto !important;
    flex: 1 !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    max-height: 400px !important;
}

.notif-list::-webkit-scrollbar {
    width: 4px;
}

.notif-list::-webkit-scrollbar-track {
    background: transparent;
}

.notif-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

/* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
.notif-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 48px 20px !important;
    gap: 14px !important;
}

.notif-empty-icon {
    font-size: 3rem !important;
    animation: notif-shake 3s ease-in-out infinite;
}

@keyframes notif-shake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25%       { transform: rotate(-15deg) scale(1.1); }
    75%       { transform: rotate(15deg) scale(1.1); }
}

.notif-empty-text {
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* ===== ЗАГРУЗКА ===== */
.notif-loading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 48px 20px !important;
    gap: 14px !important;
}

.notif-loading-spinner {
    width: 40px !important;
    height: 40px !important;
    border: 3px solid var(--border) !important;
    border-top-color: var(--primary) !important;
    border-radius: 50% !important;
    animation: notif-spin 0.8s linear infinite !important;
}

@keyframes notif-spin {
    to { transform: rotate(360deg); }
}

.notif-loading p {
    font-size: 0.85rem !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
}

/* ===== КАРТОЧКА УВЕДОМЛЕНИЯ ===== */
.notif-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg-secondary) !important;
    position: relative !important;
    /* ✅ Убрали overflow:hidden чтобы кнопка не обрезалась */
    overflow: visible !important;
    transition: all 0.25s ease !important;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.notif-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border);
    border-radius: 12px 0 0 12px;
    transition: background var(--transition);
}

.notif-item:hover {
    transform: translateY(-2px) !important;
    border-color: var(--primary) !important;
    box-shadow:
        0 8px 24px rgba(211, 47, 47, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    background: var(--bg-card) !important;
}

.notif-item:hover::before {
    background: var(--primary);
}

.notif-item:active {
    transform: translateY(0) !important;
}

.notif-item.unread {
    background: rgba(211, 47, 47, 0.04) !important;
    border-color: rgba(211, 47, 47, 0.2) !important;
    box-shadow:
        0 4px 16px rgba(211, 47, 47, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.notif-item.unread::before {
    background: var(--primary);
}

.notif-item.unread:hover {
    background: rgba(211, 47, 47, 0.08) !important;
    box-shadow:
        0 8px 28px rgba(211, 47, 47, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* ===== КЛИКАБЕЛЬНАЯ ЧАСТЬ ===== */
.notif-item-main {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
    cursor: pointer !important;
}

.notif-item-main:hover {
    opacity: 0.85;
}

/* ===== ИКОНКА ===== */
.notif-item-icon {
    font-size: 1.3rem !important;
    flex-shrink: 0 !important;
    width: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg-card) !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    transition: all var(--transition) !important;
}

.notif-item:hover .notif-item-icon {
    border-color: var(--primary) !important;
    box-shadow:
        0 4px 12px rgba(211, 47, 47, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.08) !important;
}

/* ===== ТЕЛО ===== */
.notif-item-body {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.notif-item-text {
    font-size: 0.88rem !important;
    color: var(--text) !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
    /* ✅ Обрезаем длинный текст в 2 строки */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.notif-item-text b {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.notif-item-time {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
}

/* ===== ТОЧКА НЕПРОЧИТАННОГО ===== */
.notif-item-dot {
    width: 8px !important;
    height: 8px !important;
    background: var(--primary) !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-shadow: 0 0 8px rgba(211, 47, 47, 0.6) !important;
    animation: notif-pulse 2s ease-in-out infinite !important;
}

@keyframes notif-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(211, 47, 47, 0.4); }
    50%       { box-shadow: 0 0 14px rgba(211, 47, 47, 0.8); }
}

/* ===== КНОПКА УДАЛЕНИЯ ===== */
.notif-delete-btn {
    flex-shrink: 0 !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    color: var(--text-secondary) !important;
    font-size: 0.75rem !important;
    opacity: 0.4 !important;
    transition: all 0.2s ease !important;
}

.notif-item:hover .notif-delete-btn {
    opacity: 1 !important;
}

.notif-delete-btn:hover {
    background: rgba(231, 76, 60, 0.12) !important;
    border-color: #e74c3c !important;
    color: #e74c3c !important;
    transform: scale(1.1) !important;
}

.notif-delete-btn:active {
    transform: scale(0.95) !important;
}

/* ===== ТЁМНАЯ ТЕМА ===== */
[data-theme="dark"] .notif-dropdown {
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] .notif-item {
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .notif-item.unread {
    background: rgba(211, 47, 47, 0.08) !important;
    border-color: rgba(211, 47, 47, 0.25) !important;
}

[data-theme="dark"] .notif-item:hover {
    background: rgba(211, 47, 47, 0.12) !important;
}

[data-theme="dark"] .notif-item-icon {
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .notif-read-all {
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.15) !important;
}

[data-theme="dark"] .notif-delete-btn {
    background: var(--bg-secondary) !important;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    #notif-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 92vw !important;
        right: auto !important;
    }
}

@media (max-width: 480px) {
    .notif-bell-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    .notif-dropdown {
        width: calc(100vw - 24px) !important;
        right: -50px !important;
        max-height: 70vh !important;
        border-radius: 16px !important;
    }

    .notif-item {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .notif-item-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }

    /* ✅ На мобиле кнопка удаления всегда немного видна */
    .notif-delete-btn {
        opacity: 0.6 !important;
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
    }
}