/* ========== USER NOTIFICATIONS ========== */

/* Wrapper для кнопки и dropdown */
.notifications-wrapper {
    position: relative;
    margin-right: 8px;
}

/* Кнопка с колокольчиком */
.notifications-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}

.notifications-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.notifications-btn svg {
    width: 22px;
    height: 22px;
}

/* Бейдж с количеством */
.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

/* Dropdown */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notifications-dropdown.show {
    display: flex;
}

/* Заголовок dropdown */
.notifications-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* Список уведомлений */
.notifications-list {
    overflow-y: auto;
    max-height: 400px;
}

/* Одно уведомление */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

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

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

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

.notification-item.unread:hover {
    background: #dbeafe;
}

/* Иконка уведомления */
.notification-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
}

.notification-item.type-update .notification-icon {
    background: #dbeafe;
    color: #2563eb;
}

.notification-item.type-task .notification-icon {
    background: #dcfce7;
    color: #16a34a;
}

.notification-item.type-patient .notification-icon {
    background: #fef3c7;
    color: #d97706;
}

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

.notification-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-message {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.4;
}

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

/* Пустой список / загрузка */
.notifications-empty,
.notifications-loading {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.notifications-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Маленький спиннер */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Кликабельные уведомления */
.notification-item.clickable {
    cursor: pointer;
}

.notification-item.clickable:hover .notification-title {
    color: #2563eb;
}

/* Индикатор раскрытия */
.notification-expand {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.notification-item:hover .notification-expand {
    color: #3b82f6;
    transform: translateX(2px);
}

/* ========== МОДАЛКА УВЕДОМЛЕНИЯ ========== */

.notification-detail-modal {
    max-width: 700px;
    width: 90%;
}

.notification-full-content {
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
}

.notification-full-content h1,
.notification-full-content h2,
.notification-full-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #1e293b;
}

.notification-full-content h1 { font-size: 1.5em; }
.notification-full-content h2 { font-size: 1.3em; }
.notification-full-content h3 { font-size: 1.1em; }

.notification-full-content p {
    margin: 1em 0;
}

.notification-full-content ul,
.notification-full-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.notification-full-content li {
    margin: 0.5em 0;
}

.notification-full-content a {
    color: #2563eb;
    text-decoration: underline;
}

.notification-full-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

.notification-full-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.notification-full-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.notification-full-content blockquote {
    border-left: 4px solid #3b82f6;
    margin: 1em 0;
    padding-left: 16px;
    color: #64748b;
    font-style: italic;
}

/* Мета-информация в футере модалки */
.notification-modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.notification-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.notification-type-badge.platform_update {
    background: #dbeafe;
    color: #1d4ed8;
}

.notification-type-badge.task_assigned {
    background: #dcfce7;
    color: #15803d;
}

.notification-type-badge.lost_patient {
    background: #fef3c7;
    color: #b45309;
}

.notification-date {
    font-size: 13px;
    color: #64748b;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
    .notifications-dropdown {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 80px);
    }
    
    .notification-detail-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .notification-modal-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

