/* ============================================================================
   УВЕДОМЛЕНИЯ - СТИЛИ
   ============================================================================ */

/* Кнопка колокольчика в шапке */
.notifications-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--font-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notifications-bell:hover {
    background: var(--bg-content-secondary);
    color: var(--font-primary);
}

.notifications-bell i {
    font-size: var(--font-size-md)
}

/* Бейдж с количеством */
.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-md);
    background: var(--accent-link);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: badge-pulse 2s infinite;
    z-index: 1;
}

.notifications-badge.hidden {
    display: none;
}

/* Бейдж на мобильных кнопках gc-nav-icon */
.gc-nav-icon .notifications-badge {
    top: 0;
    right: 0;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Dropdown панель уведомлений */
.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px; /* Отступ от кнопки на десктопе */
    width: 380px;
    max-height: 480px;
    background: var(--bg-content-main);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    display: none;
    overflow: hidden;
    flex-direction: column;
}

.notifications-dropdown.show {
    display: flex;
    animation: dropdown-fade-in 0.2s ease;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок dropdown */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-mdl);
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0; /* Не сжимается */
}

.notifications-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--font-primary);
    margin: 0;
}

.notifications-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.notifications-action-btn {
    background: transparent;
    border: none;
    color: var(--font-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.notifications-action-btn:hover {
    background: var(--bg-content-secondary);
    color: var(--accent-link);
}

/* Список уведомлений */
.notifications-list {
    flex: 1; /* Занимает оставшееся место */
    min-height: 0; /* Позволяет сжаться */
    overflow-y: auto;
    max-height: 400px; /* Ограничение для десктопа */
}

.notifications-list::-webkit-scrollbar {
    width: 6px;
}

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

.notifications-list::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: var(--radius-sm);
}

/* Одно уведомление */
.notification-item {
    display: flex;
    gap: var(--spacing-3sm);
    padding: var(--spacing-md) var(--spacing-mdl);
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-primary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg-content-secondary);
}

/* Непрочитанные уведомления без фона - только точка */
/* .notification-item.unread - без стилей, для семантики */

/* Аватар уведомления */
.notification-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.notification-avatar-main {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-content-secondary);
}

/* Плейсхолдер если нет аватарки */
.notification-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

/* Маленькая аватарка пользователя в правом нижнем углу */
.notification-avatar-small {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bg-content-main);
    object-fit: cover;
    background: var(--bg-content-secondary);
}

/* Маленький плейсхолдер */
.notification-avatar-small-placeholder {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bg-content-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: white;
    background: var(--font-secondary);
}

/* Маленькая аватарка для иконки */
.notification-icon-user-avatar {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bg-content-main);
    object-fit: cover;
    background: var(--bg-content-secondary);
}

/* Fallback иконка (если нет аватарок) */
.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    background: var(--bg-content-secondary);
    position: relative;
}

.notification-icon i {
    color: var(--font-secondary);
}

/* Контент уведомления */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 14px;
    color: var(--font-primary);
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: var(--font-size-sm);
    color: var(--font-secondary);
}

/* Индикатор непрочитанного */
.notification-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-link);
    flex-shrink: 0;
    margin-top: 6px;
}

/* Кнопка удаления уведомления */
.notification-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--font-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    font-size: 12px;
}

.notification-item {
    position: relative;
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    background: rgba(244, 67, 54, 0.15);
    color: #F44336;
}

/* Скрываем точку непрочитанного когда есть кнопка удаления */
.notification-item:hover .notification-unread-dot {
    opacity: 0;
}

/* Пустое состояние */
.notifications-empty {
    padding: 60px 20px;
    text-align: center;
}

.notifications-empty-icon {
    font-size: 48px;
    color: var(--font-secondary);
    opacity: 0.3;
    margin-bottom: 16px;
}

.notifications-empty-text {
    font-size: 14px;
    color: var(--font-secondary);
    margin: 0;
}

/* Футер с кнопкой "показать все" */
.notifications-footer {
    padding: var(--spacing-3sm) var(--spacing-mdl);
    border-top: 1px solid var(--border-primary);
    text-align: center;
}

.notifications-show-all {
    font-size: 14px;
    color: var(--accent-link);
    text-decoration: none;
    font-weight: 600;
}

.notifications-show-all:hover {
    text-decoration: underline;
}

/* Загрузка */
.notifications-loading {
    padding: 60px 20px;
    text-align: center;
}

.notifications-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-link);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

/* ============================================================================
   АДАПТИВНОСТЬ
   ============================================================================ */

@media (max-width: 768px) {
    .notifications-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto; /* Не фиксируем низ */
        width: 100%;
        min-height: 100vh; /* Занимает весь экран */
        max-height: 100vh;
        margin-top: 0; /* Убираем отступ на мобайле */
        border-radius: 0;
        z-index: var(--z-notification);
    }
    
    .notifications-header {
        padding: var(--spacing-md);
        flex-shrink: 0; /* Не сжимается */
    }
    
    .notifications-list {
        flex: 0 1 auto; /* НЕ растягивается, подстраивается под контент */
        overflow-y: auto;
        max-height: calc(100vh - 72px); /* Высота экрана минус примерная высота header */
    }
    
    .notification-item {
        padding: var(--spacing-md) var(--spacing-md);
    }
    
    /* Кнопка закрытия на мобильном */
    .notifications-close-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: var(--bg-content-secondary);
        border: none;
        border-radius: 50%;
        color: var(--font-primary);
        cursor: pointer;
    }
}

@media (min-width: 769px) {
    .notifications-close-mobile {
        display: none;
    }
}

/* ============================================================================
   СТРАНИЦА ВСЕХ УВЕДОМЛЕНИЙ
   ============================================================================ */

.notifications-page {
    max-width: 640px;
    margin: 0 auto;
}

.notifications-page .notification-item {
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    border: 1px solid var(--border-primary);
}

.notifications-page .notification-item:last-child {
    border-bottom: 1px solid var(--border-primary);
}

/* Группы по дате */
.notifications-date-group {
    margin-bottom: 24px;
}

.notifications-date-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--font-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

