/**
 * Frontend Toast Notification Styles
 * Aesthetic, modern toast notifications that match the pambify-central UI/UX
 */

:root {
    --frontend-toast-success: #2e8b57;
    --frontend-toast-error: #ff0000;
    --frontend-toast-info: #367AFF;
    --frontend-toast-duration: 5s;
    --frontend-toast-transition: 0.4s;
}

/* Toast Container */
.frontend-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Toast Base Styles */
.frontend-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: all var(--frontend-toast-transition) cubic-bezier(0.68, -0.55, 0.265, 1.35);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

/* Active State */
.frontend-toast.frontend-toast-active {
    transform: translateX(0);
    opacity: 1;
}

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

.frontend-toast-icon svg {
    width: 18px;
    height: 18px;
}

/* Icon Colors by Type */
.frontend-toast-icon-success {
    background-color: rgba(46, 139, 87, 0.1);
    color: var(--frontend-toast-success);
}

.frontend-toast-icon-error {
    background-color: rgba(255, 0, 0, 0.1);
    color: var(--frontend-toast-error);
}

.frontend-toast-icon-info {
    background-color: rgba(54, 122, 255, 0.1);
    color: var(--frontend-toast-info);
}

/* Toast Message */
.frontend-toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Close Button */
.frontend-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.frontend-toast-close:hover {
    color: #333333;
}

/* Progress Bar */
.frontend-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.frontend-toast-progress::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
}

/* Progress Bar Colors by Type */
.frontend-toast-progress-success::before {
    background-color: var(--frontend-toast-success);
}

.frontend-toast-progress-error::before {
    background-color: var(--frontend-toast-error);
}

.frontend-toast-progress-info::before {
    background-color: var(--frontend-toast-info);
}

/* Progress Bar Animation */
.frontend-toast-progress-active::before {
    animation: frontend-toast-progress var(--frontend-toast-duration) linear forwards;
}

@keyframes frontend-toast-progress {
    from {
        right: 0;
    }
    to {
        right: 100%;
    }
}

/* Border Accent (Optional - subtle left border) */
.frontend-toast-success {
    border-left: 4px solid var(--frontend-toast-success);
}

.frontend-toast-error {
    border-left: 4px solid var(--frontend-toast-error);
}

.frontend-toast-info {
    border-left: 4px solid var(--frontend-toast-info);
}

/* Responsive Design */
@media (max-width: 768px) {
    .frontend-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .frontend-toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .frontend-toast {
        background: #2a2a2a;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    
    .frontend-toast-message {
        color: #e0e0e0;
    }
    
    .frontend-toast-close {
        color: #888888;
    }
    
    .frontend-toast-close:hover {
        color: #e0e0e0;
    }
}

/* Accessibility */
.frontend-toast:focus-within {
    outline: 2px solid var(--frontend-toast-info);
    outline-offset: 2px;
}

/* Multiple Toast Stacking */
.frontend-toast-container > .frontend-toast:not(:last-child) {
    margin-bottom: 0;
}
