/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 320px;
    max-width: 420px;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(0);
}
.toast-notification.toast-dismissing {
    opacity: 0;
    transform: translateX(400px);
}
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
}
.toast-icon svg {
    width: 100%;
    height: 100%;
}
.toast-info .toast-icon {
    color: var(--primary-color);
}
.toast-warning .toast-icon {
    color: #f59e0b;
}
.toast-error .toast-icon {
    color: var(--red);
}
.toast-text {
    flex: 1;
    min-width: 0;
}
.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.toast-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-close:hover {
    opacity: 1;
}
body.dark-mode .toast-notification {
    background: var(--dm-surface-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
body.dark-mode .toast-title {
    color: var(--dm-text-primary);
}
body.dark-mode .toast-body {
    color: var(--dm-text-secondary);
}
@supports (padding-top: env(safe-area-inset-top)) {
    .toast-notification {
        top: calc(20px + env(safe-area-inset-top));
        right: calc(20px + env(safe-area-inset-right));
    }
}

/* Badge Animations */
.badge-pop {
    animation: badgePop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.badge-update {
    animation: badgeUpdate 0.3s ease-out;
}
.badge-hide {
    animation: badgeHide 0.2s ease-out;
}
@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
@keyframes badgeUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes badgeHide {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

/* Notification Inbox Styles */
.notification-inbox-list .notification-item {
    position: relative;
    transition: all 0.2s ease;
}
.notification-item.unread {
    background-color: var(--background-light);
}
.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}
.notification-item.notification-clicked {
    background-color: var(--primary-light);
    transform: scale(0.98);
}
body.dark-mode .notification-item.unread {
    background-color: var(--dm-background-light);
}
body.dark-mode .notification-item.unread::before {
    background: var(--dm-primary-color);
}
body.dark-mode .notification-item.notification-clicked {
    background-color: rgba(99, 102, 241, 0.2);
}

/* Mark All Read Button */
.btn-mark-all-read {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-mark-all-read:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-mark-all-read:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
body.dark-mode .btn-mark-all-read {
    background: var(--dm-primary-color);
}
body.dark-mode .btn-mark-all-read:hover:not(:disabled) {
    background: var(--dm-primary-hover);
}

/* Notification Loading State */
.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}
.notification-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.notification-loading p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Notification Empty State */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 16px;
}
.notification-empty svg {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    opacity: 0.5;
}
.notification-empty p {
    color: var(--text-secondary);
    font-size: 14px;
}
.notification-empty strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

/* Notification Error State */
.notification-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 16px;
}
.notification-error svg {
    width: 48px;
    height: 48px;
    color: var(--red);
}
.notification-error p {
    color: var(--text-secondary);
    font-size: 14px;
}
.notification-error strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}
.btn-retry {
    margin-top: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-retry:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Spinning Animation */
.spinning {
    animation: spin 1s linear infinite;
}
body.dark-mode .notification-loading-spinner {
    border-color: var(--dm-border-color);
    border-top-color: var(--dm-primary-color);
}
body.dark-mode .notification-empty svg,
body.dark-mode .notification-error svg {
    color: var(--dm-text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    .toast-notification.toast-show {
        transform: translateY(0);
    }
    .toast-notification,
    .toast-notification.toast-dismissing {
        transform: translateY(-100px);
    }
}

