/**
 * Standardized Toast Notification System CSS
 * Used across all utilities for consistent styling
 */

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: 24px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Toast Base */
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--color-border);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    min-height: 64px;
    width: 100%;
    border: 2px solid transparent;
}

/* Toast Animations */
.toast--show {
    opacity: 1;
    transform: translateY(0);
}

.toast--hiding {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Toast Content */
.toast__content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 20px 24px;
    gap: 20px;
}

/* Toast Icon */
.toast__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    border-radius: 50%;
}

.toast__icon svg,
.toast__icon .toast-icon {
    width: 24px;
    height: 24px;
    fill: white;
    filter: brightness(0) invert(1);
}

/* Toast Message */
.toast__message {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-primary);
    word-wrap: break-word;
    font-weight: 500;
}

/* Toast Actions */
.toast__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toast__action {
    background: var(--color-brand-primary);
    border: none;
    color: var(--color-on-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toast__action:hover {
    transform: translateY(-1px);
}

.toast__action:active {
    transform: translateY(0);
}

/* Toast Close Button */
.toast__close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0;
    flex-shrink: 0;
    font-weight: 300;
}

.toast__close:hover {
    color: white;
    transform: scale(1.1);
}

.toast__close:active {
    transform: scale(0.95);
}

/* Toast Type Variants */
.toast--success {
    border: 1px solid var(--color-status-success);
    border-left: 6px solid var(--color-status-success);
    box-shadow: 0 4px 12px rgba(47, 157, 87, 0.15), var(--shadow-md);
}

.toast--success .toast__icon {
    background-color: var(--color-status-success);
}

.toast--error {
    border: 1px solid var(--color-status-error);
    border-left: 6px solid var(--color-status-error);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15), var(--shadow-md);
}

.toast--error .toast__icon {
    background-color: var(--color-status-error);
}

.toast--warning {
    border: 1px solid var(--color-status-warning);
    border-left: 6px solid var(--color-status-warning);
    box-shadow: 0 4px 12px rgba(240, 190, 40, 0.15), var(--shadow-md);
}

.toast--warning .toast__icon {
    background-color: var(--color-status-warning);
}

.toast--info {
    border: 1px solid var(--color-status-info);
    border-left: 6px solid var(--color-status-info);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), var(--shadow-md);
}

.toast--info .toast__icon {
    background-color: var(--color-status-info);
}

.toast--loading {
    border: 1px solid var(--color-text-secondary);
    border-left: 6px solid var(--color-text-secondary);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.15), var(--shadow-md);
}

.toast--loading .toast__icon {
    background-color: var(--color-text-secondary);
}

/* Loading Animation */
.toast--loading .toast__icon svg,
.toast--loading .toast__icon .toast-icon,
.notification-history-item--loading .notification-history-icon svg,
.notification-history-item--loading .notification-history-icon .toast-icon {
    animation: toast-spin 1s linear infinite;
}

@keyframes toast-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Notification History Styles */
.notification-history-content {
    display: flex;
    align-items: center;
    padding: 20px 32px;
    gap: 16px;
    transition: background-color 0.2s ease;
}

.notification-history-item--new .notification-history-content {
    padding-right: 40px;
}

.notification-history-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    border-radius: 50%;
}

.notification-history-icon svg,
.notification-history-icon .toast-icon {
    width: 20px;
    height: 20px;
    fill: white;
    filter: brightness(0) invert(1);
}

/* Notification History Type Variants */
.notification-history-item--success .notification-history-icon {
    background-color: var(--color-status-success);
}

.notification-history-item--error .notification-history-icon {
    background-color: var(--color-status-error);
}

.notification-history-item--warning .notification-history-icon {
    background-color: var(--color-status-warning);
}

.notification-history-item--info .notification-history-icon {
    background-color: var(--color-status-info);
}

.notification-history-item--loading .notification-history-icon {
    background-color: var(--color-text-secondary);
}

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

.notification-history-text {
    font-size: 15px;
    line-height: 1.4;
    color: var(--color-text-primary);
    margin-bottom: 4px;
    word-wrap: break-word;
    font-weight: 500;
}

.notification-history-time {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.notification-history-item {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s ease;
}

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

.notification-history-item:hover {
    background-color: var(--color-surface-hover);
}

.notification-history-item--new {
    background-color: var(--color-surface-highlight);
    position: relative;
}

.notification-history-item--new::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    background-color: var(--color-brand-primary);
    border-radius: 50%;
    transform: translateY(-50%);
}

.notification-history-remove {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.notification-history-remove:hover {
    opacity: 1;
    background-color: var(--color-surface-hover);
}

.notification-history-empty {
    text-align: center;
    padding: 48px 32px;
    color: var(--color-text-secondary);
}

.notification-history-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.notification-history-empty h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.notification-history-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.notification-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-surface);
}

.notification-history-clear {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.notification-history-clear:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
}

.notification-history-list {
    overflow-y: auto;
}
