﻿/* Toast Container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: center;
    width:100%;
    max-width: 340px;
    padding: 15px 40px 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    color: #333;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.5s forwards, fadeOut 0.5s 3.5s forwards;
    position: relative;
    border-left: 6px solid transparent;
    overflow: hidden;
    /* ensures pseudo-element stays inside */
}

/* Progress Bar Using ::before */
.toast::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.15);
    animation: progressBar 4s linear forwards;
    /* adjust duration as needed */
}

/* Toast Icon */
.toast-icon {
    position: absolute;
    left: 15px;
    /* distance from left edge */
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    /* adjust icon size */
    pointer-events: none;
}

/* Add left padding for toast content so text doesn't overlap icon */
.toast {
    padding-left: 20px;
    /* space for icon */
}

/* Toast Types */
.toast-success {
    border-left-color: #4CAF50;
}

.toast-error {
    border-left-color: #F44336;
}

.toast-info {
    border-left-color: #2196F3;
}

.toast-warning {
    border-left-color: #FF9800;
}

/* Toast Icon Colors */
.toast-success .toast-icon {
    color: #4CAF50;
}

.toast-error .toast-icon {
    color: #F44336;
}

.toast-info .toast-icon {
    color: #2196F3;
}

.toast-warning .toast-icon {
    color: #FF9800;
}

/* Toast Content */
.toast-content {
    flex: 1;
}

/* Title */
.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

/* Message */
.toast-message {
    line-height: 1.4;
    gap: 10px;
    display: flex;
    flex-direction: column;
}

.toast-message > p {
    padding: 0;
    margin: 0;
}

/* Close Button */
.toast-close-button {
    background: transparent;
    border: none;
    font-size: 22px;
    font-weight: 400;
    color: #888;
    margin-left: 12px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    position: absolute;
    right: 0;
    top: 0;
    margin: 0;
    padding: 0 15px;
    /* height: 100%; */
}

.toast-close-button:hover {
    opacity: 1;
}

/* Animations */
@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes progressBar {
    0% {
        width: 100%;
    }

    100% {
        width: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .button-grid {
        grid-template-columns: 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.2rem;
    }

    .toast {
        min-width: 280px;
        max-width: 320px;
    }
}