/* ============================================================
   EZsalt Toast Notification System
   Material Design Snackbar-style notifications

   Requirements:
   - Material Icons font
   - #ezs-toast-container element in DOM
   - ezs-toast.js for functionality

   Usage:
   <link rel="stylesheet" href="css/ezs-toast.css">
   <script src="js/ezs-toast.js"></script>
   <div id="ezs-toast-container"></div>
   ============================================================ */

/* CSS Variables for toast colors (can be overridden) */
:root {
    --ezs-success: #4CAF50;
    --ezs-warning: #FF9800;
    --ezs-error: #F44336;
    --ezs-info: #1998d5;
    --ezs-space-1: 8px;
    --ezs-space-2: 12px;
    --ezs-space-3: 16px;
    --ezs-radius-sm: 4px;
}

/* Toast Container */
#ezs-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--ezs-space-1);
    pointer-events: none;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toast Base Styles */
.ezs-toast {
    display: flex;
    align-items: center;
    gap: var(--ezs-space-2);
    padding: var(--ezs-space-2) var(--ezs-space-3);
    border-radius: var(--ezs-radius-sm);
    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);
    min-width: 288px;
    max-width: 568px;
    font-size: 14px;
    font-weight: 400;
    color: white;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Show Animation */
.ezs-toast.ezs-toast-show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide Animation */
.ezs-toast.ezs-toast-hide {
    opacity: 0;
    transform: translateY(20px);
}

/* Toast Message Text */
.ezs-toast-message {
    flex: 1;
    line-height: 1.5;
}

/* Toast Icons */
.ezs-toast .material-icons {
    font-size: 20px;
    color: inherit;
}

/* Toast Action Button */
.ezs-toast-action {
    margin-left: var(--ezs-space-2);
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--ezs-radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 200ms ease;
    white-space: nowrap;
}

.ezs-toast-action:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.ezs-toast-action:active {
    transform: scale(0.96);
}

/* Toast Dismiss Button */
.ezs-toast-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--ezs-space-1);
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 200ms ease;
}

.ezs-toast-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.ezs-toast-dismiss .material-icons {
    font-size: 18px;
}

/* Success Toast (Green) */
.ezs-toast-success {
    background: var(--ezs-success);
}

/* Info Toast (Blue) */
.ezs-toast-info {
    background: var(--ezs-info);
}

/* Warning Toast (Orange) */
.ezs-toast-warning {
    background: var(--ezs-warning);
}

/* Error Toast (Red) */
.ezs-toast-error {
    background: var(--ezs-error);
}

/* Mobile Responsive Toast */
@media (max-width: 640px) {
    #ezs-toast-container {
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: none;
    }

    .ezs-toast {
        min-width: auto;
        width: 100%;
    }
}
