:root {
    --success-primary: #2DD743;
    --success-secondary: #E3FEE6;
    --error-primary: #E63435;
    --error-secondary: #FFEAEC;
    --default-primary: #404040;
    /* Default primary color */
    --default-secondary: #606060;
    /* Default secondary color */
}

#toast {
    display: flex;
    align-items: center;
    max-width: 400px;
    width: fit-content;
    padding: 10px 14px;
    position: fixed;
    border-radius: 5px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
    top: 5px;
    right: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#icon-wrapper {
    width: 30px;
    height: 30px;
    background: var(--secondary);
    border-radius: 5px;
    box-sizing: border-box;
    padding: 5px;
}

#icon {
    background: var(--primary);
    border-radius: 50%;
    height: 100%;
    width: 100%;
    position: relative;
}

#icon::before,
#icon::after {
    position: absolute;
    content: "";
    background: var(--secondary);
    border-radius: 5px;
    top: 50%;
    left: 50%;
}

#toast-message {
    padding: 5px 20px 5px 10px;
}

#toast-message h4,
#toast-message p {
    margin: 0;
    line-height: 1.2em;
}

#toast-message h4 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .05em;
    color: var(--default-primary);
}

#toast-message p {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: .05em;
    color: var(--default-secondary);
}

#toast-close {
    position: relative;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease-in-out;
}

#toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

#toast-close::before,
#toast-close::after {
    position: absolute;
    content: '';
    height: 12px;
    width: 1px;
    border-radius: 5px;
    background: #606060;
    top: 50%;
    left: 50%;
    transition: background 0.2s ease-in-out;
}

#toast-close:hover::before,
#toast-close:hover::after {
    background: #404040;
}

#toast-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#toast-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes close {
    from {
        top: 5px;
        opacity: 1;
        transform: translateX(-50%) scale(1);
        visibility: visible;
    }

    to {
        top: -25px;
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
        visibility: hidden;
    }
}

@keyframes open {
    from {
        top: -25px;
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
        visibility: hidden;
    }

    to {
        top: 5px;
        opacity: 1;
        transform: translateX(-50%) scale(1);
        visibility: visible;
    }
}

#timer {
    width: 0%;
    height: 4px;
    background: var(--primary);
    position: absolute;
    bottom: 0;
    left: 0;
    border-top-right-radius: 5px;
    box-shadow: 0 0 8px var(--primary);
}

.timer-animation {
    animation: countdown 5s linear forwards;
}

@keyframes countdown {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ----------------------- */
/* Success Styling         */
/* ----------------------- */
.success {
    --primary: var(--success-primary);
    --secondary: var(--success-secondary);
}

.success #icon {
    transform: rotate(-45deg);
}

.success #icon::before {
    width: 10px;
    height: 3px;
    transform: translate(calc(-50% + 1px), calc(-50% + 1px));
}

.success #icon::after {
    width: 3px;
    height: 6px;
    transform: translate(calc(-50% - 3px), calc(-50% - 1px));
}

/* ----------------------- */
/* Error Styling           */
/* ----------------------- */
.error {
    --primary: var(--error-primary);
    --secondary: var(--error-secondary);
}

.error #icon::before {
    width: 3px;
    height: 3px;
    transform: translate(-50%, calc(-50% + 4px));
}

.error #icon::after {
    width: 3px;
    height: 7px;
    transform: translate(-50%, calc(-50% - 2px));
}