/**
 * 会员通知系统样式
 */

/* 通知铃铛 */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background-color: var(--folio-hover-bg);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 通知弹窗 */
#folio-notification-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.notification-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.notification-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--folio-card-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    color: var(--folio-text);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.notification-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--folio-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--folio-bg-secondary);
}

.notification-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--folio-text);
}

.mark-all-read-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.mark-all-read-btn:hover {
    background: #005a87;
}

.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--folio-text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: var(--folio-hover-bg);
    color: var(--folio-text);
}

.notification-content {
    padding: 0;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.notification-item {
    padding: 16px 24px;
    border-bottom: 1px solid var(--folio-border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--folio-hover-bg);
}

.notification-item.unread {
    background: linear-gradient(90deg, #dbeafe 0%, #f9fafb 100%);
    border-left: 4px solid #3b82f6;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--folio-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.notification-message {
    color: var(--folio-text-light);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.notification-time {
    font-size: 11px;
    color: var(--folio-text-muted);
    font-weight: 500;
}

/* 通知类型样式 */
.notification-membership_expiry .notification-title {
    color: #dc2626;
}

.notification-membership_expiry.unread {
    background: linear-gradient(90deg, #fef2f2 0%, #f9fafb 100%);
    border-left-color: #dc2626;
}

.notification-membership_expiry.unread::before {
    background: #dc2626;
}

.notification-membership_expired .notification-title {
    color: #b91c1c;
}

.notification-membership_expired.unread {
    background: linear-gradient(90deg, #fef2f2 0%, #f9fafb 100%);
    border-left-color: #b91c1c;
}

.notification-membership_expired.unread::before {
    background: #b91c1c;
}

.notification-membership_changed .notification-title {
    color: #059669;
}

.notification-membership_changed.unread {
    background: linear-gradient(90deg, #ecfdf5 0%, #f9fafb 100%);
    border-left-color: #059669;
}

.notification-membership_changed.unread::before {
    background: #059669;
}

.notification-membership_activated .notification-title {
    color: #0891b2;
}

.notification-membership_activated.unread {
    background: linear-gradient(90deg, #ecfeff 0%, #f9fafb 100%);
    border-left-color: #0891b2;
}

.notification-membership_activated.unread::before {
    background: #0891b2;
}

.notification-user_register .notification-title {
    color: #7c3aed;
}

.notification-user_register.unread {
    background: linear-gradient(90deg, #f3e8ff 0%, #f9fafb 100%);
    border-left-color: #7c3aed;
}

.notification-user_register.unread::before {
    background: #7c3aed;
}

.notification-security_alert .notification-title {
    color: #dc2626;
}

.notification-security_alert.unread {
    background: linear-gradient(90deg, #fef2f2 0%, #f9fafb 100%);
    border-left-color: #dc2626;
}

.notification-security_alert.unread::before {
    background: #dc2626;
    animation: pulse 2s infinite;
}

.notification-security_warning .notification-title {
    color: #ea580c;
}

.notification-security_warning.unread {
    background: linear-gradient(90deg, #fff7ed 0%, #f9fafb 100%);
    border-left-color: #ea580c;
}

.notification-security_warning.unread::before {
    background: #ea580c;
    animation: pulse 2s infinite;
}

/* 空状态 */
.no-notifications {
    padding: 40px 24px;
    text-align: center;
    color: var(--folio-text-light);
    font-size: 14px;
}

.no-notifications::before {
    content: '🔔';
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .notification-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .notification-header {
        padding: 16px 20px;
    }
    
    .notification-header h3 {
        font-size: 16px;
    }
    
    .notification-item {
        padding: 14px 20px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
}

/* 暗色模式支持 */
[data-theme="dark"] .notification-modal {
    background: var(--folio-card-bg);
    color: var(--folio-text);
}

[data-theme="dark"] .notification-header {
    background: var(--folio-bg-secondary);
    border-bottom-color: var(--folio-border);
}

[data-theme="dark"] .notification-header h3 {
    color: var(--folio-text);
}

[data-theme="dark"] .notification-close {
    color: var(--folio-text-light);
}

[data-theme="dark"] .notification-close:hover {
    background: var(--folio-hover-bg);
    color: var(--folio-text);
}

[data-theme="dark"] .notification-item {
    border-bottom-color: var(--folio-border);
}

[data-theme="dark"] .notification-item:hover {
    background: var(--folio-hover-bg);
}

[data-theme="dark"] .notification-item.unread {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, var(--folio-card-bg) 100%);
    border-left-color: #3b82f6;
}

[data-theme="dark"] .notification-title {
    color: var(--folio-text);
}

[data-theme="dark"] .notification-message {
    color: var(--folio-text-light);
}

[data-theme="dark"] .notification-time {
    color: var(--folio-text-muted);
}

[data-theme="dark"] .no-notifications {
    color: var(--folio-text-light);
}

/* 暗色模式下的通知类型样式 */
[data-theme="dark"] .notification-membership_expiry.unread {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2) 0%, var(--folio-card-bg) 100%);
}

[data-theme="dark"] .notification-membership_expired.unread {
    background: linear-gradient(90deg, rgba(185, 28, 28, 0.2) 0%, var(--folio-card-bg) 100%);
}

[data-theme="dark"] .notification-membership_changed.unread {
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.2) 0%, var(--folio-card-bg) 100%);
}

[data-theme="dark"] .notification-membership_activated.unread {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.2) 0%, var(--folio-card-bg) 100%);
}

[data-theme="dark"] .notification-user_register.unread {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.2) 0%, var(--folio-card-bg) 100%);
}

[data-theme="dark"] .notification-security_alert.unread {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2) 0%, var(--folio-card-bg) 100%);
}

[data-theme="dark"] .notification-security_warning.unread {
    background: linear-gradient(90deg, rgba(234, 88, 12, 0.2) 0%, var(--folio-card-bg) 100%);
}