/**
 * SABC Toast Notification Styles
 * Modern, lightweight toast notification styling
 */

/* Container positioning */
.sabc-toast-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    max-width: 420px;
    width: 100%;
}

/* Position variants */
.sabc-toast-container[data-position="top-right"] {
    top: 0;
    right: 0;
}

.sabc-toast-container[data-position="top-left"] {
    top: 0;
    left: 0;
}

.sabc-toast-container[data-position="bottom-right"] {
    bottom: 0;
    right: 0;
    flex-direction: column-reverse;
}

.sabc-toast-container[data-position="bottom-left"] {
    bottom: 0;
    left: 0;
    flex-direction: column-reverse;
}

.sabc-toast-container[data-position="top-center"] {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.sabc-toast-container[data-position="bottom-center"] {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
}

/* Toast base styles */
.sabc-toast {
    position: relative;
    pointer-events: auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Left side toasts slide from left */
.sabc-toast-container[data-position="top-left"] .sabc-toast,
.sabc-toast-container[data-position="bottom-left"] .sabc-toast {
    transform: translateX(-100%);
}

/* Center toasts slide from top/bottom */
.sabc-toast-container[data-position="top-center"] .sabc-toast {
    transform: translateY(-100%);
}

.sabc-toast-container[data-position="bottom-center"] .sabc-toast {
    transform: translateY(100%);
}

/* Show animation */
.sabc-toast.sabc-toast-show {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* Hide animation */
.sabc-toast.sabc-toast-hide {
    opacity: 0;
    transform: scale(0.8);
    max-height: 0;
    margin: 0;
    padding: 0;
}

/* Toast content */
.sabc-toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
    flex: 1;
}

/* Toast icon */
.sabc-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.sabc-toast-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Toast message */
.sabc-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    font-family: "NunitoSans", sans-serif;
    word-wrap: break-word;
}

/* Close button */
.sabc-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
}

.sabc-toast-close svg {
    width: 20px;
    height: 20px;
    display: block;
}

.sabc-toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666666;
}

.sabc-toast-close:active {
    transform: scale(0.95);
}

/* Progress bar */
.sabc-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
}

/* Toast type variants */

/* Success */
.sabc-toast-success {
    border-left: 4px solid #28a745;
}

.sabc-toast-success .sabc-toast-icon {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.sabc-toast-success .sabc-toast-progress {
    color: #28a745;
}

/* Error */
.sabc-toast-error {
    border-left: 4px solid #dc3545;
}

.sabc-toast-error .sabc-toast-icon {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.sabc-toast-error .sabc-toast-progress {
    color: #dc3545;
}

/* Warning */
.sabc-toast-warning {
    border-left: 4px solid #ffc107;
}

.sabc-toast-warning .sabc-toast-icon {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.sabc-toast-warning .sabc-toast-progress {
    color: #ffc107;
}

/* Info */
.sabc-toast-info {
    border-left: 4px solid #17a2b8;
}

.sabc-toast-info .sabc-toast-icon {
    color: #17a2b8;
    background: rgba(23, 162, 184, 0.1);
}

.sabc-toast-info .sabc-toast-progress {
    color: #17a2b8;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .sabc-toast-container {
        padding: 12px;
        max-width: 100%;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }

    .sabc-toast {
        border-radius: 6px;
    }

    .sabc-toast-content {
        padding: 12px;
    }

    .sabc-toast-message {
        font-size: 13px;
        font-family: "NunitoSans", sans-serif;
    }

    .sabc-toast-icon {
        width: 28px;
        height: 28px;
    }

    .sabc-toast-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .sabc-toast {
        background: #2d2d2d;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .sabc-toast-message {
        color: #e0e0e0;
    }

    .sabc-toast-close {
        color: #b0b0b0;
    }

    .sabc-toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .sabc-toast,
    .sabc-toast-progress,
    .sabc-toast-close {
        transition: none;
    }
}