.notification-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--card-shadow, rgba(0, 0, 0, 0.15));
    padding: 14px 16px;
    margin-bottom: 12px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
    min-width: 280px;
}

.toast-notification.success { border-left-color: #28a745; }
.toast-notification.error { border-left-color: #dc3545; }
.toast-notification.warning { border-left-color: #ffc107; }
.toast-notification.info { border-left-color: #17a2b8; }

.toast-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1.2;
    margin-top: 1px;
}

.toast-notification.success .toast-icon { color: #28a745; }
.toast-notification.error .toast-icon { color: #dc3545; }
.toast-notification.warning .toast-icon { color: #ffc107; }
.toast-notification.info .toast-icon { color: #17a2b8; }

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

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-dark, #333);
}

.toast-message {
    font-size: 13px;
    color: var(--text-color, #444);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--middlelightgrey, #999);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.toast-close:hover {
    background-color: var(--lightgrey, #f8f9fa);
    color: var(--text-color, #666);
}

[data-theme="dark"] .toast-notification {
    background: var(--white, #1a1d23);
    box-shadow: 0 4px 16px var(--dropdown-shadow, rgba(0, 0, 0, 0.5));
}

[data-theme="dark"] .toast-title {
    color: var(--text-dark, #f0f3f6);
}

[data-theme="dark"] .toast-message {
    color: var(--text-color, #d1d5db);
}

[data-theme="dark"] .toast-notification.success { border-left-color: #3fb950; }
[data-theme="dark"] .toast-notification.error { border-left-color: #f85149; }
[data-theme="dark"] .toast-notification.warning { border-left-color: #d29922; }
[data-theme="dark"] .toast-notification.info { border-left-color: #58a6ff; }

[data-theme="dark"] .toast-notification.success .toast-icon { color: #3fb950; }
[data-theme="dark"] .toast-notification.error .toast-icon { color: #f85149; }
[data-theme="dark"] .toast-notification.warning .toast-icon { color: #d29922; }
[data-theme="dark"] .toast-notification.info .toast-icon { color: #58a6ff; }

.notification {
    background: var(--white, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--card-shadow, rgba(0, 0, 0, 0.15));
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
}

.notification-success { border-left-color: #28a745; }
.notification-error { border-left-color: #dc3545; }
.notification-warning { border-left-color: #ffc107; }
.notification-info { border-left-color: #17a2b8; }

.notification-removing {
    animation: slideOut 0.3s ease-in forwards;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 2px;
}

.notification-success .notification-icon { color: #28a745; }
.notification-error .notification-icon { color: #dc3545; }
.notification-warning .notification-icon { color: #ffc107; }
.notification-info .notification-icon { color: #17a2b8; }

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

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-dark, #333);
}

.notification-message {
    font-size: 13px;
    color: var(--middlelightgrey, #666);
    line-height: 1.4;
    white-space: pre-line;
}

.notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--middlelightgrey, #999);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.notification-close:hover {
    background-color: var(--lightgrey, #f8f9fa);
    color: var(--text-color, #666);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    opacity: 0.3;
    animation: progress linear forwards;
    transform-origin: left;
}

.notification-success .notification-progress { background-color: #28a745; }
.notification-error .notification-progress { background-color: #dc3545; }
.notification-warning .notification-progress { background-color: #ffc107; }
.notification-info .notification-progress { background-color: #17a2b8; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Dark mode */
[data-theme="dark"] .notification {
    background: var(--white, #1a1d23);
    box-shadow: 0 4px 16px var(--dropdown-shadow, rgba(0, 0, 0, 0.5));
    border: none;
    border-left: 4px solid;
}

[data-theme="dark"] .notification-title {
    color: var(--text-dark, #f0f3f6);
}

[data-theme="dark"] .notification-message {
    color: var(--middlelightgrey, #8b949e);
}

[data-theme="dark"] .notification-close {
    color: var(--preview-icon, #6e7681);
}

[data-theme="dark"] .notification-close:hover {
    background-color: var(--lightgrey, #22262d);
    color: var(--text-color, #d1d5db);
}

[data-theme="dark"] .notification-success { border-left-color: #3fb950; }
[data-theme="dark"] .notification-error { border-left-color: #f85149; }
[data-theme="dark"] .notification-warning { border-left-color: #d29922; }
[data-theme="dark"] .notification-info { border-left-color: #58a6ff; }

[data-theme="dark"] .notification-success .notification-icon { color: #3fb950; }
[data-theme="dark"] .notification-error .notification-icon { color: #f85149; }
[data-theme="dark"] .notification-warning .notification-icon { color: #d29922; }
[data-theme="dark"] .notification-info .notification-icon { color: #58a6ff; }

[data-theme="dark"] .notification-success .notification-progress { background-color: #3fb950; }
[data-theme="dark"] .notification-error .notification-progress { background-color: #f85149; }
[data-theme="dark"] .notification-warning .notification-progress { background-color: #d29922; }
[data-theme="dark"] .notification-info .notification-progress { background-color: #58a6ff; }
