/* Стили для уведомлений */
.rf-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 0px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    max-width: 400px;
    width: calc(100% - 40px);
    opacity: 0;
    margin: 0 auto;
}

.rf-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.rf-notification__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rf-notification__icon._success {
    color: #10B981;
}

.rf-notification__icon._error {
    color: #EF4444;
}

.rf-notification__content {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
}

.rf-notification__close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    color: #9CA3AF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin-left: 8px;
    position: relative;
}

.rf-notification__close svg {
    width: 16px;
    height: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rf-notification__close:hover {
    color: #4B5563;
}

/* Новые стили для системы уведомлений */
.rf-notification-badge {
    position: absolute;
    top: -8px;
    right: 0px; /* Изменено с -8px на 0px, чтобы избежать горизонтальной прокрутки */
    background-color: #EF4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: 600;
    display: none;
    z-index: 1; /* Добавлен z-index для корректного отображения */
    visibility: hidden; /* Скрываем элемент полностью */
}

.rf-notification-badge.show {
    display: block;
}

/* Отображаем значок уведомлений только внутри контейнера с колокольчиком */
.notification-icon .rf-notification-badge.show,
.menu-item-notification .rf-notification-badge.show {
    visibility: visible;
}

/* Стили для счетчика в меню */
.menu-item-notification {
    position: relative;
}

.notification-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: 0px; /* Изменено с -5px на 0px, чтобы избежать горизонтальной прокрутки */
    background-color: #EF4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: 600;
    display: none;
    z-index: 1; /* Добавлен z-index для корректного отображения */
}

.notification-count.show {
    display: block;
}

/* Стили для контейнера уведомлений */
.rf-notifications-container {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 100%;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.rf-notifications-container.show {
    right: 0;
}

.rf-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.rf-notifications-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.rf-notifications-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.rf-notifications-close:hover {
    color: #4B5563;
}

.rf-notifications-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
}

.rf-notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.2s;
}

.rf-notification-item:hover {
    background-color: #F9FAFB;
}

.rf-notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.rf-notification-item-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

.rf-notification-item-time {
    font-size: 12px;
    color: #9CA3AF;
}

.rf-notification-item-content {
    font-size: 14px;
    margin-bottom: 8px;
}

.rf-notification-item-races {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rf-notification-item-race {
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
}

.rf-notification-item-race:before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10B981;
}

.rf-notification-item-race a {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}

.rf-notification-item-race a:hover {
    text-decoration: underline;
}

.rf-notification-item-race-meta {
    display: block;
    font-size: 12px;
    color: #6B7280;
    margin-top: 2px;
}

.rf-notifications-footer {
    padding: 16px 20px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
}

.rf-notifications-view-all {
    color: #0056b3;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

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

.rf-notifications-mark-all {
    background: none;
    border: none;
    color: #6B7280;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.rf-notifications-mark-all:hover {
    color: #4B5563;
}

.rf-notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: #6B7280;
}

.rf-notifications-empty svg {
    margin-bottom: 16px;
    color: #9CA3AF;
    width: 48px;
    height: 48px;
}

.rf-notifications-empty p {
    margin: 0;
    font-size: 14px;
}

/* Адаптивность */
@media (max-width: 480px) {
    .rf-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        padding: 12px 16px;
        max-width: none;
    }

    .rf-notification__content {
        font-size: 13px;
    }

    .rf-notification__icon {
        width: 20px;
        height: 20px;
    }
    
    /* Стили для отображения локации в мобильной версии */
    .event__features {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    /* Стили для отображения локации в alerts в мобильной версии */
    .race-notification-events .event__features {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    /* Добавляем отступ между элементами локации и цены */
    .event__feature {
        margin-bottom: 0px !important;
        gap: .2rem !important;
        width: 100%;
        display: flex;
        align-items: center;
    }
    
    /* Стили для иконок в элементах локации и цены */
    .event__feature svg {
        margin-right: 5px;
        flex-shrink: 0;
    }
    
    /* Стили для элемента локации */
    .event__feature._location {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Убираем inline-стили для выравнивания в мобильной версии */
    .event__feature._location,
    .event__feature {
        width: 100%;
        text-align: left !important;
    }
    
    /* Обеспечиваем правильное отображение иконок */
    .event__feature svg {
        margin-right: 5px;
        flex-shrink: 0;
    }

    .rf-notification__close {
        width: 20px;
        height: 20px;
    }
    
    .rf-notification__close svg {
        width: 14px;
        height: 14px;
    }
    
    .rf-notifications-container {
        width: 100%;
        right: -100%;
    }
}