/* ============================================
   NOTIFICATION BELL - Колокольчик
   ============================================ */

.notification-bell-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 20px;
}

.notification-bell {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    display: none; /* Показываем только при наличии уведомлений */
    animation: pulse 2s infinite;
}

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

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

/* ============================================
   NOTIFICATION PANEL - Выдвижная панель
   ============================================ */

.notification-panel {
    position: fixed;
    top: 0;
    right: -400px; /* Скрыта за экраном */
    width: 380px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-panel.open {
    right: 0; /* Выезжает */
}

/* Header панели */
.notification-panel-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notification-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.notification-panel-close {
    font-size: 28px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.notification-panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Body панели */
.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.notification-panel-empty {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.notification-panel-empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.notification-panel-empty-text {
    font-size: 15px;
}

/* Footer панели */
.notification-panel-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    flex-shrink: 0;
}

.notification-panel-link {
    display: inline-block;
    color: #4a90e2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.notification-panel-link:hover {
    color: #357abd;
    text-decoration: underline;
}

/* ============================================
   NOTIFICATION ITEM - Элемент уведомления
   ============================================ */

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    gap: 12px;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e7f3ff;
}

/* Ознакомленное уведомление (зелёная галочка) */
.notification-item.acknowledged {
    position: relative;
}

.notification-item.acknowledged::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: #4caf50;
    font-weight: bold;
}

.notification-item.priority {
    border-left: 4px solid #ff4444;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.notification-icon.new-document {
    background: #d4edda;
}

.notification-icon.updated-document {
    background: #fff3cd;
}

.notification-icon.manual-message {
    background: #cce5ff;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.notification-message {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: #999;
}

/* ============================================
   OVERLAY - Затемнение фона
   ============================================ */

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-overlay.show {
    display: block;
    opacity: 1;
}

/* ============================================
   RESPONSIVE - Мобильная версия
   ============================================ */

@media (max-width: 768px) {
    .notification-panel {
        width: 100%;
        right: -100%;
    }
    
    .notification-bell-container {
        margin-left: 10px;
    }
    
    .notification-bell {
        font-size: 22px;
        padding: 6px;
    }
}

/* ============================================
   NOTIFICATION MODAL - Модальное окно
   ============================================ */

/* Overlay для модального окна */
.notification-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000; /* Выше панели */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-modal-overlay.show {
    display: block;
    opacity: 1;
}

/* Модальное окно */
.notification-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-modal.show {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Header модального окна */
.notification-modal-header {
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notification-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    line-height: 1.4;
}

.notification-modal-close {
    font-size: 32px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

.notification-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Body модального окна */
.notification-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.notification-modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.notification-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.notification-modal-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.notification-modal-meta-label {
    font-weight: 600;
    color: #666;
    min-width: 100px;
}

.notification-modal-meta-value {
    color: #333;
    flex: 1;
}

.notification-modal-meta-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.notification-modal-meta-badge.priority {
    background: #ffe6e6;
    color: #d32f2f;
}

.notification-modal-meta-badge.normal {
    background: #e3f2fd;
    color: #1976d2;
}

.notification-modal-meta-badge.acknowledged {
    background: #e8f5e9;
    color: #388e3c;
}

/* Footer модального окна */
.notification-modal-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.notification-modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.notification-modal-btn-secondary {
    background: #ffffff;
    color: #666;
    border: 1px solid #ddd;
}

.notification-modal-btn-secondary:hover {
    background: #f5f5f5;
}

.notification-modal-btn-primary {
    background: #4caf50;
    color: white;
}

.notification-modal-btn-primary:hover {
    background: #45a049;
}

.notification-modal-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
    }
    
    .notification-modal-header {
        padding: 16px 20px;
    }
    
    .notification-modal-body {
        padding: 20px;
    }
    
    .notification-modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }
    
    .notification-modal-btn {
        width: 100%;
    }
}

/* ============================================
   NOTIFICATION TOAST - Всплывающие уведомления
   ============================================ */

.notification-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002; /* Выше модального окна */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification-toast {
    background: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid #ccc;
}

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

.notification-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-toast-message {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* Success toast (зелёный) */
.notification-toast-success {
    border-left-color: #4caf50;
}

.notification-toast-success .notification-toast-icon {
    color: #4caf50;
}

/* Error toast (красный) */
.notification-toast-error {
    border-left-color: #f44336;
}

.notification-toast-error .notification-toast-icon {
    color: #f44336;
}

/* Info toast (синий) */
.notification-toast-info {
    border-left-color: #2196f3;
}

.notification-toast-info .notification-toast-icon {
    color: #2196f3;
}

/* Стиль для disabled кнопки */
.notification-modal-btn-disabled {
    background: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

.notification-modal-btn-disabled:hover {
    background: #e0e0e0 !important;
}

/* Responsive toast */
@media (max-width: 768px) {
    .notification-toast-container {
        left: 20px;
        right: 20px;
        top: 10px;
    }
    
    .notification-toast {
        min-width: auto;
        max-width: none;
    }
}
