@use '../abstracts' as *;

/**
 * Global Spinner Overlay
 */
.gfm-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: $transition-base;

    &.show {
        opacity: 1;
        pointer-events: all;
    }
}

.gfm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba($primary, 0.2);
    border-top-color: $primary;
    border-radius: 50%;
    animation: gfm-spin 0.8s linear infinite;
}

@keyframes gfm-spin {
    to {
        transform: rotate(360deg);
    }
}

/**
 * Floating Notice HUD (toast)
 */
.gfm-builder-notice {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 13.5px;
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    @include transition;
    opacity: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 92vw;
    border-left: 4px solid transparent;

    .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
        flex-shrink: 0;

        &.is-spinning {
            animation: gfm-spin 0.8s linear infinite;
        }
    }

    .gfm-notice-text {
        line-height: 1.4;
    }

    .gfm-notice-action {
        margin-left: 6px;
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
        border: none;
        padding: 5px 12px;
        border-radius: 6px;
        font-size: 12.5px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease;

        &:hover {
            background: rgba(255, 255, 255, 0.24);
        }
    }

    &.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    &.gfm-notice-success {
        border-left-color: $success;
        .dashicons { color: $success; }
    }

    &.gfm-notice-error {
        border-left-color: $danger;
        .dashicons { color: $danger; }
    }

    &.gfm-notice-info {
        border-left-color: $info;
        .dashicons { color: $info; }
    }

    &.gfm-notice-warning {
        border-left-color: $warning;
        .dashicons { color: $warning; }
    }

    &.gfm-notice-loading {
        border-left-color: $primary-alt;
        .dashicons { color: $primary-alt; }
    }
}