/**
 * GPLT My Account - notification-styles.css
 *
 * Loads on: Every My Account page (toast notifications, rendered by assets/js/notifications.js).
 *
 * Editing guide:
 *   - Selectors are namespaced .gplt-* ; anything else belongs to WooCommerce,
 *     YITH or the theme and is being overridden deliberately.
 *   - Some selectors are defined twice on purpose, the later one overriding the
 *     earlier. Check for a second definition before changing a value.
 *
 * @package GPLT_My_Account
 */

/* Toasts (notifications.js turns WooCommerce notices on My Account pages into these).
   40.24.0 (owner): same design as the bookmark toast - a dark card (site ink) with a coloured icon disc, a strong
   shadow so it stands apart from the page, a thin bar counting down how long it stays (--gplt-toast-time, set by
   the script; 4 s by default), and it slides in from beyond the right edge and back out there.
   40.23.1: bottom-right, just above the back-to-top button (lifted by --gpl-top-lift). */
.gplt-toast-container {
    position: fixed;
    bottom: calc(84px + var(--gpl-top-lift, 0px));
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.gplt-toast {
    --gplt-tone: #38bdf8;
    position: relative;
    box-sizing: border-box;
    min-width: 280px;
    max-width: 380px;
    margin: 0;
    padding: 12px 18px 12px 12px;
    overflow: hidden;
    border-radius: 14px;
    background: #0f1b2a;
    box-shadow: 0 22px 44px -16px rgba(15, 27, 42, 0.6), 0 6px 14px -6px rgba(15, 27, 42, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #ffffff;
    opacity: 0;
    pointer-events: auto;
    transform: translateX(calc(100% + 48px));
    transition: transform 0.3s cubic-bezier(0.55, 0, 1, 0.45), opacity 0.3s ease;
}

.gplt-toast.show {
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

/* The type classes are bare words, and Flatsome styles .success / .error globally (background-color), so the
   dark ground is restated here at the same specificity as the type. */
.gplt-toast.success { --gplt-tone: #22c55e; background: #0f1b2a; }
.gplt-toast.error { --gplt-tone: #ef4444; background: #0f1b2a; }
.gplt-toast.info { --gplt-tone: #38bdf8; background: #0f1b2a; }

.gplt-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gplt-toast-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gplt-tone);
    color: #ffffff;
}

.gplt-toast-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.4;
}

.gplt-toast-message {
    flex: 1 1 auto;
    min-width: 0;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
}

.gplt-toast::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--gplt-tone);
    opacity: 0.85;
    transform-origin: left center;
    transform: scaleX(0);
}

.gplt-toast.show::after {
    animation: gplt-toast-time var(--gplt-toast-time, 4s) linear forwards;
}

@keyframes gplt-toast-time {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Animation */
@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .gplt-toast-container { left: 16px; right: 16px; bottom: calc(68px + var(--gpl-top-lift, 0px)); align-items: stretch; }
    .gplt-toast { min-width: 0; max-width: none; transform: translateX(calc(100% + 32px)); }
}

@media (prefers-reduced-motion: reduce) {
    .gplt-toast,
    .gplt-toast.show { transform: none; transition: opacity 0.2s ease; }
    .gplt-toast.show::after { animation: none; }
}
