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

/* =================================================================
   КНОПКА УВЕДОМЛЕНИЙ - НОВЫЙ ДИЗАЙН
   ================================================================= */

/* Обертка кнопки уведомлений */
.notification-button-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.notification-button-wrapper:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-button-wrapper:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.04);
}

.notification-button-wrapper[aria-expanded="true"] {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Колокольчик */
.notification-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #9ca3af;
    font-size: 18px;
    transition: all 0.2s ease;
}

.notification-button-wrapper:hover .notification-bell {
    color: #ffffff;
    transform: scale(1.05);
}

.notification-button-wrapper[aria-expanded="true"] .notification-bell {
    color: #6366f1;
}

.notification-bell i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Счетчик уведомлений */
.notification-counter {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #111827;
    box-shadow: 
        0 2px 8px rgba(239, 68, 68, 0.4),
        0 0 0 1px rgba(239, 68, 68, 0.1);
    animation: notification-pulse 2s ease-in-out infinite;
    z-index: 100;
}

.notification-counter span {
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

/* Размеры для разного количества цифр */
.notification-counter.two-digit {
    min-width: 24px;
}

.notification-counter.two-digit span {
    font-size: 10px;
}

.notification-counter.max-count {
    min-width: 26px;
}

.notification-counter.max-count span {
    font-size: 9px;
    font-weight: 700;
}

/* Анимация пульсации */
@keyframes notification-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Дропдаун уведомлений */
.notification-dropdown {
    width: 380px;
    background: linear-gradient(145deg, #2a2a3a 0%, #1e1e2e 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4), 
        0 8px 24px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 0;
    margin-top: 8px;
    backdrop-filter: blur(20px);
    max-height: 500px;
    overflow: hidden;
}

/* Заголовок уведомлений */
.notification-dropdown .dropdown-header {
    background: linear-gradient(135deg, #3a3a4a 0%, #2a2a3a 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    padding: 16px 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-dropdown .dropdown-header .badge {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.notification-read-all-header {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.notification-read-all-header:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    transform: translateY(-1px);
}

/* Контейнер для скролла */
.notification-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.notification-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.notification-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.notification-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.notification-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Элемент уведомления */
.notification-item {
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.notification-item:hover {
    background: rgba(139, 92, 246, 0.05);
    transform: translateX(2px);
}

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

.notification-item.unread {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.03));
    border-left: 3px solid #8b5cf6;
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.05);
}

.notification-item.unread:hover {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.06));
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.08);
}

/* Содержимое уведомления */
.notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Иконка уведомления */
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
}

.notification-icon.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.notification-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.notification-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Основное содержимое */
.notification-main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notification-title {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    word-break: break-word;
}

.notification-message {
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
    word-wrap: break-word;
    word-break: break-word;
}

/* Метаданные уведомления */
.notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.notification-time {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.notification-actions {
    display: flex;
    gap: 8px;
}

.notification-action {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.notification-action:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    transform: translateY(-1px);
}

/* Индикатор непрочитанного */
.notification-unread-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3), 0 0 8px rgba(139, 92, 246, 0.4);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Состояния загрузки и пустоты */
.notification-loading,
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.notification-loading i {
    font-size: 24px;
    margin-bottom: 12px;
    color: #8b5cf6;
    animation: spin 1s linear infinite;
}

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

.notification-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #64748b;
    opacity: 0.6;
}

.notification-empty p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
}

/* Типы уведомлений */
.notification-type-supply {
    border-left-color: #10b981;
}

.notification-type-supply .notification-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification-type-redistribution {
    border-left-color: #f59e0b;
}

.notification-type-redistribution .notification-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.notification-type-payment {
    border-left-color: #8b5cf6;
}

.notification-type-payment .notification-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.notification-type-system {
    border-left-color: #ef4444;
}

.notification-type-system .notification-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Анимации */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-item {
    animation: slideInDown 0.3s ease-out;
}

.notification-item.new-notification {
    animation: slideInFromTop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 3px solid #10b981 !important;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    box-shadow: 
        inset 0 0 20px rgba(16, 185, 129, 0.1),
        0 0 15px rgba(16, 185, 129, 0.1);
}

/* Адаптивность */
@media (max-width: 768px) {
    .notification-dropdown {
        width: calc(100vw - 32px);
        max-width: 380px;
        margin: 8px 16px;
    }
    
    .notification-content {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
}

/* Тост уведомления (для новых уведомлений) */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(145deg, #2a2a3a 0%, #1e1e2e 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    min-width: 300px;
    max-width: 400px;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification .notification-content {
    padding: 16px;
}

/* Улучшения доступности */
.notification-item:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: -2px;
    background: rgba(139, 92, 246, 0.08);
}

.notification-action:focus {
    outline: 1px solid #8b5cf6;
    outline-offset: 1px;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Состояние загрузки для бесконечного скролла */
.notification-loading-more {
    padding: 16px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.notification-loading-more i {
    color: #8b5cf6;
    font-size: 16px;
    animation: spin 1s linear infinite;
}
