/* ===== NOTIFICATIONS BELL STYLES ===== */
/* Оптимизированные стили для системы уведомлений в стиле сайта */
/* Версия: 2.0 - Оптимизированная */

/* Контейнер колокольчика уведомлений */
.notifications-bell {
    position: relative;
    display: inline-block;
    margin-left: 12px;
}

/* Кнопка колокольчика */
.notifications-bell-button {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #FFFFFF;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notifications-bell-button:hover {
    background: rgba(200, 254, 0, 0.08);
    border-color: rgba(200, 254, 0, 0.2);
    box-shadow: 0 8px 25px rgba(200, 254, 0, 0.15);
}

/* Фокус только когда выпадающий список открыт */
.notifications-bell:has(.notifications-dropdown.show) .notifications-bell-button:focus {
    outline: 1px solid #C8FE00;
    outline-offset: 0px;
}

/* Убираем фокус когда выпадающий список закрыт */
.notifications-bell-button:focus:not(:focus-within) {
    outline: none;
}

/* Иконка колокольчика */
.notifications-bell-icon {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notifications-bell-button:hover .notifications-bell-icon {
    fill: #C8FE00;
    transform: rotate(15deg);
    filter: drop-shadow(0 0 8px rgba(200, 254, 0, 0.4));
}

/* Индикатор новых уведомлений */
.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #000;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    animation: notificationPulse 2s infinite;
    z-index: 1;
}

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

/* Анимация пульсации для индикатора */
@keyframes notificationPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4), 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4), 0 0 0 8px rgba(255, 107, 107, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4), 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Выпадающее меню уведомлений */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: linear-gradient(135deg, #000000, #080808);
    border: 1px solid rgba(200, 254, 0, 0.15);
    border-radius: 16px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(200, 254, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 420px;
    max-width: 480px;
    max-height: 600px;
    overflow: hidden;
    z-index: 20001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notifications-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 254, 0, 0.5), transparent);
}

/* Заголовок уведомлений */
.notifications-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(200, 254, 0, 0.05), transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: -0.02em;
}

.notifications-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.notifications-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    transform: scale(1.1);
}

/* Список уведомлений */
.notifications-list {
    max-height: 450px; /* Увеличено в 1.5 раза для показа ~4-5 уведомлений */
    overflow-y: auto;
    padding: 8px 0;
    margin: 0;
    display: block; /* Изменено с flex на block для правильного скроллинга */
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 254, 0, 0.6) rgba(255, 255, 255, 0.1);
    scroll-behavior: smooth;
    transition: max-height 0.3s ease;
}

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

.notifications-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(200, 254, 0, 0.5), rgba(200, 254, 0, 0.3));
    border-radius: 3px;
    border: 1px solid rgba(200, 254, 0, 0.2);
    transition: all 0.3s ease;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(200, 254, 0, 0.7), rgba(200, 254, 0, 0.5));
    box-shadow: 0 0 8px rgba(200, 254, 0, 0.3);
}

/* Индикатор скроллинга */
.notifications-list::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notifications-list:not(:hover)::after {
    opacity: 1;
}

/* Элемент уведомления */
.notification-item {
    padding: 16px 24px;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0 16px 12px 16px; /* Увеличен отступ снизу для лучшего разделения */
    overflow: hidden;
    display: flex; /* Изменено на flex для правильного расположения изображения и контента */
    flex-direction: column;
    width: calc(100% - 32px); /* Ширина с учетом отступов */
    min-height: 80px; /* Минимальная высота для предотвращения скачков */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Добавлена тень для разделения */
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, rgba(200, 254, 0, 0.15), rgba(200, 254, 0, 0.05));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-item:hover {
    background: rgba(200, 254, 0, 0.05);
    border-color: rgba(200, 254, 0, 0.2);
    box-shadow: 0 2px 8px rgba(200, 254, 0, 0.1);
}

.notification-item:hover::before {
    width: 4px;
}

.notification-item:last-child {
    border-bottom: none;
    margin-bottom: 0; /* Убираем отступ у последнего элемента */
}

/* Разделитель между уведомлениями */
.notification-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.notification-item.unread {
    background: linear-gradient(135deg, rgba(200, 254, 0, 0.12), rgba(200, 254, 0, 0.06));
    border-color: rgba(200, 254, 0, 0.25);
    box-shadow: 0 2px 8px rgba(200, 254, 0, 0.15);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #C8FE00, #BFFF00);
    box-shadow: 0 0 12px rgba(200, 254, 0, 0.7);
}

/* Изображение уведомления */
.notification-image {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    aspect-ratio: 8/5; /* Соотношение сторон 8:5 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Плейсхолдер для загрузки изображения */
.notification-image-placeholder {
    width: 100%;
    aspect-ratio: 8/5; /* Соотношение сторон 8:5 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.notification-image-placeholder::before {
    content: '📷';
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.6;
}


.notification-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Контейнер контента уведомления */
.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Заголовок уведомления */
.notification-title {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 6px 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Текст уведомления */
.notification-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Время уведомления */
.notification-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-weight: 500;
}

/* Пустое состояние */
.notifications-empty {
    padding: 40px 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 16px;
}

.notifications-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    fill: rgba(200, 254, 0, 0.3);
}

.notifications-empty-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.8);
}

.notifications-empty-text {
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

/* Кнопка "Показать все" */
.notifications-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.notifications-view-all {
    color: #C8FE00;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(200, 254, 0, 0.1);
    border: 1px solid rgba(200, 254, 0, 0.2);
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.notifications-view-all::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(200, 254, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.notifications-view-all:hover {
    color: #BFFF00;
    background: rgba(200, 254, 0, 0.15);
    border-color: rgba(200, 254, 0, 0.3);
    box-shadow: 0 4px 12px rgba(200, 254, 0, 0.2);
    text-decoration: none;
}

.notifications-view-all:hover::before {
    left: 100%;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .notifications-dropdown {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        min-width: auto;
        max-height: calc(100vh - 60px);
        border-radius: 12px;
        z-index: 10000;
    }
    
    .notifications-list {
        max-height: 300px; /* Увеличено для мобильных */
    }
    
    .notification-item {
        padding: 12px 16px;
        margin: 0 12px 8px 12px; /* Добавлен отступ снизу */
        width: calc(100% - 24px); /* Ширина с учетом отступов */
    }
    
    .notification-image {
        margin-bottom: 10px;
    }
    
    .notification-image img {
        max-height: 150px; /* Уменьшаем высоту изображений на мобильных */
    }
    
    .notifications-header {
        padding: 16px 20px 12px;
    }
    
    .notifications-footer {
        padding: 12px 20px 16px;
    }
    
    .notifications-bell-button {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .notifications-bell-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .notifications-dropdown {
        top: 50px;
        left: 5px;
        right: 5px;
        max-height: calc(100vh - 50px);
        border-radius: 8px;
    }
    
    .notifications-list {
        max-height: 225px; /* Увеличено для маленьких экранов */
    }
    
    .notifications-bell-button {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .notifications-bell-icon {
        width: 16px;
        height: 16px;
    }
    
    .notification-item {
        padding: 10px 12px;
        margin: 0 8px 6px 8px; /* Добавлен отступ снизу */
        width: calc(100% - 16px); /* Ширина с учетом отступов */
    }
    
    .notification-image {
        margin-bottom: 8px;
    }
    
    .notification-image img {
        max-height: 120px; /* Еще меньше для маленьких экранов */
    }
    
    .notifications-header {
        padding: 12px 16px 10px;
    }
    
    .notifications-footer {
        padding: 8px 16px 12px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .notifications-bell-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .notifications-list {
        max-height: 270px; /* Увеличено для touch-устройств */
        scroll-behavior: smooth;
    }
    
    .notifications-list::-webkit-scrollbar {
        width: 8px; /* Толще для touch-устройств */
    }
}

/* Анимация появления уведомления */
@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-item.new {
    animation: slideInFromTop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Стили для загрузки */
.notifications-loading {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 16px;
}

.notifications-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #C8FE00;
    border-radius: 50%;
    animation: notificationSpin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes notificationSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
