/* ==================================================================== */
/* Base Toast Notification Styles                                       */
/* ==================================================================== */

.toast-notification {
    /* Positioning and Layering */
    position: fixed;
    z-index: 999999;
    /* Ensures the toast appears on top of other elements */

    /* Box Model and Appearance */
    /* max-width: 300px; */
    background-color: #fff;
    box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    display: flex;
    padding: 10px 20px 15px 20px;
    overflow: hidden;
    /* Essential for containing the progress bar and respecting border-radius */

    /* Initial state for animation (positioned off-screen at the top) */
    transform: translate(0, -150%);

    /* Removes text decoration if the toast is a link */
    text-decoration: none;
}

/* Specific style for toasts that are links */
a.toast-notification {
    /* Default text color for the link, can be overridden by theme styles */
    color: #bbbbbb;
    text-decoration: none;
}


/* ==================================================================== */
/* Inner Toast Structure                                                */
/* ==================================================================== */

.toast-notification .toast-notification-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    /* Takes up available space */
    padding-right: 10px;
    overflow: hidden;
}

.toast-notification .toast-notification-wrapper .toast-notification-header {
    padding: 0;
    margin: 0;
    font-weight: 500;
    font-size: 15px;
    color: #bbbbbb;
    /* IMPROVEMENT: `overflow-wrap` is better than `word-break` for wrapping long text without breaking words */
    overflow-wrap: break-word;
}

.toast-notification .toast-notification-wrapper .toast-notification-content {
    margin: 15px 0 0 0;
    font-size: 12px;
    line-height: normal;
    padding: 0;
    color: #bbbbbb;
}

.toast-notification .toast-notification-close {
    position: absolute;
    top: 5px;
    right: 10px;

    /* Reset button styles */
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;

    /* Text styles */
    font-size: 15px;
    line-height: normal;
    font-weight: 600;
    color: #eeeeee;
    outline: none;
}

/* Hover effect */
.toast-notification .toast-notification-close:hover {
    color: rgba(0, 0, 0, 0.4);
}


/* ==================================================================== */
/* Positioning Classes                                                  */
/* Defines the initial off-screen state for different positions.        */
/* The JavaScript will calculate the final animated position.           */
/* ==================================================================== */

.toast-notification.toast-notification-top-center {
    /* CORRECTION: Uses translate(-50%) with `left: 50%` from JS for perfect horizontal centering. */
    transform: translate(-50%, -150%);
}

.toast-notification.toast-notification-bottom-left,
.toast-notification.toast-notification-bottom-right {
    transform: translate(0, 150%);
}

.toast-notification.toast-notification-bottom-center {
    /* CORRECTION: Uses translate(-50%) with `left: 50%` from JS for perfect horizontal centering. */
    transform: translate(-50%, 150%);
}


/* ==================================================================== */
/* Style/Theme Classes                                                  */
/* ==================================================================== */

/* --- Dark Theme --- */
.toast-notification.toast-notification-dark {
    background-color: #000000;
}

.toast-notification.toast-notification-dark .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-dark .toast-notification-wrapper .toast-notification-content,
.toast-notification.toast-notification-dark .toast-notification-close {
    color: #ffffff;
}

.toast-notification.toast-notification-dark .toast-notification-close:hover {
    color: #bbbbbb;
}

/* --- Success Theme --- */
.toast-notification.toast-notification-success {
    background-color: #c3f3d7;
    border-left: 10px solid #51a775;
}

.toast-notification.toast-notification-success .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-success .toast-notification-wrapper .toast-notification-content {
    color: #51a775;
}

.toast-notification.toast-notification-success .toast-notification-close {
    color: #51a775;
}

.toast-notification.toast-notification-success .toast-notification-close:hover {
    color: #3a7c56;
}

/* --- Warning Theme (New) --- */
.toast-notification.toast-notification-warning {
    background-color: #faa500;
    /* Um fundo amarelo-pálido que complementa o laranja */
    border-left: 10px solid #b37500;
    /* A cor principal #faa500 para a borda */
}

.toast-notification.toast-notification-warning .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-warning .toast-notification-wrapper .toast-notification-content {
    color: #5a3900;
    /* Um tom de castanho-dourado escuro para garantir boa legibilidade */
    font-weight: 500;
}

.toast-notification.toast-notification-warning .toast-notification-close {
    color: #b37500;
}

.toast-notification.toast-notification-warning .toast-notification-close:hover {
    color: #5a3900;
    /* Um tom ainda mais escuro para o efeito hover */ }

/* --- Error Theme --- */
.toast-notification.toast-notification-error {
    background-color: #f3c3c3;
    border-left: 10px solid #a75151;
}

.toast-notification.toast-notification-error .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-error .toast-notification-wrapper .toast-notification-content {
    color: #a75151;
}

.toast-notification.toast-notification-error .toast-notification-close {
    color: #a75151;
}

.toast-notification.toast-notification-error .toast-notification-close:hover {
    color: #813838;
}

/* --- Verified/Info Theme --- */
.toast-notification.toast-notification-verified {
    background-color: #d0eaff;
    border-left: 10px solid #6097b8;
}

.toast-notification.toast-notification-verified .toast-notification-wrapper .toast-notification-header,
.toast-notification.toast-notification-verified .toast-notification-wrapper .toast-notification-content {
    color: #6097b8;
}

.toast-notification.toast-notification-verified .toast-notification-close {
    color: #6097b8;
}

.toast-notification.toast-notification-verified .toast-notification-close:hover {
    color: #497895;
}

/* --- Dimmed State --- */
/* Dims toasts that are behind a new one */
.toast-notification.toast-notification-dimmed {
    opacity: 0.3;
}

.toast-notification.toast-notification-dimmed:hover,
.toast-notification.toast-notification-dimmed:active {
    opacity: 1;
}


/* ==================================================================== */
/* Action Buttons and Progress Bar                                      */
/* ==================================================================== */

/* Style for the revert action button */
.toast-notification .revert-action-button {
    color: #000000;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 10px;
}

.toast-notification .revert-action-button:hover {
    text-decoration: underline;
}

/* --- Progress Bar Styles --- */
/* The progress bar container */
.toast-notification .progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* CORRECTION/IMPROVEMENT: The height is defined on the container. */
    height: 4px;
    display: flex;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.1);
}

/* The inner progress bar that gets animated */
.toast-notification .progress-bar-inner {
    /* The inner bar fills 100% of the container's height. */
    height: 100%;
    background-color: #000000;
    animation: progress_bar-countdown linear 1 forwards;
    animation-play-state: paused;
    /* Will be set to 'running' by JS */
}

/* Sets the progress bar color for each theme */
.progress-bar-inner.progress-dark {
    background-color: #ffffff;
}

.progress-bar-inner.progress-success {
    background-color: #51a775;
}

.progress-bar-inner.progress-verified {
    background-color: #6097b8;
}

.progress-bar-inner.progress-warning {
    background-color: #b37500;
}

.progress-bar-inner.progress-error {
    background-color: #a75151;
}


/* ==================================================================== */
/* Animations and Other Rules                                           */
/* ==================================================================== */

/* Progress Bar Animation */
@keyframes progress_bar-countdown {

    /* Animates the width from 100% to 0% */
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/*
    COMMENTED-OUT RULE: This rule probably doesn't work as intended.
    1. The main class is `.toast-notification`, not `.toast`.
    2. The `~` (general sibling) selector would only affect buttons that are siblings
       to the toast element in the `<body>`.
    3. It's very specific and brittle. Uncomment with care if you know what you are doing.
  */
/*
  .toast.active~button {
    pointer-events: none;
  }
  */