/* Notification */
.notification {
    position: absolute;
    top: 70px;
    right: 20px;
    background-color: var(--color-notification-bg);
    width: 250px;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--color-shadow);
    padding: 15px;
    border-left: 4px solid var(--color-accent);
    z-index: 1000;
    display: none;

    [dir="rtl"] & {
        left: 20px;
        border-right: 4px solid var(--color-accent);
        right: unset;
        border-left: unset;
    }
}

.notification-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--color-text);
}

.notification-message {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Notification banner */
.notification-banner {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: var(--color-notification-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--color-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 400px;
    z-index: 2000;
    transform: translateY(-100px);
    opacity: 0;
    transition:
        transform 0.3s,
        opacity 0.3s;
}

.notification-banner.active {
    transform: translateY(0);
    opacity: 1;
}

.notification-banner.success {
    border-left: 4px solid var(--color-success-border);
}

.notification-banner.error {
    border-left: 4px solid var(--color-danger-bg);
}

.close-notification-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-text-placeholder);
    margin-left: 10px;
}

/* Notification Bell */
.notif-wrapper {
    position: relative;
}

.notif-bell-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text-subtle);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.notif-bell-btn:hover {
    background: var(--color-accent-bg-sm);
    color: var(--color-accent);
}

.notif-bell-btn.active {
    color: var(--color-accent);
    background: var(--color-accent-ring);
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    background: var(--color-notification-badge);
    color: var(--color-notification-bg);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    padding: 0 4px;
    pointer-events: none;
}

@keyframes bellRing {
    0%,
    100% {
        transform: rotate(0deg);
    }
    13% {
        transform: rotate(22deg);
    }
    26% {
        transform: rotate(-22deg);
    }
    39% {
        transform: rotate(14deg);
    }
    52% {
        transform: rotate(-14deg);
    }
    65% {
        transform: rotate(8deg);
    }
    78% {
        transform: rotate(-8deg);
    }
    91% {
        transform: rotate(3deg);
    }
}

.notif-bell-btn.ring {
    animation: bellRing 1s ease;
}

.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: -40px;
    width: 380px;
    max-height: 480px;
    background: var(--color-notification-bg);
    border-radius: 16px;
    box-shadow:
        0 12px 40px var(--color-shadow-md),
        0 0 0 1px var(--color-shadow-xs);
    z-index: 2000;
    overflow: hidden;
    animation: notifPanelIn 0.2s ease-out;
}

.notif-wrapper.open .notif-panel {
    display: flex;
    flex-direction: column;
}

@keyframes notifPanelIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-xfaint);
}

.notif-panel-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text-heading);
}

.notif-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-faint);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.notif-clear-btn:hover {
    color: var(--color-accent);
    background: var(--color-accent-bg-sm);
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-text-faint);
    gap: 8px;
}

.notif-empty i {
    font-size: 28px;
    opacity: 0.5;
}

.notif-empty span {
    font-size: 14px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--color-bg-subtle);
    transition: background 0.15s;
    cursor: default;
}

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

.notif-item:hover {
    background: var(--color-bg-hover);
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.notif-item-icon.upload {
    background: var(--color-accent-ring);
    color: var(--color-accent);
}

.notif-item-icon.success {
    background: var(--color-success-ring);
    color: var(--color-notification-success);
}

.notif-item-icon.error {
    background: var(--color-notification-error-ring);
    color: var(--color-notification-error);
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-heading);
    margin-bottom: 2px;
}

.notif-item-text {
    font-size: 12px;
    color: var(--color-text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 11px;
    color: var(--color-text-faint);
    margin-top: 3px;
}

.notif-upload-progress {
    margin-top: 6px;
}

.notif-upload-bar {
    height: 3px;
    background: var(--color-bg-empty);
    border-radius: 2px;
    overflow: hidden;
}

.notif-upload-fill {
    height: 100%;
    background: var(--color-accent);
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 2px;
}

.notif-upload-fill.done {
    background: var(--color-notification-success);
}

.notif-upload-fill.error {
    background: var(--color-notification-error);
}

.notif-upload-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}

.notif-upload-pct,
.notif-upload-stats {
    font-size: 11px;
    color: var(--color-text-faint);
}

/* Upload Progress Toast (legacy — hidden, kept for compat) */
.upload-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    max-height: 400px;
    background: var(--color-notification-bg);
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--color-shadow-md);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
    animation: uploadToastSlideIn 0.3s ease-out;
}

.upload-toast.visible {
    display: flex;
}

@keyframes uploadToastSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.upload-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-accent);
    color: var(--color-danger-text);
}

.upload-toast-title {
    font-weight: 600;
    font-size: 14px;
}

.upload-toast-close {
    background: none;
    border: none;
    color: var(--color-danger-text);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
}

.upload-toast-close:hover {
    opacity: 1;
}

.upload-toast-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 260px;
}

.upload-toast-file {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    gap: 10px;
}

.upload-toast-file-icon {
    font-size: 16px;
    color: var(--color-text-light);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.upload-toast-file-icon.done {
    color: var(--color-notification-success);
}

.upload-toast-file-icon.error {
    color: var(--color-notification-error);
}

.upload-toast-file-info {
    flex: 1;
    min-width: 0;
}

.upload-toast-file-name {
    font-size: 13px;
    color: var(--color-text-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-toast-file-bar {
    height: 3px;
    background: var(--color-bg-empty);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.upload-toast-file-fill {
    height: 100%;
    background: var(--color-accent);
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 2px;
}

.upload-toast-file-fill.done {
    background: var(--color-notification-success);
}

.upload-toast-file-fill.error {
    background: var(--color-notification-error);
}

.upload-toast-file-pct {
    font-size: 12px;
    color: var(--color-text-light);
    flex-shrink: 0;
    width: 38px;
    text-align: right;
}

.upload-toast-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--color-border-xfaint);
}

.upload-toast-overall-bar {
    height: 4px;
    background: var(--color-bg-empty);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-toast-overall-fill {
    height: 100%;
    background: var(--color-accent);
    width: 0%;
    transition: width 0.25s ease;
    border-radius: 2px;
}

.upload-toast-stats {
    font-size: 12px;
    color: var(--color-text-faint2);
}
