/* Global Snackbar/Toast Notification System - Material Design */

#snackbar-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Desktop: Bottom Right */
@media (min-width: 768px) {
    #snackbar-container {
        bottom: 24px;
        right: 24px;
        max-width: 500px;
        align-items: flex-end;
    }
}

/* Mobile: Bottom Center with padding */
@media (max-width: 767.98px) {
    #snackbar-container {
        bottom: 24px;
        left: 12px;
        right: 12px;
        max-width: none;
        align-items: stretch;
    }
}

/* Base Snackbar Styles */
.snackbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 4px;
    box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2),
                0 6px 10px 0 rgba(0, 0, 0, 0.14),
                0 1px 18px 0 rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: auto;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.25px;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(100px);
    will-change: transform, opacity;
    min-height: 48px;
    max-height: 100px;
    word-break: break-word;
}

.snackbar.show {
    opacity: 1;
    transform: translateY(0);
}

/* Color Variants */
.snackbar.snackbar-success {
    background-color: #323232;
    color: #4caf50;
}

.snackbar.snackbar-success .snackbar-content i {
    color: #4caf50;
}

.snackbar.snackbar-error {
    background-color: #323232;
    color: #f44336;
}

.snackbar.snackbar-error .snackbar-content i {
    color: #f44336;
}

.snackbar.snackbar-warning {
    background-color: #323232;
    color: #ff9800;
}

.snackbar.snackbar-warning .snackbar-content i {
    color: #ff9800;
}

.snackbar.snackbar-info {
    background-color: #323232;
    color: #2196f3;
}

.snackbar.snackbar-info .snackbar-content i {
    color: #2196f3;
}

/* Content Area */
.snackbar-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.snackbar-content i {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: -2px;
}

.snackbar-message {
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    white-space: normal;
    line-height: 1.5;
}

/* Close Button */
.snackbar-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    font-size: 0;
    margin: -4px -8px;
}

.snackbar-close i {
    font-size: 20px;
}

.snackbar-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.snackbar-close:focus {
    outline: 2px solid currentColor;
    outline-offset: -2px;
    opacity: 1;
}

.snackbar-close:active {
    opacity: 0.6;
}

/* Mobile Adjustments */
@media (max-width: 767.98px) {
    .snackbar {
        padding: 14px 16px;
        min-height: 56px;
    }

    .snackbar-content i {
        font-size: 24px;
        margin-top: 0;
    }

    .snackbar-message {
        font-size: 13px;
    }
}

/* Animation for slide-up from bottom */
@keyframes slideInSnackbar {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .snackbar {
        transition: opacity 0.1s linear;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .snackbar {
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
    }

    .snackbar-close:focus {
        outline-width: 3px;
    }
}
